diff --git a/src/PsrLogAdapter.php b/src/PsrLogAdapter.php index 8324ed40b..18e0cea89 100644 --- a/src/PsrLogAdapter.php +++ b/src/PsrLogAdapter.php @@ -54,6 +54,16 @@ public static function addLogger(LoggerInterface $logger): void addSubscriber($instance); } + public static function removeLogger(LoggerInterface $logger): void + { + $instance = self::getInstance(); + $instance->loggers->detach($logger); + + if ($instance->loggers->count() === 0) { + removeSubscriber($instance); + } + } + /** * Pipes a log message from PHPC to all registered PSR loggers. * @@ -82,16 +92,6 @@ public function log(int $level, string $domain, string $message): void } } - public static function removeLogger(LoggerInterface $logger): void - { - $instance = self::getInstance(); - $instance->loggers->detach($logger); - - if ($instance->loggers->count() === 0) { - removeSubscriber($instance); - } - } - /** * Writes a log message to all registered PSR loggers. *