Ajoute une journalisation détaillée (login, mail, présence, rappels)
Niveau configurable via LOG_LEVEL (défaut DEBUG). Les erreurs de config JSON invalide remontent maintenant un message clair (fichier + position) au lieu d'un JSONDecodeError brut.
This commit is contained in:
@ -51,7 +51,10 @@ def list_users() -> list[str]:
|
||||
def load_config() -> dict:
|
||||
CONFIG_FILE.parent.mkdir(parents=True, exist_ok=True)
|
||||
if CONFIG_FILE.exists():
|
||||
return json.loads(CONFIG_FILE.read_text())
|
||||
try:
|
||||
return json.loads(CONFIG_FILE.read_text())
|
||||
except json.JSONDecodeError as e:
|
||||
raise ValueError(f"{CONFIG_FILE} invalide : {e}") from e
|
||||
CONFIG_FILE.write_text(json.dumps(DEFAULT_CONFIG, indent=2))
|
||||
return DEFAULT_CONFIG.copy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user