MediaWiki REL1_39
ConsoleLogger.php
Go to the documentation of this file.
1<?php
2
4
5use Psr\Log\AbstractLogger;
6
12class 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.
log( $level, $message, array $context=[])
static format( $channel, $message, $context)
Format a message.