Package flumotion :: Package common :: 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]
 
error(self, *args)
Log an error.
source code
 
warning(self, *args)
Log a warning.
source code
 
info(self, *args)
Log an informational message.
source code
 
debug(self, *args)
Log a debug message.
source code
 
log(self, *args)
Log a log 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
 
warningFailure(self, failure, swallow=True)
Log a warning about a Failure.
source code
 
logFunction(self, *args)
Overridable log function.
source code
 
logObjectName(self)
Overridable object name function.
source code
 
__providedBy__(...)
Object Specification Descriptor
source code
Class Variables [hide private]
  logCategory = 'default'
Implementors can provide a category to log their messages under.
  __implemented__ = <implementedBy flumotion.common.log.Loggable>
  __provides__ = <zope.interface.declarations.ClassProvides obje...
Method Details [hide private]

error(self, *args)

source code 

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

warning(self, *args)

source code 

Log a warning. Used for non-fatal problems.

info(self, *args)

source code 

Log an informational message. Used for normal operation.

debug(self, *args)

source code 

Log a debug message. Used for debugging.

log(self, *args)

source code 

Log a log message. Used for debugging recurring events.

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

warningFailure(self, failure, swallow=True)

source code 

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

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

logFunction(self, *args)

source code 

Overridable log function. Default just returns passed message.


Class Variable Details [hide private]

__provides__

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