Skip to content

Commit

Permalink
Update pydantic log model
Browse files Browse the repository at this point in the history
  • Loading branch information
fliiiix committed Feb 25, 2024
1 parent 7418bb0 commit 0986139
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions radiopi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ class LogConfig(BaseModel):
LOG_LEVEL: str = "DEBUG"

# Logging config
version = 1
disable_existing_loggers = False
formatters = {
version: int = 1
disable_existing_loggers: bool = False
formatters: dict = {
"default": {
"()": "uvicorn.logging.DefaultFormatter",
"fmt": LOG_FORMAT,
"datefmt": "%Y-%m-%d %H:%M:%S",
},
}
handlers = {
handlers: dict = {
"default": {
"formatter": "default",
"class": "logging.StreamHandler",
"stream": "ext://sys.stderr",
},
}
loggers = {
loggers: dict = {
LOGGER_NAME: {"handlers": ["default"], "level": LOG_LEVEL},
}
2 changes: 1 addition & 1 deletion radiopi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .config import LogConfig
from .player import PLAYER

dictConfig(LogConfig().dict())
dictConfig(LogConfig().model_dump())
logger = logging.getLogger("radiopi")


Expand Down

0 comments on commit 0986139

Please sign in to comment.