log update 03
This commit is contained in:
parent
83a9442cbf
commit
fbdff28d86
14
utils/log.py
14
utils/log.py
|
@ -5,20 +5,10 @@
|
|||
import sys
|
||||
|
||||
|
||||
# def is_logSuffix(logName):
|
||||
# suffixList = ['log', 'txt', 'data'] # 日志后缀列表
|
||||
# logSuffixFlag = 0 # 日志后缀标志
|
||||
# for i in range(len(suffixList)):
|
||||
# # 查找日志后缀
|
||||
# if logName.endswith(suffixList[i]):
|
||||
# logSuffixFlag = 1
|
||||
# if logSuffixFlag == 0:
|
||||
# print(f'日志格式不正确!程序结束!')
|
||||
# sys.exit() # 结束程序
|
||||
|
||||
# 检查日志格式
|
||||
def is_logSuffix(logName):
|
||||
suffixList = ['log', 'txt', 'data'] # 日志后缀列表
|
||||
log_suffix = logName.split('.')[-1]
|
||||
log_suffix = logName.split('.')[-1] # 获取日志后缀
|
||||
if log_suffix not in suffixList:
|
||||
print(f'日志格式不正确!程序结束!')
|
||||
sys.exit() # 结束程序
|
||||
|
|
Loading…
Reference in New Issue