From 78870e8b2cd9b5af669360a816279e8238ed0ed0 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Wed, 1 Nov 2023 11:40:40 +0100 Subject: [PATCH] always print warnings to stderr --- src/de/p1st/monitor/main.py | 2 +- src/de/p1st/monitor/warn.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/de/p1st/monitor/main.py b/src/de/p1st/monitor/main.py index e130577..d4836de 100755 --- a/src/de/p1st/monitor/main.py +++ b/src/de/p1st/monitor/main.py @@ -48,7 +48,7 @@ def log(): logger_read_exs = [] logger_warnings = 0 for logger_ct, logger in enumerate(loggers, start=1): - print(f'Running logger {logger_ct}/{len(loggers)} ...') + # print(f'Running logger {logger_ct}/{len(loggers)} ...') try: logger.update() except LoggerReadEx as e: diff --git a/src/de/p1st/monitor/warn.py b/src/de/p1st/monitor/warn.py index d46aab5..75a497f 100644 --- a/src/de/p1st/monitor/warn.py +++ b/src/de/p1st/monitor/warn.py @@ -76,6 +76,4 @@ class WarnMessage: def file(self) -> TextIO: if self.level == WarnLevel.NONE: raise ValueError() - if self.level >= WarnLevel.NORMAL: - return sys.stderr - return sys.stdout + return sys.stderr