refac: make WGDashboard logging level configurable (#915)

* feat: init configurable logging level

* refac: correct some logging functions to debug from info. They were not that informational

* fix: logging somehow was broken due to disablement of external loggers

* refac: set default to info

---------

Co-authored-by: Daan Selen <dselen@systemec.nl>
This commit is contained in:
DaanSelen
2025-09-22 18:20:22 +02:00
committed by GitHub
parent b7e65f7caf
commit 8b541229d8
11 changed files with 55 additions and 30 deletions

View File

@@ -35,10 +35,13 @@ def ConnectionString(database_name: str) -> str:
host = parser.get("Database", "host")
cn = f"mysql+pymysql://{username}:{password}@{host}/{database_name}"
else:
cn = f"sqlite:///{os.path.join(SQLITE_PATH, f'{database_name}.db')}"
cn = f'sqlite:///{os.path.join(sqlitePath, f"{database}.db")}'
# Ensure database exists
if not database_exists(cn):
create_database(cn)
try:
if not database_exists(cn):
create_database(cn)
except Exception as e:
current_app.logger.critical("Database error. Terminating...", e)
exit(1)
return cn