ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Monolog\Formatter\ScalarFormatter Class Reference

Formats data into an associative array of scalar values. More...

+ Inheritance diagram for Monolog\Formatter\ScalarFormatter:
+ Collaboration diagram for Monolog\Formatter\ScalarFormatter:

Public Member Functions

 format (array $record)
 {Formats a log record.
Parameters
array$recordA record to format
Returns
mixed The formatted record
} More...
 
- Public Member Functions inherited from Monolog\Formatter\NormalizerFormatter
 __construct ($dateFormat=null)
 
 format (array $record)
 {Formats a log record.
Parameters
array$recordA record to format
Returns
mixed The formatted record
} More...
 
 formatBatch (array $records)
 {Formats a set of log records.
Parameters
array$recordsA set of records to format
Returns
mixed The formatted set of records
} More...
 
 detectAndCleanUtf8 (&$data)
 Detect invalid UTF-8 string characters and convert to valid UTF-8. More...
 

Protected Member Functions

 normalizeValue ($value)
 
- Protected Member Functions inherited from Monolog\Formatter\NormalizerFormatter
 normalize ($data)
 
 normalizeException ($e)
 
 toJson ($data, $ignoreErrors=false)
 Return the JSON representation of a value. More...
 

Additional Inherited Members

- Data Fields inherited from Monolog\Formatter\NormalizerFormatter
const SIMPLE_DATE = "Y-m-d H:i:s"
 
- Protected Attributes inherited from Monolog\Formatter\NormalizerFormatter
 $dateFormat
 

Detailed Description

Formats data into an associative array of scalar values.

Objects and arrays will be JSON encoded.

Author
Andrew Lawson adlaw.nosp@m.son@.nosp@m.gmail.nosp@m..com

Definition at line 20 of file ScalarFormatter.php.

Member Function Documentation

◆ format()

Monolog\Formatter\ScalarFormatter::format ( array  $record)

{Formats a log record.

Parameters
array$recordA record to format
Returns
mixed The formatted record
}

Implements Monolog\Formatter\FormatterInterface.

Definition at line 25 of file ScalarFormatter.php.

References Monolog\Formatter\ScalarFormatter\normalizeValue().

26  {
27  foreach ($record as $key => $value) {
28  $record[$key] = $this->normalizeValue($value);
29  }
30 
31  return $record;
32  }
+ Here is the call graph for this function:

◆ normalizeValue()

Monolog\Formatter\ScalarFormatter::normalizeValue (   $value)
protected
Parameters
mixed$value
Returns
mixed

Definition at line 38 of file ScalarFormatter.php.

References Monolog\Formatter\NormalizerFormatter\normalize(), and Monolog\Formatter\NormalizerFormatter\toJson().

Referenced by Monolog\Formatter\ScalarFormatter\format().

39  {
40  $normalized = $this->normalize($value);
41 
42  if (is_array($normalized) || is_object($normalized)) {
43  return $this->toJson($normalized, true);
44  }
45 
46  return $normalized;
47  }
toJson($data, $ignoreErrors=false)
Return the JSON representation of a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: