Compare commits

...
Author SHA1 Message Date
Yaroslav Halchenko dcc35a0fab comments/notes on relevant places 2012-01-28 12:44:51 -05:00
2 changed files with 14 additions and 0 deletions
+9
View File
@@ -167,6 +167,15 @@ class DateDetector:
def getTime(self, line):
self.__lock.acquire()
try:
# TODO: collect all matches and choose the one most
# appropriate
# TODO (OPT): make it smarter and converging
# on 1 specific pattern for each jail/file
# so we don't need to cycle all over again and again
# wasting cpu cycles and possibly confusing multiple
# matching patterns (might need to be an option, if
# someone wants to monitor some file without strict
# date pattern -- are there such?)
for template in self.__templates:
try:
date = template.getDate(line)
+5
View File
@@ -61,7 +61,12 @@ class DateTemplate:
return self.__hits
def matchDate(self, line):
# TODO be more aggressive and match optional ms
dateMatch = self.__cRegex.search(line)
# XXX also now for each matching dateline it would be
# invoked twice since in filter.py:284 processLine
# it first matches time to discover its string location
# and then it processes it to obtain actual time
if not dateMatch == None:
self.__hits += 1
return dateMatch