Pass log level to log reporters

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-11-27 15:35:29 +01:00
parent cfae590ac9
commit 132764bff5
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
2 changed files with 5 additions and 4 deletions

View File

@ -351,6 +351,7 @@ class Log implements ILogger {
$msg = isset($context['message']) ? $context['message'] : 'Exception';
$msg .= ': ' . json_encode($data);
$this->log($level, $msg, $context);
$context['level'] = $level;
if (!is_null($this->crashReporters)) {
$this->crashReporters->delegateReport($exception, $context);
}

View File

@ -90,7 +90,7 @@ class LoggerTest extends TestCase {
$e = new \Exception('test');
$this->registry->expects($this->once())
->method('delegateReport')
->with($e, []);
->with($e, ['level' => 3]);
$this->logger->logException($e);
@ -109,7 +109,7 @@ class LoggerTest extends TestCase {
$e = new \Exception('test');
$this->registry->expects($this->once())
->method('delegateReport')
->with($e, []);
->with($e, ['level' => 3]);
$this->logger->logException($e);
@ -128,7 +128,7 @@ class LoggerTest extends TestCase {
$e = new \Exception('test');
$this->registry->expects($this->once())
->method('delegateReport')
->with($e, []);
->with($e, ['level' => 3]);
$this->logger->logException($e);
@ -147,7 +147,7 @@ class LoggerTest extends TestCase {
$e = new \Exception('test');
$this->registry->expects($this->once())
->method('delegateReport')
->with($e, []);
->with($e, ['level' => 3]);
$this->logger->logException($e);