Module k.log

Part of kiwi

Extension to the logging module

This module defines a couple of extensions to the logging module included in the python standard distribution.

It creates an additional logging handler that print log records on the standard output. This handler is only showing records which has a level set to logging.WARNING or higher by default. The messages printed by this handler can be modified by using the environment variable called KIWI_LOG.

The syntax for the string which KIWI_LOG points to is the following:

   domain ':' level [, domain ':', level]

domain can contain wildcards such as * and ? level is an integer 1-5 which defines the minimal level:

Examples:

   KIWI_LOG="stoq*:5"

will print all the messages in a domain starting with stoq with DEBUG or higher:

   KIWI_LOG="kiwi*:4,stoq.*:5"

will print all the messages with INFO or higher in all domains starting with kiwi, and all the messages in the stoq.* domains which are DEBUG or higher

Inspiration for the syntax is taken from the debugging facilities of the GStreamer multimedia framework.

ClassLogErrorUndocumented
ClassLoggerUndocumented
Class_LoggerUndocumented
ClassReversedGlobalFilter

It's like a reversed filter, the default behavior

Functionset_log_file

Set the filename used for logging.

Functionset_log_level

Set the log level.

Function_read_log_levelsUndocumented
Function_create_consoleUndocumented
def set_log_file(filename, mask=None):

Set the filename used for logging.

def set_log_level(name, level):

Set the log level.

def _read_log_levels(console_filter):
Undocumented
def _create_console():
Undocumented