IgnisLogger

class IgnisLogger(name, level=0)[source]

A logger class for Ignis

IgnisLogger is a like any other logging.Logger object except it has an additional method, log_to_file(), used to log data in the form of key:value pairs to a log file. Logging configuration is performed via a configuration file and is handled by IgnisLogging.

Refer to Python’s logging documentation for more details on how to use logging in Python

Initialize the IgnisLogger object

Parameters
  • name (str) – name of the logger. Usually set to package name using __name__

  • level (logging.NOTSET) – Verbosity level (use logging package enums)

Attributes

IgnisLogger.manager

IgnisLogger.root

Methods

IgnisLogger.addFilter(filter)

Add the specified filter to this handler.

IgnisLogger.addHandler(hdlr)

Add the specified handler to this logger.

IgnisLogger.callHandlers(record)

Pass a record to all relevant handlers.

IgnisLogger.configure(sh, conf_file_exists)

Internal configuration method of IgnisLogger.

IgnisLogger.critical(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘CRITICAL’.

IgnisLogger.debug(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘DEBUG’.

IgnisLogger.disable_file_logging()

Disable file logging for this logger object (note there is a single object for a given logger name

IgnisLogger.enable_file_logging()

Enable file logging for this logger object (note there is a single object for a given logger name

IgnisLogger.error(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘ERROR’.

IgnisLogger.exception(msg, *args[, exc_info])

Convenience method for logging an ERROR with exception information.

IgnisLogger.fatal(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘CRITICAL’.

IgnisLogger.filter(record)

Determine if a record is loggable by consulting all the filters.

IgnisLogger.findCaller([stack_info])

Find the stack frame of the caller so that we can note the source file name, line number and function name.

IgnisLogger.getChild(suffix)

Get a logger which is a descendant to this one.

IgnisLogger.getEffectiveLevel()

Get the effective level for this logger.

IgnisLogger.handle(record)

Call the handlers for the specified record.

IgnisLogger.hasHandlers()

See if this logger has any handlers configured.

IgnisLogger.info(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘INFO’.

IgnisLogger.isEnabledFor(level)

Is this logger enabled for level ‘level’?

IgnisLogger.log(level, msg, *args, **kwargs)

Log ‘msg % args’ with the integer severity ‘level’.

IgnisLogger.log_to_file(**kwargs)

Log key:value pairs to a log file.

IgnisLogger.makeRecord(name, level, fn, lno, …)

A factory method which can be overridden in subclasses to create specialized LogRecords.

IgnisLogger.removeFilter(filter)

Remove the specified filter from this handler.

IgnisLogger.removeHandler(hdlr)

Remove the specified handler from this logger.

IgnisLogger.setLevel(level)

Set the logging level of this logger.

IgnisLogger.warn(msg, *args, **kwargs)

IgnisLogger.warning(msg, *args, **kwargs)

Log ‘msg % args’ with severity ‘WARNING’.