Package kiwi :: Module log
[frames | no frames]

Module kiwi.log

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.
Classes
Logger  
ReversedGlobalFilter It's like a reversed filter, the default behavior is to not show the message, you need to add custom filters for all the records you wish to see

Exceptions
LogError  

Function Summary
  set_log_file(filename, mask)
  set_log_level(name, level)

Variable Summary
_Logger kiwi_log = <kiwi.log._Logger instance at 0x4027f44c>

Function Details

set_log_file(filename, mask=None)

Parameters:
filename -
mask - optional

set_log_level(name, level)

Parameters:
name - logging category
level - level

Variable Details

kiwi_log

Type:
_Logger
Value:
<kiwi.log._Logger instance at 0x4027f44c>                              

Generated by Epydoc 2.1 on Mon Jan 29 16:46:04 2007 http://epydoc.sf.net