Answer
Use logging module.
Levels: DEBUG, INFO, WARNING, ERROR, CRITICAL.
Supports logging to console, files, remote servers.
Preferred over print() in production.
Levels: DEBUG, INFO, WARNING, ERROR, CRITICAL.
Supports logging to console, files, remote servers.
Preferred over print() in production.