3 namespace MediaWiki\Logger;
5 use Psr\Log\AbstractLogger;
8 * A logger which writes to the terminal. The output is supposed to be
9 * human-readable, and should be changed as necessary to better achieve that
12 class ConsoleLogger extends AbstractLogger {
13 public function __construct( $channel ) {
14 $this->channel = $channel;
17 public function log( $level, $message, array $context = [] ) {
18 fwrite( STDERR, "[$level] " .
19 LegacyLogger::format( $this->channel, $message, $context ) );