Package flumotion :: Package common :: Module log
[show private | hide private]
[frames | no frames]

Module flumotion.common.log

Flumotion logging

Just like in GStreamer, five levels of log information are defined. These are, in order of decreasing verbosity: log, debug, info, warning, error.

API Stability: stabilizing

Maintainer: Thomas Vander Stichele
Classes
Loggable Base class for objects that want to be able to log messages with different level of severity.

Function Summary
  addLogHandler(func, limited)
Add a custom log handler.
  debug(cat, *args)
  debugObject(object, cat, *args)
Log a debug message in the given category.
  error(cat, *args)
  errorObject(object, cat, *args)
Log a fatal error message in the given category.
  getFileLine()
Return a tuple of (file, line) for the first stack entry outside of log.py
  info(cat, *args)
  infoObject(object, cat, *args)
Log an informational message in the given category.
  init()
Initialize the logging system and parse the FLU_DEBUG environment variable.
  log(cat, *args)
  logObject(object, cat, *args)
Log a log message.
  registerCategory(category)
Register a given category in the debug system.
  reset()
Resets the logging system, removing all log handlers.
  setFluDebug(string)
Set the FLU_DEBUG string.
  stderrHandler(level, object, category, file, line, message)
A log handler that writes to stdout.
  warning(cat, *args)
  warningObject(object, cat, *args)
Log a warning message in the given category.
  _handle(level, object, category, message)

Variable Summary
dict _categories = {}
str _FLU_DEBUG = '*:1'
dict _levels = {'WARN': 2, 'INFO': 3, 'DEBUG': 4, 'LOG': 5, '...
list _log_handlers = []
list _log_handlers_limited = []

Function Details

addLogHandler(func, limited=True)

Add a custom log handler.
Parameters:
func - a function object with prototype (level, object, category, message) where all of them are strings or None.
           (type=a callable function)
limited - whether to automatically filter based on FLU_DEBUG
           (type=boolean)

debugObject(object, cat, *args)

Log a debug message in the given category.

errorObject(object, cat, *args)

Log a fatal error message in the given category. This will also raise a flumotion.common.errors.SystemError.

getFileLine()

Return a tuple of (file, line) for the first stack entry outside of log.py

infoObject(object, cat, *args)

Log an informational message in the given category.

init()

Initialize the logging system and parse the FLU_DEBUG environment variable. Needs to be called before starting the actual application.

logObject(object, cat, *args)

Log a log message. Used for debugging recurring events.

registerCategory(category)

Register a given category in the debug system. A level will be assigned to it based on the setting of FLU_DEBUG.

reset()

Resets the logging system, removing all log handlers.

setFluDebug(string)

Set the FLU_DEBUG string. This controls the log output.

stderrHandler(level, object, category, file, line, message)

A log handler that writes to stdout.
Parameters:
level
           (type=string)
object
           (type=string (or None))
category
           (type=string)
message
           (type=string)

warningObject(object, cat, *args)

Log a warning message in the given category. This is used for non-fatal problems.

Variable Details

_categories

Type:
dict
Value:
{}                                                                     

_FLU_DEBUG

Type:
str
Value:
'*:1'                                                                  

_levels

Type:
dict
Value:
{'WARN': 2, 'INFO': 3, 'DEBUG': 4, 'LOG': 5, 'ERROR': 1}               

_log_handlers

Type:
list
Value:
[]                                                                     

_log_handlers_limited

Type:
list
Value:
[]                                                                     

Generated by Epydoc 2.1 on Wed Feb 16 07:23:00 2005 http://epydoc.sf.net