ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
21
class
PsrLogMessageProcessor
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
}
Monolog\Processor
Definition:
GitProcessor.php:12
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
Monolog\Processor\PsrLogMessageProcessor
Processes a record's message according to PSR-3 rules.
Definition:
PsrLogMessageProcessor.php:21
Monolog\Processor\PsrLogMessageProcessor\__invoke
__invoke(array $record)
Definition:
PsrLogMessageProcessor.php:27
$key
$key
Definition:
croninfo.php:18
libs
composer
vendor
monolog
monolog
src
Monolog
Processor
PsrLogMessageProcessor.php
Generated on Tue Jan 28 2025 19:01:07 for ILIAS by
1.8.13 (using
Doxyfile
)