Replace MWLogger with MWLoggerFactory
authorBryan Davis <bd808@wikimedia.org>
Tue, 13 Jan 2015 23:54:18 +0000 (16:54 -0700)
committerLegoktm <legoktm.wikipedia@gmail.com>
Thu, 22 Jan 2015 22:10:49 +0000 (22:10 +0000)
commit56b70b61afc69139e28ef501947184897eaa64c3
tree751ab1276f6680f926cf22b47a2ea75fe17a645d
parent8a5e57123e212db1079ad669051f4f81a2e1502c
Replace MWLogger with MWLoggerFactory

Time wounds all heels. During the code review for the PSR-3 logging
introduction, several people asked me why we needed a wrapper
for Psr\Log\LoggerInterface if the point was to use the standard. At the
time I was convinced that it would be better to introduce the dependency
via a wrapper class so that we could use the wrapper to patch over any
deficiencies that we might find in the PSR-3 API. After going on to work
on a project to disentangle other MediaWiki components from internal
project dependencies I have suddenly and clearly seen the error of my
ways.

We still need a logger factory as PSR-3 does not specify
a standard mechanism for creating Psr\Log\LoggerInterface instances. My
solution is to convert MWLogger into MWLoggerFactory to retain a static
factory interface for creating PSR-3 loggers but remove the MWLogger
wrapper class itself in favor of direct exposure of
Psr\Log\LoggerInterface to the MediaWiki consumer classes.

Change-Id: Ie47467657dcf341991ada00827dca5e8eff95438
13 files changed:
RELEASE-NOTES-1.25
autoload.php
docs/mwlogger.txt
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/debug/logger/Factory.php [new file with mode: 0644]
includes/debug/logger/Logger.php [deleted file]
includes/debug/logger/NullSpi.php
includes/debug/logger/Spi.php
includes/debug/logger/legacy/Logger.php
includes/debug/logger/legacy/Spi.php
includes/debug/logger/monolog/SamplingHandler.php
includes/debug/logger/monolog/Spi.php