September 2026
1051 pages
35h 4m
English
The logging module provides a flexible interface for logging the program flow. The program sequence is logged by sending messages to the logging module at various points in the program. These messages can have different levels of urgency. For example, there are error messages, warnings, and debug information. The logging module can process these messages in many ways. It’s common to add a timestamp to the message and either output it to the screen or write it to a file.
In this section, the use of the logging module is shown on the basis of several examples in interactive mode. To be able to execute the sample programs correctly, the logging module must first be imported:
>>> import logging
Before messages can be ...
Read now
Unlock full access