Browse Source

Merge "Fix incorrect auto-detection as timestamp log"

Zuul 1 year ago
parent
commit
749b15bfc5
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      oslogmerger/oslogmerger.py

+ 5
- 1
oslogmerger/oslogmerger.py View File

@@ -304,7 +304,8 @@ class TSLogParser(LogParser):
304 304
 
305 305
     @staticmethod
306 306
     def _read_timestamp(line):
307
-        start = line.index('[') + 1
307
+        # skip leading '['
308
+        start = 1
308 309
         end = line.index(']')
309 310
 
310 311
         if end < start:
@@ -347,6 +348,9 @@ class LogFile(object):
347 348
                     parser.parse_line(line)
348 349
 
349 350
                     # It worked!
351
+                    print('Detected %s as %s' %
352
+                          (filename, parser.__class__.__name__),
353
+                          file=sys.stderr)
350 354
                     return parser
351 355
                 except ValueError:
352 356
                     pass

Loading…
Cancel
Save