pybitmessage.debug module

Logging and debuging facility

Levels:

DEBUG
Detailed information, typically of interest only when diagnosing problems.
INFO
Confirmation that things are working as expected.
WARNING
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.
ERROR
Due to a more serious problem, the software has not been able to perform some function.
CRITICAL
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.

Use:

>>> 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

configureLogging()[source]

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

resetLogging()[source]

Reconfigure logging in runtime when state.appdata dir changed