loguru


from loguru import logger

logger.add("1.log")
logger.debug("111111")
logger.info("2222222")
logger.warning("33333333")
logger.error("444444444")
logger.info('If you are using Python {}, prefer {feature} of course!', 3.6, feature='f-strings')

@logger.catch
def f(a,b):
    return a/b

f(0,0)

上一篇:弃繁就简,一行代码教你摆平Python 日志


下一篇:python-日志-loguru