MediaWiki 1.39.8
MediaWiki\Logger\LogCapturingSpi Class Reference

Wraps another spi to capture all logs generated. More...

Inheritance diagram for MediaWiki\Logger\LogCapturingSpi:
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

Wraps another spi to capture all logs generated.

This can be used, for example, to collect all logs generated during a unit test and report them when the test fails.

Definition at line 13 of file LogCapturingSpi.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 21 of file LogCapturingSpi.php.

Member Function Documentation

◆ capture()

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

Definition at line 46 of file LogCapturingSpi.php.

◆ getInnerSpi()

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

Definition at line 86 of file LogCapturingSpi.php.

◆ getLogger()

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

Implements MediaWiki\Logger\Spi.

Definition at line 36 of file LogCapturingSpi.php.

◆ getLogs()

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

Definition at line 28 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 96 of file LogCapturingSpi.php.


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