Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/logreader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2018-11-27 13:35:03 +0300
committerRobin Appelman <robin@icewind.nl>2018-11-27 16:12:34 +0300
commita21cdfb90756c6ff3bc57558e93106f71ec8ce58 (patch)
treea91729222c4c759f6a3a59bb97bb6e04c2bdf38b
parent08ea28a55a69eed70992c73813d95f6df858ec7d (diff)
fix searching in exceptions
Fixes #78 Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/Log/SearchFilter.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Log/SearchFilter.php b/lib/Log/SearchFilter.php
index 747f71f..6493339 100644
--- a/lib/Log/SearchFilter.php
+++ b/lib/Log/SearchFilter.php
@@ -52,11 +52,20 @@ class SearchFilter extends \FilterIterator {
return true;
}
$value = $this->current();
- return stripos($value['message'], $this->query) !== false
+ return $this->inMessage($value['message'], $this->query)
|| stripos($value['app'], $this->query) !== false
|| stripos($value['reqId'], $this->query) !== false
|| stripos($value['user'], $this->query) !== false
|| stripos($value['url'], $this->query) !== false
|| stripos($this->formatLevel($value['level']), $this->query) !== false;
}
+
+ private function inMessage($message, $query) {
+ if (is_string($message)) {
+ return stripos($message, $query) !== false;
+ } else if (isset($message['Exception'])) {
+ return stripos($message['Exception'], $query) !== false
+ || stripos($message['Message'], $query) !== false;
+ }
+ }
}