Merge pull request #7305 from nextcloud/log-level-for-log-extending
Pass log level to log reporters
This commit is contained in:
commit
3e1860e3d6
|
@ -351,6 +351,7 @@ class Log implements ILogger {
|
||||||
$msg = isset($context['message']) ? $context['message'] : 'Exception';
|
$msg = isset($context['message']) ? $context['message'] : 'Exception';
|
||||||
$msg .= ': ' . json_encode($data);
|
$msg .= ': ' . json_encode($data);
|
||||||
$this->log($level, $msg, $context);
|
$this->log($level, $msg, $context);
|
||||||
|
$context['level'] = $level;
|
||||||
if (!is_null($this->crashReporters)) {
|
if (!is_null($this->crashReporters)) {
|
||||||
$this->crashReporters->delegateReport($exception, $context);
|
$this->crashReporters->delegateReport($exception, $context);
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ class LoggerTest extends TestCase {
|
||||||
$e = new \Exception('test');
|
$e = new \Exception('test');
|
||||||
$this->registry->expects($this->once())
|
$this->registry->expects($this->once())
|
||||||
->method('delegateReport')
|
->method('delegateReport')
|
||||||
->with($e, []);
|
->with($e, ['level' => 3]);
|
||||||
|
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class LoggerTest extends TestCase {
|
||||||
$e = new \Exception('test');
|
$e = new \Exception('test');
|
||||||
$this->registry->expects($this->once())
|
$this->registry->expects($this->once())
|
||||||
->method('delegateReport')
|
->method('delegateReport')
|
||||||
->with($e, []);
|
->with($e, ['level' => 3]);
|
||||||
|
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ class LoggerTest extends TestCase {
|
||||||
$e = new \Exception('test');
|
$e = new \Exception('test');
|
||||||
$this->registry->expects($this->once())
|
$this->registry->expects($this->once())
|
||||||
->method('delegateReport')
|
->method('delegateReport')
|
||||||
->with($e, []);
|
->with($e, ['level' => 3]);
|
||||||
|
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ class LoggerTest extends TestCase {
|
||||||
$e = new \Exception('test');
|
$e = new \Exception('test');
|
||||||
$this->registry->expects($this->once())
|
$this->registry->expects($this->once())
|
||||||
->method('delegateReport')
|
->method('delegateReport')
|
||||||
->with($e, []);
|
->with($e, ['level' => 3]);
|
||||||
|
|
||||||
$this->logger->logException($e);
|
$this->logger->logException($e);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue