From dcc35a0fab1941eaadf20bab59e55ca865cb59f3 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 28 Jan 2012 12:39:17 -0500 Subject: [PATCH] comments/notes on relevant places --- server/datedetector.py | 9 +++++++++ server/datetemplate.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/server/datedetector.py b/server/datedetector.py index 7301ec917..484995960 100644 --- a/server/datedetector.py +++ b/server/datedetector.py @@ -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) diff --git a/server/datetemplate.py b/server/datetemplate.py index f663862ec..45aa12886 100644 --- a/server/datetemplate.py +++ b/server/datetemplate.py @@ -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