Skip to content
Snippets Groups Projects

Restructure log location

Merged Ashwin Kumar Karnad requested to merge restructure-log-location into main
Compare and Show latest version
1 file
+ 7
2
Compare changes
  • Side-by-side
  • Inline
@@ -270,7 +270,12 @@ def set_up_logging(loglevel="warning", filename=None):
shell_handler.setFormatter(shell_formatter)
# use the log_level_numeric to decide how much logging is sent to shell
shell_handler.setLevel(log_level_numeric)
logger.addHandler(shell_handler)
# Here we set the handlers of the RootLogger to be just the one we want.
# The reason is that the logging module will add a <StreamHandler <stderr>
# (NOTSET)> handler if logging.info/logging.debug/... is used before we
# come across this line. And we do not want that additional handler.
logger.handlers = [shell_handler]
# if filename provided, write log messages to that file, too.
if filename:
@@ -308,7 +313,7 @@ def set_up_logging(loglevel="warning", filename=None):
# short message
#
logging.debug(
f"Logging has been setup, loglevel={loglevel.upper()}"
f"Logging has been setup, loglevel={loglevel.upper()} "
+ f"{filename=} {rich_available=}"
)
Loading