better log output

This commit is contained in:
Maximilian Keßler 2023-11-22 16:27:04 +01:00
parent 2ed40eae37
commit fa3148798c
Signed by: max
GPG key ID: BCC5A619923C0BA5
2 changed files with 4 additions and 1 deletions

View file

@ -12,7 +12,9 @@ class DBConnectionManager:
def connect(self):
config = read_db_config()
logger.debug("Establishing database connection.")
logger.debug("Establishing database connection with dbname={}, user={}, password={}".format(
config.db_name, config.db_user, config.db_pass
))
self._conn = psycopg2.connect("dbname='{}' user='{}' password='{}' host='localhost'".format(
config.db_name, config.db_user, config.db_pass
))

View file

@ -24,6 +24,7 @@ def subcommand_init(force: bool):
)
response = input("Do you wish to continue? [y/N] ")
if response not in ["y", "Y", "yes"]:
logger.info("Database initialization aborted.")
return
database.init_database()
logger.info("Successfully initialized database tables")