summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-04-11 11:46:36 +0200
committerRobin Appelman <robin@icewind.nl>2018-04-11 11:46:36 +0200
commit15815c034f8f3720208e492713c79df8b0bc6e46 (patch)
treec019a0972a0a52771a1d000c2db5e515cb9ae774 /lib/private
parentb9583c6dceae92bec87392bd9a4dc3fcdb208f4c (diff)
downloadnextcloud-server-15815c034f8f3720208e492713c79df8b0bc6e46.tar.gz
nextcloud-server-15815c034f8f3720208e492713c79df8b0bc6e46.zip
adjust tests to new exception log format
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Log.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 3f6458bbfab..2c2b7ccb08d 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -265,7 +265,7 @@ class Log implements ILogger {
$message = strtr($message, $replace);
if ($level >= $minLevel) {
- call_user_func([$this->logger, 'write'], $app, $message, $level);
+ $this->writeLog($app, $message, $level);
}
}
@@ -383,12 +383,10 @@ class Log implements ILogger {
array_walk($context, [$this->normalizer, 'format']);
if ($level >= $minLevel) {
- if ($this->logger === File::class) {
- call_user_func([$this->logger, 'write'], $app, $data, $level);
- } else {
- $entry = json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR);
- call_user_func([$this->logger, 'write'], $app, $entry, $level);
+ if ($this->logger !== File::class) {
+ $data = json_encode($data, JSON_PARTIAL_OUTPUT_ON_ERROR);
}
+ $this->writeLog($app, $data, $level);
}
$context['level'] = $level;
@@ -398,6 +396,15 @@ class Log implements ILogger {
}
/**
+ * @param string $app
+ * @param string|array $entry
+ * @param int $level
+ */
+ protected function writeLog(string $app, $entry, int $level) {
+ call_user_func([$this->logger, 'write'], $app, $entry, $level);
+ }
+
+ /**
* @param string $logType
* @return string
* @internal