t.p.l.LogPublisher : class documentation

Part of twisted.python.log View Source View In Hierarchy

Class for singleton log message publishing.
Method __init__ Undocumented
Method addObserver Add a new observer.
Method removeObserver Remove an observer.
Method msg Log a new message.
Method showwarning Twisted-enabled wrapper around warnings.showwarning.
def __init__(self): (source)
Undocumented
def addObserver(self, other): (source)
Add a new observer.
ParametersotherA callable object that will be called with each new log message (a dict). (type: Provider of ILogObserver )
def removeObserver(self, other): (source)
Remove an observer.
def msg(self, *message, **kw): (source)

Log a new message.

For example:

>>> log.msg('Hello, world.')
In particular, you MUST avoid the forms:

>>> log.msg(u'Hello, world.')
>>> log.msg('Hello ', 'world.')
These forms work (sometimes) by accident and will be disabled entirely in the future.
def showwarning(self, message, category, filename, lineno, file=None, line=None): (source)

Twisted-enabled wrapper around warnings.showwarning.

If file is None, the default behaviour is to emit the warning to the log system, otherwise the original warnings.showwarning Python function is called.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:27:37.