ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
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
14
use
Monolog\Utils
;
15
23
class
PsrLogMessageProcessor
implements
ProcessorInterface
24
{
29
public
function
__invoke
(array $record)
30
{
31
if
(
false
=== strpos($record[
'message'
],
'{'
)) {
32
return
$record;
33
}
34
35
$replacements = array();
36
foreach
($record[
'context'
] as
$key
=> $val) {
37
if
(is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val,
"__toString"
))) {
38
$replacements[
'{'
.$key.
'}'
] = $val;
39
} elseif (is_object($val)) {
40
$replacements[
'{'
.$key.
'}'
] =
'[object '
.Utils::getClass($val).
']'
;
41
}
else
{
42
$replacements[
'{'
.$key.
'}'
] =
'['
.gettype($val).
']'
;
43
}
44
}
45
46
$record[
'message'
] = strtr($record[
'message'
], $replacements);
47
48
return
$record;
49
}
50
}
Monolog\Processor
Definition:
GitProcessor.php:12
Utils
Monolog\Processor\PsrLogMessageProcessor
Processes a record's message according to PSR-3 rules.
Definition:
PsrLogMessageProcessor.php:23
Monolog\Processor\PsrLogMessageProcessor\__invoke
__invoke(array $record)
Definition:
PsrLogMessageProcessor.php:29
php
$key
$key
Definition:
croninfo.php:18
Monolog\Processor\ProcessorInterface
An optional interface to allow labelling Monolog processors.
Definition:
ProcessorInterface.php:19
libs
composer
vendor
monolog
monolog
src
Monolog
Processor
PsrLogMessageProcessor.php
Generated on Thu Feb 27 2025 19:01:21 for ILIAS by
1.8.13 (using
Doxyfile
)