Unverified Commit d5e29371 authored by Peter Stanko's avatar Peter Stanko
Browse files

Do not log debug info when it is not necessary

parent b3dac4d5
......@@ -47,8 +47,9 @@ def configure_app(app: Flask, env: str = None,
_load_portal_local(app, env, ignore_local)
app.config['PORTAL_ENV'] = config_type
log.debug("[INIT] Loaded config: ")
for (key, val) in app.config.items():
log.debug(f"[CONFIG] {key}={val}")
if app.config.get('PORTAL_LOG_CONFIG'):
for (key, val) in app.config.items():
log.debug(f"[CONFIG] {key}={val}")
return app
......
......@@ -36,6 +36,7 @@ class Config(object):
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI',
f"sqlite:///{paths.ROOT_DIR}/devel.db")
EMAIL_BACKEND = 'tests.utils.email_backend.EmailBackend'
PORTAL_LOG_CONFIG = False
class DevelopmentConfig(Config):
......@@ -57,6 +58,7 @@ class DevelopmentConfig(Config):
EMAIL_HOST = "localhost"
EMAIL_PORT = "1025"
EMAIL_DEFAULT_FROM = "kontr@example.com"
PORTAL_LOG_CONFIG = True
class ProductionConfig(Config):
......@@ -86,6 +88,7 @@ class TestConfig(Config):
CORS_ORIGINS = '*'
BROKER_URL = 'redis://'
CELERY_RESULT_BACKEND = BROKER_URL
PORTAL_LOG_CONFIG = False
# pylint: enable=too-few-public-methods
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment