abtools.log: Logging

abtools.log.setup_logging(logfile, print_log_location=True, debug=False)

Set up logging using the built-in logging package.

A stream handler is added to all logs, so that logs at or above logging.INFO level are printed to screen as well as written to the log file.

Parameters:
  • logfile (str) – Path to the log file. If the parent directory does not exist, it will be created. Required.
  • print_log_location (bool) – If True, the log path will be written to the log upon initialization. Default is True.
  • debug (bool) – If true, the log level will be set to logging.DEBUG. If False, the log level will be set to logging.INFO. Default is False.
abtools.log.get_logger(name=None)

Get a logging handle.

As with setup_logging, a stream handler is added to the log handle.

Parameters:name (str) – Name of the log handle. Default is None.