From 10402865fa5d8d262c5b4f594e096ca1cf90e915 Mon Sep 17 00:00:00 2001 From: JoeZiminski Date: Wed, 1 May 2024 12:44:28 +0100 Subject: [PATCH] Use created logger for multiprocessing setup. --- fancylog/fancylog.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fancylog/fancylog.py b/fancylog/fancylog.py index f76420c..dc2a7aa 100644 --- a/fancylog/fancylog.py +++ b/fancylog/fancylog.py @@ -290,7 +290,7 @@ def setup_logging( :param logger_name: If None, logger uses default logger. Otherwise, logger name is set to `logger_name`. """ - initialise_logger( + logger = initialise_logger( filename, print_level=print_level, file_level=file_level, @@ -302,20 +302,20 @@ def setup_logging( import multiprocessing_logging multiprocessing_logging.install_mp_handler() - logging.info("Starting logging") - logging.info( + logger.info("Starting logging") + logger.info( "Multiprocessing-logging module found. Logging from all" " processes" ) except ModuleNotFoundError: - logging.info("Starting logging") - logging.info( + logger.info("Starting logging") + logger.info( "Multiprocessing-logging module not found, not logging " "multiple processes." ) else: - logging.info("Starting logging") - logging.info("Not logging multiple processes") + logger.info("Starting logging") + logger.info("Not logging multiple processes") def disable_logging():