Added DEBUG envvar
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-07-30 11:46:06 +02:00
parent aa2cc0214c
commit 3509698703
2 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,6 @@
import os
import sys
import logging
class Config:
@ -13,3 +15,9 @@ class Config:
RELEASE_ID = os.environ.get('RELEASE_ID', 'test')
RELEASEMODE = os.environ.get('RELEASEMODE', 'dev')
LOG_LEVEL = logging.DEBUG if (
'--debug' in sys.argv
) or (
os.environ.get('DEBUG', '0').lower() in ['yes', 'true', '1']
) else logging.INFO

View File

@ -37,7 +37,7 @@ def main():
logging.basicConfig(
stream=sys.stdout,
format="%(asctime)s - %(name)s [%(levelname)s]: %(message)s",
level=logging.DEBUG if '--debug' in sys.argv else logging.INFO
level=Config.LOG_LEVEL
)
if Config.SENTRY_DSN: