Skip to content

Commit

Permalink
fix logging yaml being in a different place for pyinstaller package
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanzessen committed Oct 11, 2023
1 parent 9737606 commit a720b52
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import yaml
import uvicorn
import multiprocessing
Expand All @@ -9,9 +10,10 @@

from router import router

with open('logging.yaml') as f:
config = yaml.load(f, Loader=yaml.FullLoader)
logging.config.dictConfig(config)
if os.path.exists("logging.yaml"):
with open('logging.yaml') as f:
config = yaml.load(f, Loader=yaml.FullLoader)
logging.config.dictConfig(config)

app = FastAPI()

Expand Down

0 comments on commit a720b52

Please sign in to comment.