t.p.l.L.msg(self, *message, **kw) : method documentation

Part of twisted.python.log.LogPublisher View Source

Log a new message.

The message should be a native string, i.e. bytes on Python 2 and Unicode on Python 3. For compatibility with both use the native string syntax, for example:

>>> log.msg('Hello, world.')

You MUST avoid passing in Unicode on Python 2, and the form:

>>> log.msg('Hello ', 'world.')

This form only works (sometimes) by accident.

Keyword arguments will be converted into items in the event dict that is passed to ILogObserver implementations. Each implementation, in turn, can define keys that are used by it specifically, in addition to common keys listed at ILogObserver.__call__.

For example, to set the system parameter while logging a message:

>>> log.msg('Started', system='Foo')
API Documentation for Twisted, generated by pydoctor at 2014-05-12 18:27:00.