This commit is contained in:
parent
aa2cc0214c
commit
3509698703
@ -1,4 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
@ -13,3 +15,9 @@ class Config:
|
|||||||
|
|
||||||
RELEASE_ID = os.environ.get('RELEASE_ID', 'test')
|
RELEASE_ID = os.environ.get('RELEASE_ID', 'test')
|
||||||
RELEASEMODE = os.environ.get('RELEASEMODE', 'dev')
|
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
|
||||||
|
@ -37,7 +37,7 @@ def main():
|
|||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
stream=sys.stdout,
|
stream=sys.stdout,
|
||||||
format="%(asctime)s - %(name)s [%(levelname)s]: %(message)s",
|
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:
|
if Config.SENTRY_DSN:
|
||||||
|
Loading…
Reference in New Issue
Block a user