MU_utils.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:MoegirlUpdater 作者: kafuuchino 项目源码 文件源码
def loggingInit(logname):
    isExists = os.path.exists('../log')
    if not isExists:
        os.mkdir('../log')
    LogExists = os.path.exists(logname)
    if not LogExists:
        f = open(logname, 'w')
        f.close()
    log = logging.getLogger(logname)
    log.setLevel(logging.DEBUG)
    logHandler = logging.handlers.RotatingFileHandler(logname,maxBytes=10*1024*1024,backupCount=5)
    logHandler.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
    logHandler.setFormatter(formatter)
    log.addHandler(logHandler)
    return log
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号