Permalink
Browse files

Fix error with empty lines reading in log file

  • Loading branch information...
1 parent 408b782 commit 7defa15a1ecb277784931d08da400f7492dbc86b @kachayev committed Jul 31, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 gearoscope/apps/monitor/reader.py
@@ -11,7 +11,7 @@ def tail(self, size, verbosity='info'):
It also can filter entiries by verbosity level (will return higher)
'''
with open(self.path) as log:
- lines = [MonitorEntry.extract(line) for line in log.readlines()[::-1]]
+ lines = [MonitorEntry.extract(line) for line in log.readlines()[::-1] if line.strip() != '']
limit = MonitorEntry.LEVELS.index(verbosity.lower())
lines = [entry for entry in lines if entry.code >= limit]

0 comments on commit 7defa15

Please sign in to comment.