ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PsrLogMessageProcessor.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\Processor;
13 
22 {
27  public function __invoke(array $record)
28  {
29  if (false === strpos($record['message'], '{')) {
30  return $record;
31  }
32 
33  $replacements = array();
34  foreach ($record['context'] as $key => $val) {
35  if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
36  $replacements['{'.$key.'}'] = $val;
37  } elseif (is_object($val)) {
38  $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
39  } else {
40  $replacements['{'.$key.'}'] = '['.gettype($val).']';
41  }
42  }
43 
44  $record['message'] = strtr($record['message'], $replacements);
45 
46  return $record;
47  }
48 }
Create styles array
The data for the language used.
Processes a record&#39;s message according to PSR-3 rules.
$key
Definition: croninfo.php:18