From 0e2e0be347682ded1fd1373a5fb0392825802ce7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 22 Nov 2014 01:40:09 +0100 Subject: doc: debug mode --- doc/using.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/doc/using.rst b/doc/using.rst index f9833b8..5fcf043 100644 --- a/doc/using.rst +++ b/doc/using.rst @@ -79,6 +79,29 @@ Hello World:: `_. +Debug mode +---------- + +To enable the debug mode globally when using trollius, set the environment +variable ``TROLLIUSDEBUG`` to ``1``. To see debug traces, set the log level of +the trollius logger to ``logging.DEBUG``. The simplest configuration is:: + + import logging + # ... + logging.basicConfig(level=logging.DEBUG) + +If you use asyncio, use the ``PYTHONASYNCIODEBUG`` environment variable +instead of the ``TROLLIUSDEBUG`` variable. + +You can also call ``loop.set_debug(True)`` to enable the debug mode of the +event loop, but it enables less debug checks. + +.. seealso:: + Read the `Develop with asyncio + `_ section of the + asyncio documentation. + + API === -- cgit v1.2.1