From eefc89cd42efa08730483b8c82ec75692231603c Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sun, 2 May 2021 02:26:55 +0100 Subject: [PATCH] Add logging bool --- helpers/logging_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/logging_manager.py b/helpers/logging_manager.py index 3b7034e..eea4243 100644 --- a/helpers/logging_manager.py +++ b/helpers/logging_manager.py @@ -11,7 +11,7 @@ class LoggingManager: logger: logging.Logger - def __init__(self, name: str): + def __init__(self, name: str, debug: bool = False): self.logger = logging.getLogger(name) logpath: str = resolve_external_file_path("/logs") @@ -34,7 +34,7 @@ class LoggingManager: print("Failed to create log file.") return - self.logger.setLevel(logging.INFO) + self.logger.setLevel(logging.DEBUG if debug else logging.INFO) fh = RotatingFileHandler( filename, maxBytes=LOG_MAX_SIZE_MB * (1024 ** 2),