logPrefix magic for LogSource, cleanup handleMessage
authorTero Marttila <terom@fixme.fi>
Fri, 05 Feb 2010 21:30:06 +0200
changeset 54 395182b7ea0f
parent 53 21ab25ffa1e8
child 55 5f720d719d01
logPrefix magic for LogSource, cleanup handleMessage
fixbot/logwatch/sources.py
--- a/fixbot/logwatch/sources.py	Fri Feb 05 21:16:19 2010 +0200
+++ b/fixbot/logwatch/sources.py	Fri Feb 05 21:30:06 2010 +0200
@@ -68,15 +68,14 @@
     
         else :
             # handle the structured message
-            self.handleMessage(msg)
+            log.callWithLogger(self, self.handleMessage, msg)
 
     def handleMessage (self, msg) :
         """
             Process the given SyslogMessage
         """
-
-        # XXX: filters should accept messages...
-        line = str(msg)
+        
+        # Log incoming lines
         log.msg(repr(msg))
 
         for filter in self.filters :
@@ -179,3 +178,6 @@
         # handle it as a line of data
         self.handleLine(data)
 
+    def logPrefix (self) :
+        return "LogSource(%s)" % (self.name, )
+