From fbdff28d86b377444aee6b780bf534a6509f1d82 Mon Sep 17 00:00:00 2001 From: 13339479676 Date: Sat, 15 Jan 2022 16:05:25 +0800 Subject: [PATCH] log update 03 --- utils/log.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/utils/log.py b/utils/log.py index 5b8ece6..1fbbbbf 100644 --- a/utils/log.py +++ b/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() # 结束程序