From aca9ddfc02413f6bad2ea64c2a1ede6616f6ea78 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Mon, 8 Jul 2024 00:02:43 +0200 Subject: [PATCH] Better logging --- secret_loader/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/secret_loader/__init__.py b/secret_loader/__init__.py index b4bbafc..de938d8 100644 --- a/secret_loader/__init__.py +++ b/secret_loader/__init__.py @@ -80,16 +80,16 @@ class SecretLoader: def load_or_fail(self, env_key: str) -> str: value = self._load_or_none(env_key) if value is None: - msg = f'Could not load secret {env_key}' + msg = f'Failed to load secret with key: {env_key}' raise Exception(msg) - logger.info('Loaded secret: %s', env_key) + logger.info('Loaded secret with key: %s', env_key) return value def load(self, env_key: str) -> str | None: value = self._load_or_none(env_key) if value is None: - logger.exception('Could not load secret %s', env_key) - logger.info('Loaded secret: %s', env_key) + logger.exception('Failed to load secret with key: %s', env_key) + logger.info('Loaded secret with key: %s', env_key) return value def _load_or_none(self, env_key: str) -> str | None: