Lines Matching +full:debug +full:- +full:mode
3 .. _asyncio-dev:
16 .. _asyncio-debug-mode:
18 Debug Mode
21 By default asyncio runs in production mode. In order to ease
22 the development asyncio has a *debug mode*.
24 There are several ways to enable asyncio debug mode:
28 * Using the :option:`-X` ``dev`` Python command line option.
30 * Passing ``debug=True`` to :func:`asyncio.run`.
34 In addition to enabling the debug mode, consider also:
36 * setting the log level of the :ref:`asyncio logger <asyncio-logger>` to
37 :py:data:`logging.DEBUG`, for example the following snippet of code
40 logging.basicConfig(level=logging.DEBUG)
44 using the :option:`-W` ``default`` command line option.
47 When the debug mode is enabled:
50 <asyncio-coroutine-not-scheduled>` and logs them; this mitigates
53 * Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and
65 .. _asyncio-multithreading:
84 low-level asyncio API, the :meth:`loop.call_soon_threadsafe` method
111 .. _asyncio-handle-blocking:
116 Blocking (CPU-bound) code should not be called directly. For example,
117 if a function performs a CPU-intensive calculation for 1 second,
127 .. _asyncio-logger:
141 .. _asyncio-coroutine-not-scheduled:
143 Detect never-awaited coroutines
166 Output in debug mode::
171 asyncio.run(main(), debug=True)
186 Detect never-retrieved exceptions
217 :ref:`Enable the debug mode <asyncio-debug-mode>` to get the
220 asyncio.run(main(), debug=True)
222 Output in debug mode::
230 asyncio.run(main(), debug=True)