wiki.techinc.nl/includes/debug/logger
Timo Tijhof e0ed6df864 phpunit: Add setNullLogger() and make tests default to LegacySpi
== Motivation

Mute a log channel, for which the Logger object is injected by
service wiring, for a service that is overridden by default,
such as 'DBLoadBalancerFactory'. For that, calling setLogger()
mid-test would be too late.

== Changes

* Add a test-only method to LegacyLogger that makes it possible
  to change its `minimumLevel` attribute, thus making it turn
  itself into a NullLogger if raised to infinity. This is the
  same principle we use already for disabled log channels when
  using MediaWiki normally (see LegacyLogger::__construct).

* Previously, the developer's LocalSettings.php was loaded
  which includes the Spi configuration. This meant other Spi's
  could be configured which means we might not be dealing with
  a LegacyLogger object.

  Similar to what we do with ObjectCache and JobQueue already,
  make the default Spi in tests the same as the normal MW default.

* Add setNullLogger() which makes use of these two.

Bug: T248195
Change-Id: Ieade3585812de47342259afa765e230fff06f526
2020-04-07 22:00:13 +00:00
..
monolog WikiMap: Add WikiMap::getCurrentWikiId() to make common use case easier 2020-03-03 16:04:21 +00:00
ConsoleLogger.php Declare dynamic properties 2019-09-14 15:21:26 +02:00
ConsoleSpi.php Add missing newline between <?php and namespace/use section 2019-06-03 13:36:48 +00:00
LegacyLogger.php phpunit: Add setNullLogger() and make tests default to LegacySpi 2020-04-07 22:00:13 +00:00
LegacySpi.php phpunit: Add setNullLogger() and make tests default to LegacySpi 2020-04-07 22:00:13 +00:00
LogCapturingSpi.php phpunit: Add setNullLogger() and make tests default to LegacySpi 2020-04-07 22:00:13 +00:00
LoggerFactory.php
MonologSpi.php Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse 2020-01-10 09:32:25 -08:00
NullSpi.php Remove duplicate variable name from class property PHPDocs 2019-12-02 12:58:29 +00:00
Spi.php