Improve formatting of log messages in settings.py (#5636)

This commit is contained in:
Oliver 2023-09-30 23:20:55 +10:00 committed by GitHub
parent bc197a2906
commit 3cd7ee9cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -495,9 +495,9 @@ if 'sqlite' in db_engine:
db_name = str(Path(db_name).resolve())
db_config['NAME'] = db_name
logger.info("DB_ENGINE: ", db_engine)
logger.info("DB_NAME: ", db_name)
logger.info("DB_HOST: ", db_host)
logger.info("DB_ENGINE: %s", db_engine)
logger.info("DB_NAME: %s", db_name)
logger.info("DB_HOST: %s", db_host)
"""
In addition to base-level database configuration, we may wish to specify specific options to the database backend
@ -971,7 +971,7 @@ PLUGIN_FILE_CHECKED = False
SITE_URL = get_setting('INVENTREE_SITE_URL', 'site_url', None)
if SITE_URL:
logger.info("Site URL: ", SITE_URL)
logger.info("Site URL: %s", SITE_URL)
# Check that the site URL is valid
validator = URLValidator()
@ -1008,9 +1008,9 @@ FLAGS = {
CUSTOM_FLAGS = get_setting('INVENTREE_FLAGS', 'flags', None, typecast=dict)
if CUSTOM_FLAGS:
if not isinstance(CUSTOM_FLAGS, dict):
logger.error("Invalid custom flags, must be valid dict: ", CUSTOM_FLAGS)
logger.error("Invalid custom flags, must be valid dict: %s", str(CUSTOM_FLAGS))
else:
logger.info("Custom flags: ". CUSTOM_FLAGS)
logger.info("Custom flags: %s", str(CUSTOM_FLAGS))
FLAGS.update(CUSTOM_FLAGS)
# Magic login django-sesame

View File

@ -458,7 +458,7 @@ class PluginsRegistry:
t_start = time.time()
plg_i: InvenTreePlugin = plg()
dt = time.time() - t_start
logger.info('Loaded plugin `%s` in {%.3f}s', plg_name, dt)
logger.info('Loaded plugin `%s` in %.3fs', plg_name, dt)
except Exception as error:
handle_error(error, log_name='init') # log error and raise it -> disable plugin
logger.warning("Plugin `%s` could not be loaded", plg_name)