Skip to content

Commit

Permalink
Improve date format
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjohndyer committed Sep 5, 2022
1 parent e29f3c9 commit 62b35f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gtecs/common/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def get_file_handler(name, out_path=None):
log_file = f'{name}.log'
log_path = out_path / log_file

# formatter for stdout logging; does not include name of log
# formatter for file logging; does not include name of log (since it's the file name)
formatter = logging.Formatter(
'%(asctime)s:%(levelname)s - %(message)s',
datefmt='%Y/%m/%d %H:%M:%S'
'%(asctime)s.%(msecs)03d:%(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
formatter.converter = time.gmtime

Expand All @@ -35,7 +35,7 @@ def get_stream_handler():
# formatter for stdout logging; includes name of log
formatter = logging.Formatter(
'%(asctime)s.%(msecs)03d:%(name)s:%(levelname)s - %(message)s',
datefmt='%Y/%m/%d %H:%M:%S'
datefmt='%Y-%m-%d %H:%M:%S'
)
formatter.converter = time.gmtime

Expand Down

0 comments on commit 62b35f2

Please sign in to comment.