ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
PsrLogCompatTest.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
;
13
14
use
Monolog\Handler\TestHandler
;
15
use
Monolog\Formatter\LineFormatter
;
16
use
Monolog\Processor\PsrLogMessageProcessor
;
17
use
Psr\Log\Test\LoggerInterfaceTest
;
18
19
class
PsrLogCompatTest
extends
LoggerInterfaceTest
20
{
21
private
$handler
;
22
23
public
function
getLogger
()
24
{
25
$logger =
new
Logger
(
'foo'
);
26
$logger->pushHandler(
$handler
=
new
TestHandler
);
27
$logger->pushProcessor(
new
PsrLogMessageProcessor
);
28
$handler
->setFormatter(
new
LineFormatter
(
'%level_name% %message%'
));
29
30
$this->handler =
$handler
;
31
32
return
$logger;
33
}
34
35
public
function
getLogs
()
36
{
37
$convert =
function
($record) {
38
$lower =
function
($match) {
39
return
strtolower($match[0]);
40
};
41
42
return
preg_replace_callback(
'{^[A-Z]+}'
, $lower, $record[
'formatted'
]);
43
};
44
45
return
array_map($convert, $this->handler->getRecords());
46
}
47
}
TestHandler
Monolog\PsrLogCompatTest\getLogger
getLogger()
Definition:
PsrLogCompatTest.php:23
LineFormatter
LoggerInterfaceTest
Monolog\Logger
Monolog log channel.
Definition:
Logger.php:27
Monolog\PsrLogCompatTest\getLogs
getLogs()
Definition:
PsrLogCompatTest.php:35
Monolog\PsrLogCompatTest\$handler
$handler
Definition:
PsrLogCompatTest.php:21
Psr\Log\Test\LoggerInterfaceTest
Provides a base test class for ensuring compliance with the LoggerInterface.
Definition:
LoggerInterfaceTest.php:14
Monolog\Processor\PsrLogMessageProcessor
Processes a record's message according to PSR-3 rules.
Definition:
PsrLogMessageProcessor.php:21
Monolog
Definition:
ErrorHandler.php:12
Monolog\Handler\TestHandler
Used for testing purposes.
Definition:
TestHandler.php:66
Monolog\Formatter\LineFormatter
Formats incoming records into a one-line string.
Definition:
LineFormatter.php:22
$handler
$handler
Definition:
resumelogout.php:11
Monolog\PsrLogCompatTest
Definition:
PsrLogCompatTest.php:19
PsrLogMessageProcessor
libs
composer
vendor
monolog
monolog
tests
Monolog
PsrLogCompatTest.php
Generated on Sat Jan 18 2025 19:01:06 for ILIAS by
1.8.13 (using
Doxyfile
)