From 9ad0dd05a5daaed39308e5c5fd87d46e142fd800 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Sun, 27 Jul 2025 13:00:06 +0200 Subject: [PATCH] Fix1 for default logging config --- __init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/__init__.py b/__init__.py index cbbf6e9..84c72fb 100644 --- a/__init__.py +++ b/__init__.py @@ -49,6 +49,8 @@ For more Information read the sphinx documentation.""" % __name__.replace('_', ' __INTERPRETER__ = (3, ) """The Tested Interpreter-Versions""" +JOURNAL_FMT = "%(levelname)8s - %(name)s - %(message)s" +""" A short journal formatter including the most important information""" SHORT_FMT = "%(asctime)s: %(levelname)8s - %(name)s - %(message)s" """ A short formatter including the most important information""" LONG_FMT = SHORT_FMT + "\n File \"%(pathname)s\", line %(lineno)d, in %(funcName)s" @@ -201,13 +203,13 @@ def add_handler_socket(logger: logging.Logger, level: int = logging.DEBUG, host: logger.addHandler(handler) return handler -def default_logging_config(): +def default_logging_config(fmt=JOURNAL_FMT): logger = logging.getLogger(ROOT_LOGGER_NAME) - add_handler_stdout(logger, config.LOG_LEVEL) + add_handler_stdout(logger, config.LOG_LEVEL, fmt=fmt) if config.DEBUG: add_handler_socket(logger, host=config.LOG_HOSTNAME) - return loggger + return logger def appLoggingConfigure(basepath, target, log_name_lvl=[], target_level=logging.DEBUG, fmt=SHORT_FMT, ring_logs=None, host=None, port=None):