Skip to content

Commit

Permalink
misc: Add timestamps to all log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
spbnick committed Jan 24, 2024
1 parent 77224ef commit 21b7e06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kcidb/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def logging_setup(level):
"""
assert isinstance(level, int)
logging.getLogger().setLevel(level)
# Add timestamps to log messages
for handler in logging.getLogger().handlers:
handler.setFormatter(logging.Formatter(
'%(asctime)s:%(levelname)s:%(name)s:%(message)s'))
# TODO Consider separate arguments for controlling the below
logging.getLogger("urllib3").setLevel(LOGGING_LEVEL_MAP["NONE"])
logging.getLogger("google").setLevel(LOGGING_LEVEL_MAP["NONE"])
Expand Down

0 comments on commit 21b7e06

Please sign in to comment.