Skip to content

Commit

Permalink
Merge ab6df7c into f093c49
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanlaak committed Feb 11, 2020
2 parents f093c49 + ab6df7c commit 4d926d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"league/uri": "^5.0",
"mf2/mf2": "^0.4",
"ml/json-ld": "^1.1",
"monolog/monolog": "^1.24",
"monolog/monolog": "^1.24 || ^2",
"psr/cache": "^1.0",
"psr/log": "^1.1",
"symfony/cache": "^4.0|^5.0"
Expand Down
5 changes: 3 additions & 2 deletions src/Micrometa/Infrastructure/Logger/ExceptionLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,18 @@ public function __construct($threshold = Logger::ERROR)
* @param string $message The log message
* @param array $context The log context
*
* @return Boolean Whether the record has been processed
* @throws \Exception Exception that occured
* @throws \RuntimeException Log message as exception
*/
public function addRecord($level, $message, array $context = [])
{
$processed = parent::addRecord($level, $message, $context);

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

return parent::addRecord($level, $message, $context);
return $processed;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* @package Jkphl\Micrometa
* @subpackage Jkphl\Micrometa\Tests
*/
class LoggerTest extends AbstractTestBase
class ExceptionLoggerTest extends AbstractTestBase
{
/**
* Test the exception logger
Expand Down

0 comments on commit 4d926d9

Please sign in to comment.