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
FluLogObserver Twisted log observer that integrates with Flumotion's logging.
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.
  getCategoryLevel(category)
  getExceptionMessage(exception)
  getFailureMessage(failure)
  getLevelName(level)
Return the name of a log level.
  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.
  scrubFilename(filename)
Scrub the filename of everything before 'flumotion' and'twisted' to make them shorter.
  setFluDebug(string)
Set the FLU_DEBUG string.
  stderrHandler(level, object, category, file, line, message)
A log handler that writes to stdout.
  warning(cat, *args)
  warningFailure(failure)
  warningObject(object, cat, *args)
Log a warning message in the given category.

Variable Summary
int DEBUG = 4                                                                     
int ERROR = 1                                                                     
int INFO = 3                                                                     
int LOG = 5                                                                     
int WARN = 2                                                                     

Function Details

addLogHandler(func, limited=True)

Add a custom log handler.
Parameters:
func - a function object with prototype (level, object, category, message) where level is either ERROR, WARN, INFO, DEBUG, or LOG, and the rest of the arguments are strings or None. Use getLevelName(level) to get a printable name for the log level.
           (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.

getCategoryLevel(category)

Parameters:
category -

string

Get the debug level at which this category is being logged, adding it if it wasn't registered yet.

getLevelName(level)

Return the name of a log level.

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.

scrubFilename(filename)

Scrub the filename of everything before 'flumotion' and'twisted' to make them shorter.

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

DEBUG

Type:
int
Value:
4                                                                     

ERROR

Type:
int
Value:
1                                                                     

INFO

Type:
int
Value:
3                                                                     

LOG

Type:
int
Value:
5                                                                     

WARN

Type:
int
Value:
2                                                                     

Generated by Epydoc 2.1 on Tue Dec 20 15:33:10 2005 http://epydoc.sf.net