1
0
mirror of https://github.com/janLo/wallabag-kindle-consumer synced 2026-06-19 19:08:00 +00:00

More logging in config

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
2018-03-22 03:11:09 +01:00
parent a362bb2c29
commit 9f4415219f
+4 -1
View File
@@ -34,6 +34,8 @@ class Config:
@staticmethod @staticmethod
def from_file(filename): def from_file(filename):
logger.info("read config from file {file}", file=filename)
if not os.path.exists(filename): if not os.path.exists(filename):
logger.warn("Config file {filename} does not exist", filename=filename) logger.warn("Config file {filename} does not exist", filename=filename)
return None return None
@@ -65,6 +67,7 @@ class Config:
@staticmethod @staticmethod
def from_env(): def from_env():
logger.info("Read config from environment")
tmp = {} tmp = {}
missing = [] missing = []
for key in Config.known_values: for key in Config.known_values:
@@ -72,7 +75,7 @@ class Config:
tmp[key] = os.environ[key.upper()] tmp[key] = os.environ[key.upper()]
else: else:
if key in Config.required_values: if key in Config.required_values:
missing.append(key) missing.append(key.upper())
if 0 != len(missing): if 0 != len(missing):
logger.warn("Environment config does not contain configs for: {lst}", lst=", ".join(missing)) logger.warn("Environment config does not contain configs for: {lst}", lst=", ".join(missing))