Trees | Index | Help |
---|
Package flumotion :: Package common :: Module 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 SticheleClasses | |
---|---|
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 | |
---|---|
Add a custom log handler. | |
debug(cat,
format,
*args)
| |
Log a debug message in the given category. | |
Return dict of calculated variables, if they needed calculating. | |
Ellipsize the representation of the given object. | |
error(cat,
format,
*args)
| |
Log a fatal error message in the given category. | |
| |
Return a short message based on an exception, useful for debugging. | |
Return a short message based on twisted.python.failure.Failure . | |
tuple of (str, int) |
Return the filename and line number for the given location. |
Helper function to create a format and args to use for logging. | |
Return the name of a log level. | |
info(cat,
format,
*args)
| |
Log an informational message in the given category. | |
Initialize the logging system and parse the FLU_DEBUG environment variable. | |
log(cat,
format,
*args)
| |
Log a log message. | |
Integrate twisted's logger with Flumotion's logger. | |
Redirect stdout and stderr to named files. | |
Register a given category in the debug system. | |
Reopens the stdout and stderr output files, as set by flumotion.common.log.outputToFiles . | |
Resets the logging system, removing all log handlers. | |
Scrub the filename of everything before 'flumotion' and'twisted' to make them shorter. | |
Set the FLU_DEBUG string. | |
A log handler that writes to stderr. | |
warning(cat,
format,
*args)
| |
Log a warning about a Failure. | |
Log a warning message in the given category. | |
_canShortcutLogging(category,
level)
| |
_getTheFluLogObserver()
|
Function Details |
---|
addLogHandler(func, limited=True)Add a custom log handler.
|
debugObject(object, cat, format, *args)Log a debug message in the given category. |
doLog(level, object, category, format, args, where=-1, file=None, line=None)
|
ellipsize(o)Ellipsize the representation of the given object. |
errorObject(object, cat, format, *args)Log a fatal error message in the given category. This will also raise aflumotion.common.errors.SystemError .
|
getCategoryLevel(category)
|
getExceptionMessage(exception, frame=-1, filename=None)Return a short message based on an exception, useful for debugging. Tries to find where the exception was triggered. |
getFailureMessage(failure)Return a short message based ontwisted.python.failure.Failure . Tries to find where the
exception was triggered.
|
getFileLine(where=-1)Return the filename and line number for the given location. If where is a negative integer, look for the code entry in the current stack that is the given number of frames above this module. If where is a function, look for the code entry of the function.
|
getFormatArgs(startFormat, startArgs, endFormat, endArgs, args, kwargs)Helper function to create a format and args to use for logging. This avoids needlessly interpolating variables. |
getLevelName(level)Return the name of a log level. |
infoObject(object, cat, format, *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, format, *args)Log a log message. Used for debugging recurring events. |
logTwisted()Integrate twisted's logger with Flumotion's logger. This is done in a separate method because calling this imports and sets up a reactor. Since we want basic logging working before choosing a reactor, we need to separate these. |
outputToFiles(stdout, stderr)Redirect stdout and stderr to named files. Records the file names so that a future call to reopenOutputFiles() can open the same files. Installs a SIGHUP handler that will reopen the output files. Note that stderr is opened unbuffered, so if it shares a file with stdout then interleaved output may not appear in the order that you expect. |
registerCategory(category)Register a given category in the debug system. A level will be assigned to it based on the setting of FLU_DEBUG. |
reopenOutputFiles()Reopens the stdout and stderr output files, as set byflumotion.common.log.outputToFiles .
|
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 stderr.
|
warningFailure(failure, swallow=True)Log a warning about a Failure. Useful as an errback handler: d.addErrback(warningFailure)
|
warningObject(object, cat, format, *args)Log a warning message in the given category. This is used for non-fatal problems. |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Fri Feb 2 11:44:37 2007 | http://epydoc.sf.net |