Updating for adding offset

This commit is contained in:
Patrick McDonagh
2018-08-10 15:08:29 -05:00
parent e87e405580
commit 630f5960dc
15 changed files with 52 additions and 10 deletions

View File

@@ -0,0 +1,18 @@
"""Logging setup for pondlevel"""
import logging
from logging.handlers import RotatingFileHandler
import sys
log_formatter = logging.Formatter('%(asctime)s %(levelname)s %(funcName)s(%(lineno)d) %(message)s')
log_file = './pondlevel.log'
my_handler = RotatingFileHandler(log_file, mode='a', maxBytes=500*1024,
backupCount=2, encoding=None, delay=0)
my_handler.setFormatter(log_formatter)
my_handler.setLevel(logging.INFO)
filelogger = logging.getLogger('pondlevel')
filelogger.setLevel(logging.INFO)
filelogger.addHandler(my_handler)
console_out = logging.StreamHandler(sys.stdout)
console_out.setFormatter(log_formatter)
filelogger.addHandler(console_out)