| 1 |
Debugging |
| 2 |
========= |
| 3 |
|
| 4 |
Python's default log level is ``logging.WARNING``. As a result most of the logs generated by this package are discarded. |
| 5 |
|
| 6 |
To see the log output of this package lower the log level to ``logging.DEBUG``. |
| 7 |
|
| 8 |
.. code-block:: python |
| 9 |
|
| 10 |
import logging |
| 11 |
logging.basicConfig(level=logging.DEBUG) |
| 12 |
|
| 13 |
However, this approach defines the log level for the complete logging system. |
| 14 |
In other words: the log level of all dependencies is set to ``logging.DEBUG``. |
| 15 |
|
| 16 |
To lower the logs for this package only use the following code: |
| 17 |
|
| 18 |
.. code-block:: python |
| 19 |
|
| 20 |
import logging |
| 21 |
logging.getLogger('ocpp').setLevel(level=logging.DEBUG) |
| 22 |
logging.getLogger('ocpp').addHandler(logging.StreamHandler()) |