Permalink
Browse files

Reader comments

  • Loading branch information...
1 parent c76e3ec commit 80f4fa12420f673431d87b6331c58e8d361bd079 @kachayev committed Jul 31, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 gearoscope/apps/monitor/reader.py
View
7 gearoscope/apps/monitor/reader.py
@@ -1,8 +1,15 @@
class Reader(object):
+ '''Read log file, created by sonar daemon'''
def __init__(self, path):
self.path = path
def tail(self, size, verbosity='info'):
+ '''
+ Return to client list of special Entry objects (one per each line in log)
+
+ Method will reverse lines order as unix util `tail` done
+ 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]]

0 comments on commit 80f4fa1

Please sign in to comment.