From 28b913136dc185dc63114fd20a40b364f83f5403 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 9 May 2020 20:53:47 +0200 Subject: [PATCH] root: set log level based on DEBUG flag --- passbook/root/settings.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/passbook/root/settings.py b/passbook/root/settings.py index 9e8c910e9..d7edbfb05 100644 --- a/passbook/root/settings.py +++ b/passbook/root/settings.py @@ -96,6 +96,7 @@ INSTALLED_APPS = [ "passbook.providers.oidc.apps.PassbookProviderOIDCConfig", "passbook.providers.saml.apps.PassbookProviderSAMLConfig", "passbook.providers.samlv2.apps.PassbookProviderSAMLv2Config", + "passbook.stages.identification.apps.PassbookStageIdentificationConfig", "passbook.stages.otp.apps.PassbookStageOTPConfig", "passbook.stages.captcha.apps.PassbookStageCaptchaConfig", "passbook.stages.password.apps.PassbookStagePasswordConfig", @@ -327,17 +328,19 @@ LOGGING = { }, "loggers": {}, } +LOG_LEVEL = "DEBUG" if DEBUG else "WARNING" _LOGGING_HANDLER_MAP = { - "": "DEBUG", - "passbook": "DEBUG", + "": LOG_LEVEL, + "passbook": LOG_LEVEL, "django": "WARNING", "celery": "WARNING", - "grpc": "DEBUG", - "oauthlib": "DEBUG", - "oauth2_provider": "DEBUG", - "oidc_provider": "DEBUG", + "grpc": LOG_LEVEL, + "oauthlib": LOG_LEVEL, + "oauth2_provider": LOG_LEVEL, + "oidc_provider": LOG_LEVEL, } for handler_name, level in _LOGGING_HANDLER_MAP.items(): + # pyright: reportGeneralTypeIssues=false LOGGING["loggers"][handler_name] = { "handlers": ["console"], "level": level,