abtools.log: Logging¶
-
abtools.log.setup_logging(logfile, print_log_location=True, debug=False)¶ Set up logging using the built-in
loggingpackage.A stream handler is added to all logs, so that logs at or above
logging.INFOlevel 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 isTrue. - debug (bool) – If true, the log level will be set to
logging.DEBUG. IfFalse, the log level will be set tologging.INFO. Default isFalse.
-
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.