1
0
mirror of https://github.com/ijaric/voice_assistant.git synced 2025-05-24 22:43:26 +00:00

Архитектурные правки

This commit is contained in:
grucshetskyaleksei 2023-09-26 02:23:49 +03:00
parent 8e4c4cafdf
commit 52b1c6b365
9 changed files with 11 additions and 9 deletions

View File

@ -25,7 +25,7 @@ async def main():
except KeyboardInterrupt:
logger.info("Exited with keyboard interruption")
except Exception as e:
logger.exception("Unexpected error occurred")
logger.exception(f"Unexpected error occurred: {e}")
if __name__ == "__main__":

View File

@ -0,0 +1 @@
from .token import *

View File

@ -2,7 +2,7 @@ import fastapi
from jose import JWTError, jwt
from pydantic import ValidationError
import lib.api.v1.schemas as app_schemas
import lib.api.schemas as app_schemas
import lib.app.settings as app_settings
settings = app_settings.get_settings()

View File

@ -3,7 +3,7 @@ import logging.config as logging_config
import fastapi
import lib.api.v1.handlers as api_v1_handlers
import lib.api.v1.endpoints as api_v1_endpoints
from .logger import LOGGING
from .settings import get_settings
@ -43,8 +43,9 @@ class Application:
# Handlers
app.include_router(api_v1_endpoints.health.health_router, prefix="/api/v1/health", tags=["health"])
logger.info("Initializing handlers")
app.include_router(api_v1_handlers.health.health_router, prefix="/api/v1/health", tags=["health"])
logger.info("Initializing application finished")

View File

@ -30,7 +30,7 @@ LOGGING = {
"fmt": "%(levelprefix)s %(client_addr)s - '%(request_line)s' %(status_code)s",
},
},
"handlers": {
"endpoints": {
"console": {
"level": log_settings.log_level_handlers,
"class": "logging.StreamHandler",
@ -49,14 +49,14 @@ LOGGING = {
},
"loggers": {
"": {
"handlers": log_settings.log_default_handlers,
"endpoints": log_settings.log_default_handlers,
"level": log_settings.log_level_loggers,
},
"uvicorn.error": {
"level": log_settings.log_level_loggers,
},
"uvicorn.access": {
"handlers": ["access"],
"endpoints": ["access"],
"level": log_settings.log_level_loggers,
"propagate": False,
},
@ -64,6 +64,6 @@ LOGGING = {
"root": {
"level": log_settings.log_level_root,
"formatter": "verbose",
"handlers": log_settings.log_default_handlers,
"endpoints": log_settings.log_default_handlers,
},
}

View File

@ -63,7 +63,7 @@ class Application:
# Handlers
logger.info("Initializing handlers")
logger.info("Initializing endpoints")
liveness_probe_handler = health_handlers.LivenessProbeHandler()
logger.info("Creating application")