configure_logging#
- rapidtools.config.configure_logging(level: int | str = 20, stream: Any = None, fmt: str = '%(asctime)s- %(levelname)s: %(message)s', datefmt: str = '%Y-%m-%d %H:%M:%S') Logger[source]#
Attach a console handler to the
rapidtoolslogger.Importing the library never touches logging configuration (it only adds a
logging.NullHandler); scripts and notebooks call this once to see progress messages. Calling it again replaces the previous handler. Therapidtoolslogger stops propagating to the root logger so messages are printed once even when the application configured root logging too; skip this function if you would rather route rapidtools through your own handlers.- Parameters:
level – Logging level for the
rapidtoolslogger.stream – Output stream; defaults to
sys.stdout.fmt – Log record format.
datefmt – Timestamp format.
- Returns:
logging.Logger – The configured
rapidtoolslogger.
Example
>>> import rapidtools >>> rapidtools.configure_logging('INFO') <Logger rapidtools (INFO)>