Skip to content

Commit

Permalink
Use created logger for multiprocessing setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed May 1, 2024
1 parent 712ca06 commit 1040286
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions fancylog/fancylog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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():
Expand Down

0 comments on commit 1040286

Please sign in to comment.