diff --git a/src/corelibs/logging_handling/log.py b/src/corelibs/logging_handling/log.py index 29d36a4..ed93852 100644 --- a/src/corelibs/logging_handling/log.py +++ b/src/corelibs/logging_handling/log.py @@ -42,8 +42,8 @@ class CustomConsoleFormatter(logging.Formatter): "INFO": Colors.green, "WARNING": Colors.yellow, "ERROR": Colors.red, - "CRITICAL": Colors.magenta, - "EXCEPTION": Colors.magenta_bold, + "CRITICAL": Colors.red_bold, + "EXCEPTION": Colors.magenta_bold, # will never be written to console } def format(self, record: logging.LogRecord) -> str: diff --git a/test-run/logging_handling/log.py b/test-run/logging_handling/log.py index caa0817..104920b 100644 --- a/test-run/logging_handling/log.py +++ b/test-run/logging_handling/log.py @@ -18,7 +18,7 @@ def main(): log_path=script_path.joinpath('log', 'test.log'), log_name="Test Log", log_settings={ - "log_level_console": 'WARNING', + "log_level_console": 'DEBUG', "log_level_file": 'DEBUG', # "console_color_output_enabled": False, } @@ -59,6 +59,13 @@ def main(): except ValueError as e: print(f"* ERROR: {e}") + try: + __test = 5 / 0 + print(f"Divied: {__test}") + except ZeroDivisionError as e: + log.logger.critical("Divison through zero: %s", e) + log.exception("Divison through zero") + if __name__ == "__main__": main()