diff --git a/scripts/eddn-report-log-errors b/scripts/eddn-report-log-errors index ffa1c83..1e555dc 100755 --- a/scripts/eddn-report-log-errors +++ b/scripts/eddn-report-log-errors @@ -3,6 +3,7 @@ """Produce a report on the provided EDDN Gateway log file's ERRORs.""" import argparse +import fileinput import re import semantic_version @@ -45,7 +46,7 @@ def process_file(input_file: str) -> None: r' from (?P.+)$' ) # TODO: Make this handle gzipped files - with open(input_file, 'r') as input: + with fileinput.FileInput(files=(input_file), mode='r') as input: line = input.readline() while line: line = line.strip() @@ -87,10 +88,22 @@ def process_file(input_file: str) -> None: 'https://eddn.edcd.io/schemas/shipyard/2', 'https://eddn.edcd.io/schemas/outfitting/2', ): - # Reported via Discord PM to Robby 2022-01-07 - if matches.group('err_msg') != 'Failed Validation "[]"': + # Failed Validation "[]" + if ( + matches.group('err_msg').startswith('Failed Validation "[]"') + ): + # + pass + + elif matches.group('err_msg') == 'Failed Validation "[]"': + # Reported via Discord PM to Robby 2022-01-07 + pass + + else: print(line) + else: print(line) @@ -129,6 +142,15 @@ def process_file(input_file: str) -> None: # pass + elif matches.group('schema_ref') == 'https://eddn.edcd.io/schemas/approachsettlement/1': + if matches.group('err_msg') == 'Failed Validation "[]"': + # + pass + + elif matches.group('err_msg') == 'Failed Validation "[]"': + # + pass + else: print(line)