log update 03

This commit is contained in:
13339479676 2022-01-15 16:05:25 +08:00
parent 83a9442cbf
commit fbdff28d86
1 changed files with 2 additions and 12 deletions

View File

@ -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() # 结束程序