Change database log messages to loglevel DEBUG
This commit is contained in:
@@ -37,7 +37,7 @@ class Application:
|
|||||||
def init_database(self):
|
def init_database(self):
|
||||||
"""Initialize database connection."""
|
"""Initialize database connection."""
|
||||||
init_database(self.config)
|
init_database(self.config)
|
||||||
logging.info("Database initialized")
|
logging.debug("Database initialized")
|
||||||
|
|
||||||
def init_dns(self):
|
def init_dns(self):
|
||||||
"""Initialize DNS service."""
|
"""Initialize DNS service."""
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ def init_database(config: dict):
|
|||||||
if db_dir:
|
if db_dir:
|
||||||
os.makedirs(db_dir, exist_ok=True)
|
os.makedirs(db_dir, exist_ok=True)
|
||||||
db.init(db_path)
|
db.init(db_path)
|
||||||
logging.info(f"Database backend: SQLite path={db_path}")
|
logging.debug(f"Database backend: SQLite path={db_path}")
|
||||||
|
|
||||||
elif backend == "mariadb":
|
elif backend == "mariadb":
|
||||||
db = MySQLDatabase(
|
db = MySQLDatabase(
|
||||||
@@ -104,7 +104,7 @@ def init_database(config: dict):
|
|||||||
User._meta.database = db
|
User._meta.database = db
|
||||||
Hostname._meta.database = db
|
Hostname._meta.database = db
|
||||||
Version._meta.database = db
|
Version._meta.database = db
|
||||||
logging.info(f"Database backend: MariaDB db={config['database']['database']}")
|
logging.debug(f"Database backend: MariaDB db={config['database']['database']}")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown database backend: {backend}")
|
raise ValueError(f"Unknown database backend: {backend}")
|
||||||
@@ -117,7 +117,7 @@ def create_tables():
|
|||||||
db.create_tables([User, Hostname, Version])
|
db.create_tables([User, Hostname, Version])
|
||||||
if Version.select().count() == 0:
|
if Version.select().count() == 0:
|
||||||
Version.create(version=DATABASE_VERSION)
|
Version.create(version=DATABASE_VERSION)
|
||||||
logging.info("Database tables created")
|
logging.debug("Database tables created")
|
||||||
|
|
||||||
|
|
||||||
def get_user(username: str):
|
def get_user(username: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user