Adjust date output format

This commit is contained in:
Joshua Boniface 2021-07-18 19:00:54 -04:00
parent 3a2478ee0c
commit 982dfd52c6
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ class Logger(object):
# Get the date # Get the date
if self.config['log_dates']: if self.config['log_dates']:
date = '{} - '.format(datetime.now().strftime('%Y/%m/%d %H:%M:%S.%f')) date = '{} '.format(datetime.now().strftime('%Y/%m/%d %H:%M:%S.%f'))
else: else:
date = '' date = ''
@ -177,7 +177,7 @@ class ZookeeperLogger(Thread):
logs = deque(self.zkhandler.read(('logs.messages', self.node)).split('\n'), self.max_lines) logs = deque(self.zkhandler.read(('logs.messages', self.node)).split('\n'), self.max_lines)
if not self.config['log_dates']: if not self.config['log_dates']:
# We want to log dates here, even if the log_dates config is not set # We want to log dates here, even if the log_dates config is not set
date = '{} - '.format(datetime.now().strftime('%Y/%m/%d %H:%M:%S.%f')) date = '{} '.format(datetime.now().strftime('%Y/%m/%d %H:%M:%S.%f'))
else: else:
date = '' date = ''
logs.append(f'{date}{message}') logs.append(f'{date}{message}')