]> git.openstreetmap.org Git - nominatim.git/commitdiff
ignore badly formatted log lines
authorSarah Hoffmann <sarah.hoffmann@kernkonzept.com>
Tue, 16 Dec 2014 12:20:59 +0000 (13:20 +0100)
committerSarah Hoffmann <sarah.hoffmann@kernkonzept.com>
Tue, 16 Dec 2014 12:20:59 +0000 (13:20 +0100)
munin/nominatim_query_speed_querylog
munin/nominatim_requests_querylog
utils/cron_ipanalyse.py

index d663faf1a32d113d06d3e1aa7d22b01c8c9b35cc..4bbeac6896da6e724452976e37e2a92318fe72b1 100755 (executable)
@@ -128,9 +128,8 @@ class LogFile:
     def loglines(self):
         for l in self.fd:
             e = ENTRY_REGEX.match(l)
-            if e is None:
-                raise ValueError("Invalid log line:", l)
-            yield e.groupdict()
+            if e is not None:
+                yield e.groupdict()
 
 
 if __name__ == '__main__':
index 8538a95ccfb641c1be5315b81be076cd360490c7..aa41a4de82f15c187a941ce5e4507867a6170917 100755 (executable)
@@ -121,9 +121,8 @@ class LogFile:
     def loglines(self):
         for l in self.fd:
             e = ENTRY_REGEX.match(l)
-            if e is None:
-                raise ValueError("Invalid log line:", l)
-            yield e.groupdict()
+            if e is not None:
+                yield e.groupdict()
 
 
 if __name__ == '__main__':
index 262090a4710c362e44342b1c973fc9796be1e3b9..1858266734bc18d6f20cf91c70321596414909bb 100755 (executable)
@@ -186,7 +186,10 @@ class LogFile:
 
     def loglines(self):
         for l in self.fd:
-            yield LogEntry(l)
+            try:
+                yield LogEntry(l)
+            except ValueError:
+                pass # ignore invalid lines
 
 class BlockList: