From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/debug/logger/LegacySpi.php | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 includes/debug/logger/LegacySpi.php (limited to 'includes/debug/logger/LegacySpi.php') diff --git a/includes/debug/logger/LegacySpi.php b/includes/debug/logger/LegacySpi.php new file mode 100644 index 00000000..1bf39e41 --- /dev/null +++ b/includes/debug/logger/LegacySpi.php @@ -0,0 +1,59 @@ + '\\MediaWiki\\Logger\\LegacySpi', + * ); + * @endcode + * + * @see \MediaWiki\Logger\LoggerFactory + * @since 1.25 + * @author Bryan Davis + * @copyright © 2014 Bryan Davis and Wikimedia Foundation. + */ +class LegacySpi implements Spi { + + /** + * @var array $singletons + */ + protected $singletons = array(); + + + /** + * Get a logger instance. + * + * @param string $channel Logging channel + * @return \Psr\Log\LoggerInterface Logger instance + */ + public function getLogger( $channel ) { + if ( !isset( $this->singletons[$channel] ) ) { + $this->singletons[$channel] = new LegacyLogger( $channel ); + } + return $this->singletons[$channel]; + } + +} -- cgit v1.2.3-54-g00ecf