log_formatter = logging.Formatter('%(asctime)s - %(levelname)s :: %(message)s')
if txtlog:
    txt_handler = RotatingFileHandler(os.path.join(logdir, 'Stumbler.log'),
        backupCount=5)
txt_handler.doRollover()
txt_handler.setFormatter(log_formatter)
log.addHandler(txt_handler)
log.info('Logger initialised.')
if scrnlog:
    console_handler = logging.StreamHandler()
console_handler.setFormatter(log_formatter)
log.addHandler(console_handler)
setup_logging('/tmp/logs')
corelog = logging.getLogger('stumbler.core')
corelog.debug('Messages and rainbows...')
Ведение журнала Python по нескольким файлам