日志3种方式

https://blog.csdn.net/somenzz/article/details/124464246



nb_log

https://www.cnblogs.com/ydf0509/p/16663158.html



loguru

https://blog.csdn.net/chenhaiy/article/details/122812398
简单用法
https://www.jianshu.com/p/5e3086ed5842
官方说明
https://loguru.readthedocs.io/en/stable/
自定义日志处理
https://blog.csdn.net/qq_29622543/article/details/115655275

pip install loguru

from loguru import logger


, "format": format_record

多进程锁定问题解决

https://blog.csdn.net/chenhepg/article/details/103664974

pip install concurrent-log-handler

from concurrent_log_handler import ConcurrentRotatingFileHandler
log = getLogger()
# Use an absolute path to prevent file rotation trouble.
logfile = os.path.abspath("mylogfile.log")
# Rotate log after reaching 512K, keep 5 old copies.
rotateHandler = ConcurrentRotatingFileHandler(logfile, "a", 512*1024, 5)
log.addHandler(rotateHandler)
log.setLevel(INFO)