X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/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..8e750cab --- /dev/null +++ b/includes/debug/logger/LegacySpi.php @@ -0,0 +1,57 @@ + '\\MediaWiki\\Logger\\LegacySpi', + * ]; + * @endcode + * + * @see \MediaWiki\Logger\LoggerFactory + * @since 1.25 + * @copyright © 2014 Wikimedia Foundation and contributors + */ +class LegacySpi implements Spi { + + /** + * @var array $singletons + */ + protected $singletons = []; + + /** + * 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]; + } + +}