I work in a large python module (Python 2.6.6) and log in thousands of places and I use the python logger module. Now I want to ignore the exception that is thrown during logging. One of the main possible scenarios is
import glob
import logging
import logging.handlers
LOG_FILENAME = '/home/abc/logging_rotatingfile_example.out'
my_logger = logging.getLogger('MyLogger')
my_logger.setLevel(logging.DEBUG)
handler = logging.handlers.RotatingFileHandler(
LOG_FILENAME, maxBytes=20, backupCount=5)
my_logger.addHandler(handler)
for i in range(20):
my_logger.debug('i = %d' % i)
, my_logger.debug('i = %d' % i) , - , .. .
, n . , - (- , ..).
, .
:
, , - python try-except, logger.
, , python, ?