yaw.utils.get_logger#
- yaw.utils.get_logger(level: str = 'info', *, stdout: bool = True, file: str | None = None, pretty: bool = True, capture_warnings: bool = True) Logger[source]#
Create a new root level logger for yet_another_wizz.
Filter log messages according to the level verbosity and filter messages not related to yet_another_wizz. By default, records are written to stdout, but logs can be directed to a file instead (or both).
Note
The logger adds an exception hook to log uncaught exceptions.
- Parameters:
level – The lowest log level to emit (
error,warning,info, ordebug), defaults toinfo.- Keyword Arguments:
stdout – Whether to print colour coded log messages to the standard output (the default).
file – Optional file path to which standard log messages, including time stamp are written.
pretty – Whether to print color coded log messages (the default) to standard output or plain log messages with time stamps.
capture_warnings – Whether to capture warnings and emit them as log messages with level
warning.
- Returns:
The fully configured logger instance.