From c3b57970753cabcdebff7a2bad1f5b7ddd4f483d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=96=E9=A1=BA?= Date: Tue, 18 Jun 2024 10:21:06 +0800 Subject: [PATCH] close issue #256 --- handler/analyzer/analyze_log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/handler/analyzer/analyze_log.py b/handler/analyzer/analyze_log.py index 1bba61c4..3ec21ade 100644 --- a/handler/analyzer/analyze_log.py +++ b/handler/analyzer/analyze_log.py @@ -97,7 +97,8 @@ def init_option(self): now_time = datetime.datetime.now() self.to_time_str = (now_time + datetime.timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M:%S') self.from_time_str = (now_time - datetime.timedelta(seconds=TimeUtils.parse_time_length_to_sec(since_option))).strftime('%Y-%m-%d %H:%M:%S') - self.stdio.print('analyze log from_time: {0}, to_time: {1}'.format(self.from_time_str, self.to_time_str)) + if not self.directly_analyze_files: + self.stdio.print('analyze log from_time: {0}, to_time: {1}'.format(self.from_time_str, self.to_time_str)) else: self.stdio.print('No time option provided, default processing is based on the last 30 minutes') now_time = datetime.datetime.now() @@ -106,7 +107,8 @@ def init_option(self): self.from_time_str = (now_time - datetime.timedelta(seconds=TimeUtils.parse_time_length_to_sec(since_option))).strftime('%Y-%m-%d %H:%M:%S') else: self.from_time_str = (now_time - datetime.timedelta(minutes=30)).strftime('%Y-%m-%d %H:%M:%S') - self.stdio.print('analyze log from_time: {0}, to_time: {1}'.format(self.from_time_str, self.to_time_str)) + if not self.directly_analyze_files: + self.stdio.print('analyze log from_time: {0}, to_time: {1}'.format(self.from_time_str, self.to_time_str)) if store_dir_option is not None: if not os.path.exists(os.path.abspath(store_dir_option)): self.stdio.warn('Error: args --store_dir [{0}] incorrect: No such directory, Now create it'.format(os.path.abspath(store_dir_option)))