Skip to content

Commit

Permalink
Re-order internal methods for pendantry
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Sep 21, 2023
1 parent 45786d5 commit 4370f91
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/PsrLogAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 4370f91

Please sign in to comment.