Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cmantill committed Sep 29, 2024
1 parent e297e46 commit b67f361
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/HH4b/log_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
log_config = {
"version": 1,
"disable_existing_loggers": False, # this fixes the problem about many loggers
"formatters": {
"default": {"format": "[%(asctime)s] %(levelname)-2s: %(name)-20s %(message)s"},
},
"handlers": {
"default": {
"class": "logging.StreamHandler",
"level": "INFO",
"formatter": "default",
},
},
"root": {
"level": "INFO",
"handlers": ["default"],
},
}

0 comments on commit b67f361

Please sign in to comment.