pvl/syslog/parser.py
changeset 101 6b27d7010bd4
parent 74 952ee07efd7a
--- a/pvl/syslog/parser.py	Sat Jan 12 21:42:03 2013 +0200
+++ b/pvl/syslog/parser.py	Sat Jan 12 21:48:33 2013 +0200
@@ -119,13 +119,14 @@
         +   r"(?P<message>(?P<tag>(?P<program>[^:\]]+)(?:\[(?P<pid>\d+)\])?: )?(?P<text>.*))\n?"
     )
 
-    def __init__ (self, raw=False, facility=None) :
+    def __init__ (self, raw=False, facility=None, severity=None) :
         """
-            Using given underlying line source.
+            Using given facility/severity as default.
         """
 
         self.raw = raw
         self.facility = facility
+        self.severity = severity
 
     def parse_pri (self, match) :
         """
@@ -134,7 +135,7 @@
 
         pri = match.group('pri')
         facility = match.group('facility') or self.facility
-        severity = match.group('severity')
+        severity = match.group('severity') or self.severity
         
         if pri and pri.isdigit() :
             pri = int(pri)