Tutorial by Examples

This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the logging API provided by a standard library module is that all Python modules can participate in logging, so your application log can include your o...
If you want to log exceptions you can and should make use of the logging.exception(msg) method: >>> import logging >>> logging.basicConfig() >>> try: ... raise Exception('foo') ... except: ... logging.exception('bar') ... ERROR:root:bar Traceback (most rec...

Page 1 of 1