log update 03
This commit is contained in:
parent
a4e44bf6be
commit
83a9442cbf
19
utils/log.py
19
utils/log.py
|
@ -5,14 +5,21 @@
|
|||
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'] # 日志后缀列表
|
||||
logSuffixFlag = 0 # 日志后缀标志
|
||||
for i in range(len(suffixList)):
|
||||
# 查找日志后缀
|
||||
if logName.endswith(suffixList[i]):
|
||||
logSuffixFlag = 1
|
||||
if logSuffixFlag == 0:
|
||||
log_suffix = logName.split('.')[-1]
|
||||
if log_suffix not in suffixList:
|
||||
print(f'日志格式不正确!程序结束!')
|
||||
sys.exit() # 结束程序
|
||||
|
||||
|
|
Loading…
Reference in New Issue