Logging and Testing Tips in Python

Date: 7/2/2022 · Tags: #python

Recent good readings in Python logging and testing:

Logging in Python like a PRO 🐍🌴

Credit to Monadical blog

LevelWhen it’s used
DEBUGDetailed information, typically of interest only when diagnosing problems.
INFOConfirmation that things are working as expected.
WARNINGAn 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.
ERRORDue to a more serious problem, the software has not been able to perform some function.
CRITICALA serious error, indicating that the program itself may be unable to continue running.

With primer tutorials from Python std library Logging HOWTO and Logging Cookbook, these are enough to get through to Python logging.

Testing: