Skip to content

Commit

Permalink
N°6408 - CRUD : Fix log consuming too much memory
Browse files Browse the repository at this point in the history
  • Loading branch information
eespie committed Jul 12, 2023
1 parent 9b409b1 commit df1cb0b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/dbobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,11 @@ protected function _Set($sAttCode, $value)
public function Set($sAttCode, $value)
{
if (!utils::StartsWith(get_class($this), 'CMDBChange') && $this->GetKey() > 0) {
// not all the values have __to_string() so print_r is sed and preferred over var_export for the handling or circular references
$this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true));
if (is_object($value) || is_array($value)) {
$this->LogCRUDEnter(__METHOD__, "$sAttCode => object or array");
} else {
$this->LogCRUDEnter(__METHOD__, "$sAttCode => ".print_r($value, true));
}
}

$sMessage = $this->IsReadOnly();
Expand Down

1 comment on commit df1cb0b

@Hipska
Copy link
Contributor

@Hipska Hipska commented on df1cb0b Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, var_export could be used again as there won't be circular references anymore..

Please sign in to comment.