Python 3: logging
Instead of using the basic print()
function, the more flexible logging module can be used to log the exception. The logging
module offers a lot extra functionality, for example, logging messages...
- into a given log file, or
- with timestamps and additional information about where the logging happened.
For more information check out the official documentation.