The logging module records a program's events with severity levels (DEBUG, INFO, WARNING, ERROR, CRITICAL), a format and a destination (console, file). It replaces print for tracking a script's execution, especially a scheduled one, and diagnosing after the fact.
Example
logging.basicConfig(level=logging.INFO)
logging.info('File processed: %s', nom)