Skip to content

Commit

Permalink
Merge pull request #257 from Teingi/master
Browse files Browse the repository at this point in the history
fix issue #256
  • Loading branch information
wayyoungboy authored Jun 18, 2024
2 parents 2da5034 + c3b5797 commit 337f7ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handler/analyzer/analyze_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)))
Expand Down

0 comments on commit 337f7ad

Please sign in to comment.