Logging (mpdaf.log)

When imported, MPDAF initialize a logger by default. This logger uses the logging module, and log messages to stderr, for instance for the .info() methods.

It is possible to remove this logger with clear_loggers, and to use setup_logging to setup a logger with a different level or format. setup_logfile can also be used to setup a logger with a file.

Functions

mpdaf.log.clear_loggers(name='mpdaf')[source]

Remove all handlers for a given logger.

mpdaf.log.setup_logging(name='mpdaf', level=10, color=False, fmt='[%(levelname)s] %(message)s', stream=None)[source]

Setup logging to stdout.

mpdaf.log.setup_logfile(name='mpdaf', level=10, logfile='mpdaf.log', fmt='%(asctime)s [%(levelname)s] {%(name)s:%(lineno)d} %(message)s')[source]

Setup logging to file.