MediaWiki master
MediaWiki\Logger\LogCapturingSpi Class Reference

Wrap another Spi and keep a copy of all log messages. More...

Inherits MediaWiki\Logger\Spi.

Collaboration diagram for MediaWiki\Logger\LogCapturingSpi:

Public Member Functions

 __construct (Spi $inner)
 
 capture ( $log)
 
 getInnerSpi ()
 
 getLogger ( $channel)
 
 getLogs ()
 
 setLoggerForTest ( $channel, LoggerInterface $logger=null)
 

Detailed Description

Wrap another Spi and keep a copy of all log messages.

This is developed for use by PHPUnit bootstrapping, to collect logs generated during a given unit test, and print them after a failing test.

Access: internal
For use in MediaWiki core only

Definition at line 17 of file LogCapturingSpi.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Logger\LogCapturingSpi::__construct ( Spi $inner)

Definition at line 25 of file LogCapturingSpi.php.

Member Function Documentation

◆ capture()

MediaWiki\Logger\LogCapturingSpi::capture ( $log)
Parameters
array$log

Definition at line 50 of file LogCapturingSpi.php.

◆ getInnerSpi()

MediaWiki\Logger\LogCapturingSpi::getInnerSpi ( )
Access: internal
For use by MediaWikiIntegrationTestCase
Returns
Spi

Definition at line 90 of file LogCapturingSpi.php.

◆ getLogger()

MediaWiki\Logger\LogCapturingSpi::getLogger ( $channel)
Parameters
string$channel
Returns
LoggerInterface

Implements MediaWiki\Logger\Spi.

Definition at line 40 of file LogCapturingSpi.php.

◆ getLogs()

MediaWiki\Logger\LogCapturingSpi::getLogs ( )
Returns
array

Definition at line 32 of file LogCapturingSpi.php.

◆ setLoggerForTest()

MediaWiki\Logger\LogCapturingSpi::setLoggerForTest ( $channel,
LoggerInterface $logger = null )
Access: internal
For use by MediaWikiIntegrationTestCase
Parameters
string$channel
LoggerInterface | null$logger
Returns
LoggerInterface|null

Definition at line 100 of file LogCapturingSpi.php.


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