]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move line counter so we only count lines towards the offset that are equal or above...
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 6 Jul 2012 21:29:45 +0000 (17:29 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Wed, 11 Jul 2012 23:38:56 +0000 (19:38 -0400)
lib/log/owncloud.php

index 42ae7867ff01d244eb49fbc9828ed839fe814cc0..9eb21832c55b6d710f90e2689ad6311b32b30619 100644 (file)
@@ -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 = '';
                                        }