# -*- coding: utf-8 -*-
# 新版日志打印类
# 作者: 陈磊
# 时间: 2019-10-30

import logging
import datetime
import os

from logging.handlers import RotatingFileHandler
from WorkBase import WorkBase


class UtilsLog:
    def __init__(self):
        self.logger = logging.getLogger(__name__)
        # 日志格式
        self.log_format = "%(asctime)s - %(levelname)s - %(message)s"
        self.log_datefmt = "%Y-%m-%d %H:%M:%S"
        logging.basicConfig(format=self.log_format, datefmt=self.log_datefmt, level=logging.DEBUG)

    def info(self, message):
        return self.logger.info(message)

    def debug(self, message):
        return self.logger.debug(message)

    def warning(self, message):
        return self.logger.warning(message)

    def error(self, message):
        return self.logger.error(message)
