MediaWiki  master
ConsoleLogger.php
Go to the documentation of this file.
1 <?php
2 
3 namespace MediaWiki\Logger;
4 
6 
12 class ConsoleLogger extends AbstractLogger {
14  private $channel;
15 
19  public function __construct( $channel ) {
20  $this->channel = $channel;
21  }
22 
26  public function log( $level, $message, array $context = [] ) {
27  fwrite( STDERR, "[$level] " .
28  LegacyLogger::format( $this->channel, $message, $context ) );
29  }
30 }
A logger which writes to the terminal.
IContextSource $context
Definition: MediaWiki.php:37
log( $level, $message, array $context=[])
static format( $channel, $message, $context)
Format a message.