From c4797c709fe06c12c21b76dd925f664aed61ab9a Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Wed, 4 Jan 2023 00:09:51 +0100 Subject: [PATCH] logger: disable raising exceptions, e.g. when stdout is closed --- logger.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logger.py b/logger.py index 81b6ff2..af0b3f7 100644 --- a/logger.py +++ b/logger.py @@ -19,6 +19,8 @@ def setup_logging(verbose: bool, force_colors: Optional[bool] = None, log_setup: field_styles=field_colors, isatty=force_colors, ) + # don't raise Exceptions when e.g. output stream is closed + logging.raiseExceptions = False if log_setup: logging.debug('Logger: Logging set up.') if force_colors is not None: