From d209ff8eadf4b5c5f70c8a8808113d83441e3d07 Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Fri, 22 Mar 2024 18:14:01 -0400 Subject: [PATCH] fix: removes duplicated log messages Signed-off-by: Jennifer Power --- trestlebot/entrypoints/log.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trestlebot/entrypoints/log.py b/trestlebot/entrypoints/log.py index 178eee6c..e2995b24 100644 --- a/trestlebot/entrypoints/log.py +++ b/trestlebot/entrypoints/log.py @@ -33,13 +33,15 @@ def configure_logger(level: int = logging.INFO) -> None: # Create a StreamHandler to send non-error logs to stdout stdout_info_handler = logging.StreamHandler(sys.stdout) stdout_info_handler.setLevel(logging.INFO) + stdout_info_handler.addFilter(log.SpecificLevelFilter(logging.INFO)) stdout_debug_handler = logging.StreamHandler(sys.stdout) stdout_debug_handler.setLevel(logging.DEBUG) + stdout_debug_handler.addFilter(log.SpecificLevelFilter(logging.DEBUG)) # Create a StreamHandler to send error logs to stderr stderr_handler = logging.StreamHandler(sys.stderr) - stderr_handler.setLevel(logging.ERROR) + stderr_handler.setLevel(logging.WARNING) # Create a formatter and set it on both handlers detailed_formatter = logging.Formatter(