Answer the question
In order to leave comments, you need to log in
Error when logging to the console after redefining the log. How to fix?
It logs twice, and before everything it displays an error:
Crashes to `port=os.getenv("ACCESS_POINT_PORT_IN"))`, but I use my logger in the `controllers.routers_api` module
import os
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from controllers.routers_api import router
if __name__ == "__main__":
uvicorn.run("main:app",
host="0.0.0.0",
port=os.getenv("ACCESS_POINT_PORT_IN"))
from log import get_logger
logger = get_logger(__name__)
@router.get("/")
async def check():
logger.info("Клиент подключился к серверу")
return "200"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question