BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
TestLogger Class Reference
Inheritance diagram for TestLogger:
Collaboration diagram for TestLogger:

Public Member Functions

 __construct ($collect=false, $filter=null)
 
 setCollect ($collect)
 
 getBuffer ()
 
 clearBuffer ()
 
 log ($level, $message, array $context=[])
 
- Public Member Functions inherited from Psr\Log\AbstractLogger
 emergency ($message, array $context=array())
 
 alert ($message, array $context=array())
 
 critical ($message, array $context=array())
 
 error ($message, array $context=array())
 
 warning ($message, array $context=array())
 
 notice ($message, array $context=array())
 
 info ($message, array $context=array())
 
 debug ($message, array $context=array())
 

Detailed Description

A logger that may be configured to either buffer logs or to print them to the output where PHPUnit will complain about them.

Since
1.27

Constructor & Destructor Documentation

TestLogger::__construct (   $collect = false,
  $filter = null 
)
Parameters
bool$collectWhether to collect logs
callable$filterFilter logs before collecting/printing. Signature is string|null function ( string $message, string $level );

Member Function Documentation

TestLogger::clearBuffer ( )

Clear the collected log buffer

TestLogger::getBuffer ( )

Return the collected logs

Returns
array Array of array( string $level, string $message )
TestLogger::log (   $level,
  $message,
array  $context = [] 
)

Logs with an arbitrary level.

Parameters
mixed$level
string$message
array$context
Returns
null

Implements Psr\Log\LoggerInterface.

TestLogger::setCollect (   $collect)

Set the "collect" flag

Parameters
bool$collect

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