Skip to content

Commit

Permalink
Fixed configure_stdout_logs missing loggers key (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza authored Nov 14, 2024
1 parent 4e82cb1 commit 55051f1
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions ldp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,25 @@ def configure_stdout_logs(
level: Log level to be emitted to stdout.
fmt: Optional format string.
"""
logging.config.dictConfig({
"version": 1,
"disable_existing_loggers": False,
"formatters": {"standard": {"format": fmt}},
"handlers": {
"stdout": {
"level": "INFO",
"formatter": "standard",
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
config: dict[str, Any] = {name: {"level": level, "handlers": ["stdout"]}}
if name != "root": # Non-root loggers need to be in a "loggers" key
config["loggers"] = config
logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
"formatters": {"standard": {"format": fmt}},
"handlers": {
"stdout": {
"level": "INFO",
"formatter": "standard",
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
},
},
},
name: {"level": level, "handlers": ["stdout"]}, # type: ignore[misc]
})
}
| config
)


def discounted_returns(
Expand Down

0 comments on commit 55051f1

Please sign in to comment.