diff -r 0f34cf81b9f1 -r 6b27d7010bd4 pvl/syslog/parser.py --- 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(?P(?P[^:\]]+)(?:\[(?P\d+)\])?: )?(?P.*))\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)