Class l.PythonLoggingObserver(object):

Part of log View In Hierarchy

Output twisted messages to Python standard library logging module.

WARNING: specific logging configurations (example: network) can lead to a blocking system. Nothing is done here to prevent that, so be sure to not use this: code within Twisted, such as twisted.web, assumes that logging does not block.

Method __init__
Method emit Receive a twisted log entry, format it and bridge it to python.
Method start Start observing log events.
Method stop Stop observing log events.
Method textFromEventDict Extract text from an event dict passed to a log observer. If it cannot
def __init__(self, loggerName='twisted'):
ParametersloggerNameidentifier used for getting logger. (type: str )
def emit(self, eventDict):

Receive a twisted log entry, format it and bridge it to python.

By default the logging level used is info; log.err produces error level, and you can customize the level by using the logLevel key:


>>> log.msg('debugging', logLevel=logging.DEBUG)
def start(self):
Start observing log events.
def stop(self):
Stop observing log events.
def textFromEventDict(self, eventDict):
Extract text from an event dict passed to a log observer. If it cannot
handle the dict, it returns None.

The possible keys of eventDict are:
- C{message}: by default, it holds the final text. It's required, but can
be empty if either C{isError} or C{format} is provided (the first
having the priority).
- C{isError}: boolean indicating the nature of the event.
- C{failure}: L{failure.Failure} instance, required if the event is an
error.
- C{why}: if defined, used as header of the traceback in case of errors.
- C{format}: string format used in place of C{message} to customize
the event. It uses all keys present in C{eventDict} to format
the text.
Other keys will be used when applying the C{format}, or ignored.
API Documentation for OtfBot, generated by pydoctor at 2010-01-14 18:51:57.