ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Monolog\PsrLogCompatTest Class Reference
+ Inheritance diagram for Monolog\PsrLogCompatTest:
+ Collaboration diagram for Monolog\PsrLogCompatTest:

Public Member Functions

 getLogger ()
 
 getLogs ()
 
- Public Member Functions inherited from Psr\Log\Test\LoggerInterfaceTest
 getLogger ()
 
 getLogs ()
 This must return the log messages in order. More...
 
 testImplements ()
 
 testLogsAtAllLevels ($level, $message)
 provideLevelsAndMessages More...
 
 provideLevelsAndMessages ()
 
 testThrowsOnInvalidLevel ()
 
 testContextReplacement ()
 
 testObjectCastToString ()
 
 testContextCanContainAnything ()
 
 testContextExceptionKeyCanBeExceptionOrOtherValues ()
 

Private Attributes

 $handler
 

Detailed Description

Definition at line 19 of file PsrLogCompatTest.php.

Member Function Documentation

◆ getLogger()

Monolog\PsrLogCompatTest::getLogger ( )

Definition at line 23 of file PsrLogCompatTest.php.

References $handler.

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  }

◆ getLogs()

Monolog\PsrLogCompatTest::getLogs ( )

Definition at line 35 of file PsrLogCompatTest.php.

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  }

Field Documentation

◆ $handler

Monolog\PsrLogCompatTest::$handler
private

Definition at line 21 of file PsrLogCompatTest.php.


The documentation for this class was generated from the following file: