Package foolscap :: Package logging :: Module log
[hide private]
[frames] | no frames]

Module log

source code

Classes [hide private]
  Count
A fixed version of itertools.count .
  FoolscapLogger
  TwistedLogBridge
  LogFileObserver
Functions [hide private]
 
format_message(e) source code
 
msg(*args, **kwargs)
Returns: the event number for this logevent, intended to be passed to parent= in a subsequent call to msg()
source code
 
err(_stuff=None, _why=None, **kw)
Write a failure to the log.
source code
 
setLogDir(directory) source code
 
explain_facility(facility, description) source code
 
set_buffer_size(level, sizelimit, facility=None) source code
 
set_generation_threshold(level, facility=None) source code
 
get_generation_threshold(facility=None) source code
 
bridgeLogsFromTwisted(tubID=None, twisted_logger=twisted_log.theLogPublisher, foolscap_logger=theLogger)
Called without arguments, this arranges for all twisted log messages to be bridged into the default foolscap logger.
source code
 
bridgeLogsToTwisted(filter=None, foolscap_logger=theLogger, twisted_logger=<module 'twisted.python.log' from '/usr/lib/python2.5/site-pac...) source code
Variables [hide private]
  _unused = [10, 20, 23, 25, 28, 30, 35, 40]
  theLogger = theLogger
  _flogfile = None
  _floglevel = int(os.environ.get("FLOGLEVEL", str(OPERATIONAL)))
  lfo = LogFileObserver(_flogfile, _floglevel)
Function Details [hide private]

msg(*args, **kwargs)

source code 
Parameters:
  • parent - the event number of the most direct parent of this event
  • facility - the slash-joined facility name, or None
  • level - the numeric severity level, like NOISY or SCARY
  • stacktrace - a string stacktrace, or True to generate one
Returns:
the event number for this logevent, intended to be passed to parent= in a subsequent call to msg()

bridgeLogsFromTwisted(tubID=None, twisted_logger=twisted_log.theLogPublisher, foolscap_logger=theLogger)

source code 

Called without arguments, this arranges for all twisted log messages to be bridged into the default foolscap logger.

I can also be called with a specific twisted and/or foolscap logger, mostly for unit tests that don't want to modify the default instances. For their benefit, I return the bridge.