pudl.logging_helpers#
Configure logging for the PUDL package.
Attributes#
Functions#
|
Helper function to append 'catalystcoop' to logger name and return logger. |
|
Configure the root catalystcoop logger. |
Module Contents#
- pudl.logging_helpers.get_logger(name: str)[source]#
Helper function to append ‘catalystcoop’ to logger name and return logger.
- pudl.logging_helpers.configure_root_logger(logfile: str | None = None, loglevel: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = 'INFO', dependency_loglevels: dict[str, int] | None = None, color_logs: bool = True, propagate: bool = False) None[source]#
Configure the root catalystcoop logger.
- Parameters:
logfile – Path to logfile or None.
loglevel – Level of detail at which to log. Defaults to
INFO.dependency_loglevels – Dictionary mapping dependency name to desired loglevel. This allows us to filter excessive logs from dependencies.
color_logs – Whether to emit ANSI color codes. Defaults to
True.propagate – Whether to propagate logs to ancestor loggers. Useful for ensuring that pytest has access to PUDL logs during testing.