* See documentation in DefaultSettings.php for detailed explanations of each
* variable.
*
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
protected $channel;
/**
- * Convert Psr\Log\LogLevel constants into int for sane comparisons
+ * Convert Psr\\Log\\LogLevel constants into int for sane comparisons
* These are the same values that Monlog uses
*
- * @var array
+ * @var array $levelMapping
*/
protected static $levelMapping = array(
LogLevel::DEBUG => 100,
*
* @param string $channel
* @param string $message
- * @param string|int $level Psr\Log\LogEvent constant or Monlog level int
+ * @param string|int $level Psr\\Log\\LogEvent constant or Monlog level int
* @param array $context
* @return bool True if message should be sent to disk/network, false
* otherwise
* );
* @endcode
*
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
* Get a logger instance.
*
* @param string $channel Logging channel
- * @return \Psr\Log\LoggerInterface Logger instance
+ * @return \\Psr\\Log\\LoggerInterface Logger instance
*/
public function getLogger( $channel ) {
if ( !isset( $this->singletons[$channel] ) ) {
/**
* PSR-3 logger instance factory.
*
- * Creation of \Psr\Log\LoggerInterface instances is managed via the
+ * Creation of \\Psr\\Log\\LoggerInterface instances is managed via the
* LoggerFactory::getInstance() static method which in turn delegates to the
* currently registered service provider.
*
* $wgMWLoggerDefaultSpi is expected to be an array usable by
* ObjectFactory::getObjectFromSpec() to create a class.
*
- * @see \MediaWiki\Logger\Spi
+ * @see \\MediaWiki\\Logger\\Spi
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
/**
- * Register a service provider to create new \Psr\Log\LoggerInterface
+ * Register a service provider to create new \\Psr\\Log\\LoggerInterface
* instances.
*
- * @param \MediaWiki\Logger\Spi $provider Provider to register
+ * @param \\MediaWiki\\Logger\\Spi $provider Provider to register
*/
public static function registerProvider( Spi $provider ) {
self::$spi = $provider;
* Spi registration. $wgMWLoggerDefaultSpi is expected to be an
* array usable by ObjectFactory::getObjectFromSpec() to create a class.
*
- * @return \MediaWiki\Logger\Spi
+ * @return \\MediaWiki\\Logger\\Spi
* @see registerProvider()
* @see ObjectFactory::getObjectFromSpec()
*/
* Get a named logger instance from the currently configured logger factory.
*
* @param string $channel Logger channel (name)
- * @return \Psr\Log\LoggerInterface
+ * @return \\Psr\\Log\\LoggerInterface
*/
public static function getInstance( $channel ) {
if ( !interface_exists( '\Psr\Log\LoggerInterface' ) ) {
* Configured using an array of configuration data with the keys 'loggers',
* 'processors', 'handlers' and 'formatters'.
*
- * The ['loggers']['@default'] configuration will be used to create loggers
+ * The ['loggers']['\@default'] configuration will be used to create loggers
* for any channel that isn't explicitly named in the 'loggers' configuration
* section.
*
* name will return the cached instance.
*
* @param string $channel Logging channel
- * @return \Psr\Log\LoggerInterface Logger instance
+ * @return \\Psr\\Log\\LoggerInterface Logger instance
*/
public function getLogger( $channel ) {
if ( !isset( $this->singletons['loggers'][$channel] ) ) {
* Create a logger.
* @param string $channel Logger channel
* @param array $spec Configuration
- * @return \Monolog\Logger
+ * @return \\Monolog\\Logger
*/
protected function createLogger( $channel, $spec ) {
$obj = new Logger( $channel );
/**
* Create or return cached handler.
* @param string $name Processor name
- * @return \Monolog\Handler\HandlerInterface
+ * @return \\Monolog\\Handler\\HandlerInterface
*/
public function getHandler( $name ) {
if ( !isset( $this->singletons['handlers'][$name] ) ) {
/**
* Create or return cached formatter.
* @param string $name Formatter name
- * @return \Monolog\Formatter\FormatterInterface
+ * @return \\Monolog\\Formatter\\FormatterInterface
*/
public function getFormatter( $name ) {
if ( !isset( $this->singletons['formatters'][$name] ) ) {
use Psr\Log\NullLogger;
/**
- * LoggerFactory service provider that creates \Psr\Log\NullLogger
+ * LoggerFactory service provider that creates \\Psr\\Log\\NullLogger
* instances. A NullLogger silently discards all log events sent to it.
*
* Usage:
* );
* @endcode
*
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
class NullSpi implements Spi {
/**
- * @var \Psr\Log\NullLogger $singleton
+ * @var \\Psr\\Log\\NullLogger $singleton
*/
protected $singleton;
* Get a logger instance.
*
* @param string $channel Logging channel
- * @return \Psr\Log\NullLogger Logger instance
+ * @return \\Psr\\Log\\NullLogger Logger instance
*/
public function getLogger( $channel ) {
return $this->singleton;
namespace MediaWiki\Logger;
/**
- * Service provider interface for \Psr\Log\LoggerInterface implementation
+ * Service provider interface for \\Psr\\Log\\LoggerInterface implementation
* libraries.
*
* MediaWiki can be configured to use a class implementing this interface to
- * create new \Psr\Log\LoggerInterface instances via either the
+ * create new \\Psr\\Log\\LoggerInterface instances via either the
* $wgMWLoggerDefaultSpi global variable or code that constructs an instance
* and registers it via the LoggerFactory::registerProvider() static method.
*
- * @see \MediaWiki\Logger\LoggerFactory
+ * @see \\MediaWiki\\Logger\\LoggerFactory
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2014 Bryan Davis and Wikimedia Foundation.
* Get a logger instance.
*
* @param string $channel Logging channel
- * @return \Psr\Log\LoggerInterface Logger instance
+ * @return \\Psr\\Log\\LoggerInterface Logger instance
*/
public function getLogger( $channel );
/**
* Log message formatter that mimics the legacy log message formatting of
* `wfDebug`, `wfDebugLog`, `wfLogDBError` and `wfErrorLog` global functions by
- * delegating the formatting to \MediaWiki\Logger\LegacyLogger.
+ * delegating the formatting to \\MediaWiki\\Logger\\LegacyLogger.
*
* @since 1.25
* @author Bryan Davis <bd808@wikimedia.org>
* @copyright © 2013 Bryan Davis and Wikimedia Foundation.
- * @see \MediaWiki\Logger\LegacyLogger
+ * @see \\MediaWiki\\Logger\\LegacyLogger
*/
class LegacyFormatter extends NormalizerFormatter {