Update tools.py
修复使用cong.ini时报错的问题。需要指定ini 文件中logger_file 的 qualname字段为AutoMihoyoBBS
This commit is contained in:
parent
287a2265b9
commit
0202b5a7fe
5
tools.py
5
tools.py
@ -10,14 +10,15 @@ import setting
|
|||||||
|
|
||||||
#Log输出,这里提供了自定义logging输出的机会,只需要创建一个logging.ini并且写入配置文件即可自定义输出
|
#Log输出,这里提供了自定义logging输出的机会,只需要创建一个logging.ini并且写入配置文件即可自定义输出
|
||||||
if os.path.exists(f"{config.path}/logging.ini"):
|
if os.path.exists(f"{config.path}/logging.ini"):
|
||||||
|
import logging.config
|
||||||
logging.config.fileConfig(f"{config.path}/logging.ini")
|
logging.config.fileConfig(f"{config.path}/logging.ini")
|
||||||
|
log = logging.getLogger("AutoMihoyoBBS")
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.INFO,
|
||||||
format='%(asctime)s %(levelname)s %(message)s',
|
format='%(asctime)s %(levelname)s %(message)s',
|
||||||
datefmt='%Y-%m-%dT%H:%M:%S')
|
datefmt='%Y-%m-%dT%H:%M:%S')
|
||||||
|
log = logger = logging
|
||||||
log = logger = logging
|
|
||||||
|
|
||||||
#md5计算
|
#md5计算
|
||||||
def MD5(text:str) -> str:
|
def MD5(text:str) -> str:
|
||||||
|
Loading…
Reference in New Issue
Block a user