diff --git a/docs/wamp/programming.rst b/docs/wamp/programming.rst index 70189be55..07dd7065b 100644 --- a/docs/wamp/programming.rst +++ b/docs/wamp/programming.rst @@ -647,7 +647,7 @@ Logging Internally, |Ab| uses `txaio `_ as an abstraction layer over Twisted and asyncio APIs. `txaio`_ also provides an abstracted logging API, which is what both |Ab| and Crossbar_ use. -There is a `txaio Programming Guide `_ which includes information on logging. If you are writing new code, you can choose the txaio_ APIs for maximum compatibility and runtime-efficiency (see below). If you prefer to write idiomatic logging code to "go with" the event-based frameword you've chosen, that's possible as well. For asyncio_ this is Python's built-in `logging `_ module; for Twisted it is the `post-15.2.0 logging API `_. The logging system in `txaio`_ is able to interoperate with the legacy Twisted logging API as well. +There is a `txaio Programming Guide `_ which includes information on logging. If you are writing new code, you can choose the txaio_ APIs for maximum compatibility and runtime-efficiency (see below). If you prefer to write idiomatic logging code to "go with" the event-based framework you've chosen, that's possible as well. For asyncio_ this is Python's built-in `logging `_ module; for Twisted it is the `post-15.2.0 logging API `_. The logging system in `txaio`_ is able to interoperate with the legacy Twisted logging API as well. The txaio_ API encourages a more structured approach while still achieving easily-rendered text logging messages. The basic idiom is to use new-style Python formatting strings and pass any "data" as kwargs. So a typical logging call might look like: ``self.log.info("Knob {frob.name} moved {degrees} right.", knob=an_obj, degrees=42)`` and if the "info" log level is not enabled, the string won't be "interpolated" (i.e. ``str()`` will not be invoked on any of the args, and a new string won't be produced). On top of that, logging observers may examine the ``kwargs`` and do things beyond "normal" logging. This is very much inspired by ``twisted.logger``; you can read the `Twisted logging documentation `_ for more insight.