Part of log View In Hierarchy
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 |
Parameters | loggerName | identifier used for getting logger.
(type: str
) |
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)
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.