Permalink
Browse files

Monitor entry in reader comments

  • Loading branch information...
kachayev committed Jul 31, 2011
1 parent ae4cb89 commit e2409db9850e5e9a0aa19f219b4f99f4f6ac70b5
Showing with 3 additions and 0 deletions.
  1. +3 −0 gearoscope/apps/monitor/reader.py
@@ -19,6 +19,8 @@ def tail(self, size, verbosity='info'):
return lines[:size]
class MonitorEntry(object):
+ '''One line from log representation'''
+
__slots__=('time', 'sender', 'level', 'code', 'message')
LEVELS = ['debug', 'info', 'error', 'critical']
@@ -32,6 +34,7 @@ def __init__(self, time, sender, level, message):
@staticmethod
def extract(line):
+ '''Will cat from left side of line Time, Sender and Level marks'''
parts = line.strip().split()
return MonitorEntry(' '.join(parts[:2]), parts[2], parts[3], ' '.join(parts[4:]))

0 comments on commit e2409db

Please sign in to comment.