aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-03 09:08:35 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2023-12-03 09:08:35 +0100
commitbaf3dc2691ea92ffb09ba107cb7abf2bb737122a (patch)
tree46dddb903af08ae70319b17f16f64c09551011bd
parent619bf5c008f57be5e6d5e88ce214052a10238c18 (diff)
bits of additional debugging of the configuration loading
-rw-r--r--kerbana/__init__.py11
1 files changed, 11 insertions, 0 deletions
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)