nessai.utils.logging

Utilities related to logging.

Module Contents

Functions

setup_logger([output, label, log_level, ...])

Setup the logger.

nessai.utils.logging.setup_logger(output=None, label='nessai', log_level='INFO', filehandler_kwargs=None, stream=None)

Setup the logger.

Based on the implementation in Bilby: https://git.ligo.org/lscsoft/bilby/-/blob/master/bilby/core/utils/log.py

Parameters:
outputstr, optional

Path of to output directory.

labelstr, optional

Label for this instance of the logger.

log_level{‘ERROR’, ‘WARNING’, ‘INFO’, ‘DEBUG’}, optional

Level of logging passed to logger.

filehandler_kwargsdict, optional

Keyword arguments for configuring the FileHandler. See logging documentation for details.

streamstr, file-object, optional

Stream passes to logging.StreamHandler to set the stream. See logging documentation for more details.

Returns:
logging.Logger

Instance of the Logger class.