10use Wikimedia\ObjectFactory\ObjectFactory;
49 self::$spi = $provider;
65if ( self::$spi ===
null ) {
67 $provider = ObjectFactory::getObjectFromSpec(
100if ( !defined(
'MW_PHPUNIT_TEST' ) ) {
101thrownew LogicException( __METHOD__ .
' can only be used in PHPUnit tests' );
103 self::$context = $context;
109privatefunction __construct() {
if(!defined('MW_SETUP_CALLBACK'))
Create PSR-3 logger objects.
static registerProvider(Spi $provider)
Register a service provider to create new \Psr\Log\LoggerInterface instances.
static getInstance( $channel)
Get a named logger instance from the currently configured logger factory.
static setContext(LoggingContext $context)
Replace the logging context, for testing.
static getContext()
Get a logging context, which can be used to add information to all log events.
static getProvider()
Get the registered service provider.
A helper class for adding extra context to all logs, without the logging code having to be aware.
$wgMWLoggerDefaultSpi
Config variable stub for the MWLoggerDefaultSpi setting, for use by phpdoc and IDEs.
Service provider interface to create \Psr\Log\LoggerInterface objects.
Helper trait for implementations \DAO.