logging
import logging
from logging import handlers
def logging_handler(flag, msgs):
rh = handlers.RotatingFileHandler('daxiao.log', maxBytes=126, backupCount=5, encoding='utf-8')
th = handlers.TimedRotatingFileHandler(filename='time.log', when='s', interval=5, encoding='utf-8')
fh = logging.FileHandler(filename="xxx.log", encoding="utf-8")
sh = logging.StreamHandler()
logging.basicConfig(format="%(asctime)s - %(name)s - [%(lineno)d] - %(levelname)s - %(module)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
handlers=[fh, sh, rh, th],
level=logging.DEBUG)
很多事情不是有希望才去坚持,而是坚持了才有希望!

浙公网安备 33010602011771号