# loki.logging module

Loki’s logger classes and logging utilities.

set_log_level(level)

  Set the log level for the Loki logger.

FileLogger(name, filename, level=None, file_level=None, fmt=None, mode='a')

  Logger that emits to a single logfile, as well as stdout/stderr.

debug(msg, *args, **kwargs)

  Logger method for most verbose level of output

  Parameters:

    msg (str) – Message to log at `DEBUG` level.

detail(msg, *args, **kwargs)

  Logger method for detailed, per-file information.

  This level should be used for timing and detailed information at a per-file level, which can get verbose.

  Parameters:

    msg (str) – Message to log at `DETAIL` level.

perf(msg, *args, **kwargs)

  Logger method for performance information.

  This level should be used for timing individual processes at a global granularity during batch-processing.

  Parameters:

    msg (str) – Message to log at `DETAIL` level.

info(msg, *args, **kwargs)

  Logger method for high-level progress information.

  This is the default output logging and should only be used at a global granularity during batch-processing.

  Parameters:

    msg (str) – Message to log at `INFO` level.

warning(msg, *args, **kwargs)

  Logger method for high-level progress information.

  This level should be used for potentially dangerous, but not fatal information.

  Parameters:

    msg (str) – Message to log at `WARN` level.

error(msg, *args, **kwargs)

  Logger method for high-level progress information.

  This level should be used to provide additional information in case of failures.

  Parameters:

    msg (str) – Message to log at `ERROR` level.

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

  Wrapper of the main Python’s logging function. Print ‘msg % args’ with the severity ‘level’.

  Parameters:

    msg – the message to be printed.