From cb7424c3de9961262a85c42416d9766741cf6749 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Wed, 2 Aug 2023 16:11:45 +0200 Subject: analyze-log: print errors to stderr --- bin/analyze-log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/analyze-log.py b/bin/analyze-log.py index 3de63c9..91197b9 100755 --- a/bin/analyze-log.py +++ b/bin/analyze-log.py @@ -14,6 +14,7 @@ from dfatool.model import AnalyticModel from dfatool.validation import CrossValidator from functools import reduce import json +import sys import re @@ -53,9 +54,10 @@ def parse_logfile(filename): ) except ValueError: print( - f"Error parsing {filename}: invalid key-value pair in line {lineno+1}" + f"Error parsing {filename}: invalid key-value pair in line {lineno+1}", + file=sys.stderr, ) - print(f"Offending entry:\n{line}") + print(f"Offending entry:\n{line}", file=sys.stderr) raise return observations -- cgit v1.2.3