Package flumotion :: Package extern :: Package log :: Module log :: Class Loggable
[hide private]

Class Loggable

source code

Known Subclasses:

Base class for objects that want to be able to log messages with different level of severity. The levels are, in order from least to most: log, debug, info, warning, error.

Instance Methods [hide private]
 
__providedBy__(...)
Object Specification Descriptor
source code
 
debug(self, *args)
Log a debug message.
source code
dict
doLog(self, level, where, format, *args, **kwargs)
Log a message at the given level, with the possibility of going higher up in the stack.
source code
 
error(self, *args)
Log an error.
source code
 
info(self, *args)
Log an informational message.
source code
 
log(self, *args)
Log a log message.
source code
 
logFunction(self, *args)
Overridable log function.
source code
 
logObjectName(self)
Overridable object name function.
source code
 
warning(self, *args)
Log a warning.
source code
 
warningFailure(self, failure, swallow=True)
Log a warning about a Twisted Failure.
source code
 
writeMarker(self, marker, level)
Sets a marker that written to the logs.
source code
Class Variables [hide private]
  __implemented__ = <implementedBy flumotion.extern.log.log.Logg...
  __provides__ = <zope.interface.declarations.ClassProvides obje...
  logCategory = 'default'
Implementors can provide a category to log their messages under.
Method Details [hide private]

debug(self, *args)

source code 

Log a debug message. Used for debugging.

doLog(self, level, where, format, *args, **kwargs)

source code 

Log a message at the given level, with the possibility of going higher up in the stack.

Parameters:
  • level (int) - log level
  • where (int (negative), or function) - how many frames to go back from the last log frame; or a function (to log for a future call)
  • kwargs - a dict of pre-calculated values from a previous doLog call
Returns: dict
a dict of calculated variables, to be reused in a call to doLog that should show the same location

error(self, *args)

source code 

Log an error. By default this will also raise an exception.

info(self, *args)

source code 

Log an informational message. Used for normal operation.

log(self, *args)

source code 

Log a log message. Used for debugging recurring events.

logFunction(self, *args)

source code 

Overridable log function. Default just returns passed message.

warning(self, *args)

source code 

Log a warning. Used for non-fatal problems.

warningFailure(self, failure, swallow=True)

source code 

Log a warning about a Twisted Failure. Useful as an errback handler: d.addErrback(self.warningFailure)

Parameters:
  • swallow (bool) - whether to swallow the failure or not

writeMarker(self, marker, level)

source code 

Sets a marker that written to the logs. Setting this marker to multiple elements at a time helps debugging.

Parameters:
  • marker (str) - A string write to the log.
  • level (int) - The log level. It can be log.WARN, log.INFO, log.DEBUG, log.ERROR or log.LOG.

Class Variable Details [hide private]

__implemented__

Value:
<implementedBy flumotion.extern.log.log.Loggable>

__provides__

Value:
<zope.interface.declarations.ClassProvides object at 0x8661e6c>