Adds DI::flushLogger() to renew Logger instances
This commit is contained in:
12
src/DI.php
12
src/DI.php
@@ -230,6 +230,18 @@ abstract class DI
|
||||
// "LoggerInterface" instances
|
||||
//
|
||||
|
||||
/**
|
||||
* Flushes the Logger instance, so the factory is called again
|
||||
* (creates a new id and retrieves the current PID)
|
||||
*/
|
||||
public static function flushLogger()
|
||||
{
|
||||
$flushDice = self::$dice
|
||||
->addRule(LoggerInterface::class, self::$dice->getRule(LoggerInterface::class))
|
||||
->addRule('$devLogger', self::$dice->getRule('$devLogger'));
|
||||
static::init($flushDice);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LoggerInterface
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user