I want to share my approach to logging in Python.
Logging is very important. This helps debug your apps avoiding headache. It can help you understand how the flow of a program works.
Please note, it can send email when an exceptions is raised.
A custom class inherits from logging.handlers.BufferingHandler in order to get mail sent, and overrides flush method to send mail via SMTP.
You cant spaming your own mail with debug trace, so you can set the levels on you want to inform via yaml configuration. Tip: Set the mail handler to error level, so you can get warn when app crashes.