From baf3dc2691ea92ffb09ba107cb7abf2bb737122a Mon Sep 17 00:00:00 2001 From: Elena ``of Valhalla'' Grandi Date: Sun, 3 Dec 2023 09:08:35 +0100 Subject: bits of additional debugging of the configuration loading --- kerbana/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kerbana/__init__.py b/kerbana/__init__.py index 7e30c2d..cef433f 100644 --- a/kerbana/__init__.py +++ b/kerbana/__init__.py @@ -20,6 +20,11 @@ def create_app(test_config: Optional[config.Config] = None): ) except FileNotFoundError: app.logger.debug("File /etc/kerbana/kerbana.toml not found.") + else: + app.logger.debug( + "Loaded configuration from /etc/kerbana/kerbana.toml" + ) + try: app.config.from_file( os.path.join( @@ -31,6 +36,9 @@ def create_app(test_config: Optional[config.Config] = None): ) except FileNotFoundError: app.logger.debug("File kerbana.toml not found.") + else: + app.logger.debug("Loaded configuration from kerbana.toml") + try: app.config.from_envvar("KERBANA_CONFIG") except RuntimeError as e: @@ -41,6 +49,9 @@ def create_app(test_config: Optional[config.Config] = None): os.environ["KERBANA_CONFIG"] ) ) + else: + app.logger.debug("Loaded configuration from $KERBANA_CONFIG") + app.config.from_prefixed_env(prefix="KERBANA_") else: app.config.from_object(test_config) -- cgit v1.2.3