mirror of
https://github.com/friendica/friendica
synced 2025-04-27 10:30:10 +00:00
Adds DI::flushLogger() to renew Logger instances
This commit is contained in:
parent
7637ae1dcc
commit
32f0c3fb9c
3 changed files with 13 additions and 2 deletions
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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue