ID EN
Logging

debug

Python 3.11

Logs a message with level DEBUG on this logger. The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator. (Note that this means that you can use keywords in the format string, together with a single dictionary argument.) No % formatting operation is performed on msg when no args are supplied.

Syntax

PYTHON
debug(msg, *args, **kwargs)

Examples

Example 1
PYTHON
Stack (most recent call last):
Example 2
PYTHON
FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s'
logging.basicConfig(format=FORMAT)
d = {'clientip': '192.168.0.1', 'user': 'fbloggs'}
logger = logging.getLogger('tcpserver')
logger.warning('Protocol problem: %s', 'connection reset', extra=d)
Example 3
PYTHON
2006-02-08 22:20:02,165 192.168.0.1 fbloggs  Protocol problem: connection reset

See Also

DEBUG sys.exc_info() sys.exc_info() LogRecord warnings LogRecord LogRecord attributes Formatter