mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-04 00:06:18 +00:00
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:
@@ -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
|
Reference in New Issue
Block a user