Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kontr 2.0
Portal API Backend
Commits
d5e29371
Unverified
Commit
d5e29371
authored
Sep 16, 2018
by
Peter Stanko
Browse files
Do not log debug info when it is not necessary
parent
b3dac4d5
Changes
2
Hide whitespace changes
Inline
Side-by-side
portal/__init__.py
View file @
d5e29371
...
...
@@ -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
...
...
portal/config.py
View file @
d5e29371
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment