Moved logging fileConfig after copying static files
All checks were successful
Amarillo/amarillo-gitea/amarillo-core/pipeline/head This commit looks good

This commit is contained in:
Csaba 2023-12-19 10:37:39 +01:00
parent 2a9c46996a
commit ee1dad1ff8
3 changed files with 6 additions and 3 deletions

View file

@ -6,8 +6,6 @@ import uvicorn
import mimetypes
from starlette.staticfiles import StaticFiles
logging.config.fileConfig('logging.conf', disable_existing_loggers=False)
logger = logging.getLogger("main")
from amarillo.app.utils.utils import copy_static_files
#this has to run before app.configuration is imported, otherwise we get validation error for config because the config file is not copied yet
@ -23,6 +21,9 @@ from amarillo.app.views import home
# https://pydantic-docs.helpmanual.io/usage/settings/
# from amarillo.app.views import home
logging.config.fileConfig('logging.conf', disable_existing_loggers=False)
logger = logging.getLogger("main")
logger.info("Hello Amarillo!")
app = FastAPI(title="Amarillo - The Carpooling Intermediary",

View file

@ -9,6 +9,8 @@ from datetime import datetime, date, timedelta
from pyproj import Geod
logger = logging.getLogger(__name__)
#logging.conf may not exist yet, so we need to configure the logger to show infos
logging.basicConfig(level=logging.INFO)
def assert_folder_exists(foldername):
if not os.path.isdir(foldername):

View file

@ -1,6 +1,6 @@
[project]
name = "amarillo-core"
version = "0.0.8"
version = "0.0.9"
dependencies = [
"fastapi[all]==0.104.0",
"geopandas==0.14",