From: Michael Gapczynski Date: Fri, 6 Jul 2012 21:29:45 +0000 (-0400) Subject: Move line counter so we only count lines towards the offset that are equal or above... X-Git-Tag: v4.5.0beta1~74^2~225^2~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f955e5e9b2ed03137f6c5a264a97500be9107bbe;p=nextcloud-server.git Move line counter so we only count lines towards the offset that are equal or above the log level --- diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php index 42ae7867ff0..9eb21832c55 100644 --- a/lib/log/owncloud.php +++ b/lib/log/owncloud.php @@ -80,12 +80,14 @@ class OC_Log_Owncloud { if ($pos == 0) { $line = $ch.$line; } - $lines++; $entry = json_decode($line); // Add the line as an entry if it is passed the offset and is equal or above the log level - if ($lines > $offset && $entry->level >= $minLevel) { - $entries[] = $entry; - $entriesCount++; + if ($entry->level >= $minLevel) { + $lines++; + if ($lines > $offset) { + $entries[] = $entry; + $entriesCount++; + } } $line = ''; }