diff --git a/gaugemqttcontinuous.py b/gaugemqttcontinuous.py index 97dc798..53c86ec 100644 --- a/gaugemqttcontinuous.py +++ b/gaugemqttcontinuous.py @@ -42,8 +42,11 @@ def log(level, msg): print(f"[{_ts()}] {level:5s} {msg}") +_DEBUG = False + + def info(msg): - if _cfg.get("debug", False): + if _DEBUG: log("INFO", msg) @@ -76,6 +79,10 @@ def _load_config(): _cfg = _load_config() +DEBUG = _cfg.get("debug", False) +global _DEBUG +_DEBUG = DEBUG + WIFI_SSID = _cfg["wifi_ssid"] WIFI_PASSWORD = _cfg["wifi_password"] MQTT_BROKER = _cfg["mqtt_broker"]