sort log-files before parsing

This commit is contained in:
Thor77 2015-09-04 22:01:18 +02:00
parent 03f93dbcfc
commit 255e0bab4a
1 changed files with 3 additions and 2 deletions

View File

@ -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: