pybitmessage.debug module

Logging and debuging facility


Detailed information, typically of interest only when diagnosing problems.
Confirmation that things are working as expected.
An indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘disk space low’). The software is still working as expected.
Due to a more serious problem, the software has not been able to perform some function.
A serious error, indicating that the program itself may be unable to continue running.

There are three loggers by default: console_only, file_only and both. You can configure logging in the logging.dat in the appdata dir. It’s format is described in the logging.config.fileConfig() doc.


>>> import logging
>>> logger = logging.getLogger('default')

The old form: from debug import logger is also may be used, but only in the top level modules.

Logging is thread-safe so you don’t have to worry about locks, just import and log.

log_uncaught_exceptions(ex_cls, ex, tb)[source]

The last resort logging function used for sys.excepthook


Configure logging, using either logging.dat file in the state.appdata dir or dictionary with hardcoded settings.


Reconfigure logging in runtime when state.appdata dir changed