From 255e0bab4a590c595f4b068c03515901c7c0d328 Mon Sep 17 00:00:00 2001 From: Thor77 Date: Fri, 4 Sep 2015 22:01:18 +0200 Subject: [PATCH] sort log-files before parsing --- tsstats.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tsstats.py b/tsstats.py index eded50b..8f5b3af 100755 --- a/tsstats.py +++ b/tsstats.py @@ -183,9 +183,10 @@ def parse_logs(log_path, ident_map={}, file_log=False): log.addHandler(stream_handler) # find all log-files and open them - log_files = [open(file_name) for file_name in glob.glob(log_path)] + file_paths = sorted([file_path for file_path in glob.glob(log_path)]) - for log_file in log_files: + for file_path in file_paths: + log_file = open(file_path) # process lines logging.debug('Started parsing of {}'.format(log_file.name)) for line in log_file: