== 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 |
||
|---|---|---|
| .. | ||
| monolog | ||
| ConsoleLogger.php | ||
| ConsoleSpi.php | ||
| LegacyLogger.php | ||
| LegacySpi.php | ||
| LogCapturingSpi.php | ||
| LoggerFactory.php | ||
| MonologSpi.php | ||
| NullSpi.php | ||
| Spi.php | ||