import logging

from logging.handlers import TimedRotatingFileHandler

_logger = 0

# init(path) 初始化
def init(path):
    """
    Creates a rotating log
    """
    global _logger
    _logger = logging.getLogger("Rotating Log")
    _logger.setLevel(logging.INFO)
    
    # add a rotating handler
    handler = TimedRotatingFileHandler(path, when='d')
    _logger.addHandler(handler)

# info(str) 记录info日志
def info(str):
    _logger.info(str)
import logging

from logging.handlers import TimedRotatingFileHandler

_logger = 0

# init(path) 初始化
def init(path):
    """
    Creates a rotating log
    """
    global _logger
    _logger = logging.getLogger("Rotating Log")
    _logger.setLevel(logging.INFO)
    
    # add a rotating handler
    handler = TimedRotatingFileHandler(path, when='d')
    _logger.addHandler(handler)

# info(str) 记录info日志
def info(str):
    _logger.info(str)
# init(path) 初始化 Creates a rotating log # add a rotating handler # info(str) 记录info日志