Skip to content

Commit e32ec8a

Browse files
committed
Ignore mypy warnings since the object is of our own creation and not expected to be dynamic or be used in other places
1 parent 530fcd4 commit e32ec8a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/app/core/logger.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ def get_logging_config() -> dict[str, Any]:
9090
timestamp = datetime.now(UTC).strftime("%d-%b_%I-%M%p_UTC")
9191
log_file = log_dir / f"web_{timestamp}.log"
9292

93-
config["handlers"]["file"] = {
93+
config["handlers"]["file"] = { # type: ignore
9494
"class": "logging.handlers.RotatingFileHandler",
9595
"level": log_level,
9696
"filename": str(log_file),
9797
"maxBytes": 10485760, # 10MB
9898
"backupCount": 5,
9999
"formatter": "file",
100100
}
101-
config["root"]["handlers"].append("file")
102-
config["loggers"]["uvicorn.access"]["handlers"].append("file")
101+
config["root"]["handlers"].append("file") # type: ignore[index]
102+
config["loggers"]["uvicorn.access"]["handlers"].append("file") # type: ignore[index]
103103
if settings.LOG_FORMAT_AS_JSON:
104-
config["handlers"]["file"]["formatter"] = "json"
104+
config["handlers"]["file"]["formatter"] = "json" # type: ignore[index]
105105
else:
106-
config["handlers"]["file"]["formatter"] = "plain_text"
106+
config["handlers"]["file"]["formatter"] = "plain_text" # type: ignore[index]
107107

108108
if settings.LOG_FORMAT_AS_JSON:
109-
config["handlers"]["console"]["formatter"] = "json"
109+
config["handlers"]["console"]["formatter"] = "json" # type: ignore[index]
110110

111111
return config
112112

0 commit comments

Comments
 (0)