Skip to content

Commit

Permalink
Fix PhpUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
blankse committed Dec 22, 2022
1 parent f2eae32 commit 426572a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Micrometa/Infrastructure/Logger/ExceptionLogger.php
Expand Up @@ -38,6 +38,7 @@

use Jkphl\Micrometa\Ports\Exceptions\RuntimeException;
use Monolog\Handler\NullHandler;
use Monolog\Level;
use Monolog\Logger;
use Monolog\ResettableInterface;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -84,6 +85,9 @@ public function __construct($threshold = Logger::ERROR)
public function log($level, $message, array $context = [])
{
$level = Logger::toMonologLevel($level);
if ($level instanceof Level) {
$level = $level->value;
}

if ($this->isTriggered($level)) {
throw $this->getContextException($context) ?: new RuntimeException($message, $level);
Expand Down

0 comments on commit 426572a

Please sign in to comment.