Logging
Logging is a crucial aspect of any good script, especially one that gets run on a regular basis. Having a log to fall back on in the event of a failure of a script can mean the difference in figuring out in two minutes what went wrong or having to manually run the script again, hope that the error occurs again, and wait for the error to happen--not an ideal method of troubleshooting.
For Python scripts, the Python standard library ships with the logging module, which is typically sufficient for most logging tasks. Other logging libraries exist, and the daiquiri module (http://daiquiri.readthedocs.io/en/latest/) is a great library that enables simple logging configuration setup, handlers, and formatters. The daiquiri module makes it ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access