From 866e89eefa5a3a76829e77eaaab663f72b1287f6 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 19 Jan 2023 16:45:50 -0500 Subject: [PATCH] Minor changes --- app/db_sql.py | 5 +++-- app/main.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/db_sql.py b/app/db_sql.py index 41e0f21..ed2892a 100644 --- a/app/db_sql.py +++ b/app/db_sql.py @@ -32,7 +32,7 @@ except: @logger_reset def sql_connect( current_db, - log_lvl: int = logging.WARNING, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL + log_lvl: int = logging.DEBUG, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL ) -> None|bool|int: log.setLevel(log_lvl) log.debug(locals()) @@ -53,6 +53,7 @@ def sql_connect( if current_db: DB = settings.DB settings.SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name'] + log.debug(config.settings.DB) new_engine = create_engine(url=settings.SQLALCHEMY_DB_URI, pool_size=25, pool_recycle=60, pool_pre_ping=True, echo=False, echo_pool=True, isolation_level='READ COMMITTED', connect_args={'connect_timeout': 30}) @@ -60,7 +61,7 @@ def sql_connect( log.info(f'Created and connected to database: {settings.SQLALCHEMY_DB_URI}') return True else: - log.info(f'Could not created and or connect to database') + log.warning(f'Could not created and or connect to database') return False # current_db.engine.dispose() diff --git a/app/main.py b/app/main.py index cefa517..05906d8 100644 --- a/app/main.py +++ b/app/main.py @@ -42,7 +42,7 @@ app = FastAPI( ) -# log.setLevel(logging.DEBUG) +log.setLevel(logging.DEBUG) # log.debug(config.settings) if aether_cfg_sql_result := sql_select( @@ -62,6 +62,7 @@ if aether_cfg_sql_result := sql_select( DB = config.settings.DB config.settings.SQLALCHEMY_DB_URI = 'mysql://'+DB['username']+':'+DB['password']+'@'+DB['server']+'/'+DB['name'] # db_result = sql_connect(config.settings.SQLALCHEMY_DB_URI) + log.debug(config.settings.DB) config.settings.SMTP['server'] = aether_cfg_sql.get('smtp_server') config.settings.SMTP['port'] = aether_cfg_sql.get('smtp_port') @@ -77,7 +78,7 @@ else: # aether_cfg_sql_result pass # log.debug(aether_cfg_sql_result) -log.debug(config.settings) +# log.debug(config.settings) # @lru_cache() # def get_settings():