mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-05 11:58:48 +08:00
提供自定义输出方式的机会
This commit is contained in:
parent
44aa5b9f4c
commit
c255d3e0da
@ -4,6 +4,7 @@ import main
|
||||
import time
|
||||
import tools
|
||||
import config
|
||||
import random
|
||||
import setting
|
||||
|
||||
#搜索配置文件
|
||||
@ -36,7 +37,7 @@ def main_multi():
|
||||
config.config_Path= f"{config.path}/{i}"
|
||||
main.main()
|
||||
tools.log.info(f"{i}执行完毕")
|
||||
time.sleep(2)
|
||||
time.sleep(random.randint(2, 6))
|
||||
|
||||
if __name__ == "__main__":
|
||||
main_multi()
|
||||
|
||||
14
tools.py
14
tools.py
@ -1,3 +1,4 @@
|
||||
import os
|
||||
import uuid
|
||||
import time
|
||||
import config
|
||||
@ -7,11 +8,14 @@ import logging
|
||||
import hashlib
|
||||
import setting
|
||||
|
||||
#Log输出
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s %(levelname)s %(message)s',
|
||||
datefmt='%Y-%m-%dT%H:%M:%S')
|
||||
#Log输出,这里提供了自定义logging输出的机会,只需要创建一个logging.ini并且写入配置文件即可自定义输出
|
||||
if (os.path.exists(f"{config.path}/logging.ini") == True):
|
||||
logging.config.fileConfig(f"{config.path}/logging.ini")
|
||||
else:
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s %(levelname)s %(message)s',
|
||||
datefmt='%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
log = logger = logging
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user