ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ScalarFormatter.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the Monolog package.
5  *
6  * (c) Jordi Boggiano <j.boggiano@seld.be>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11 
12 namespace Monolog\Formatter;
13 
21 {
25  public function format(array $record)
26  {
27  foreach ($record as $key => $value) {
28  $record[$key] = $this->normalizeValue($value);
29  }
30 
31  return $record;
32  }
33 
38  protected function normalizeValue($value)
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  }
48 }
format(array $record)
{Formats a log record.A record to format mixed The formatted record}
Normalizes incoming records to remove objects/resources so it&#39;s easier to dump to various targets...
toJson($data, $ignoreErrors=false)
Return the JSON representation of a value.
Formats data into an associative array of scalar values.
$key
Definition: croninfo.php:18