From ff7a911e4572d56846a51a23fcce0836b8593757 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Thu, 18 Mar 2021 09:27:46 +0100 Subject: [PATCH] Fix logging if network down (#11373) --- tasmota/support.ino | 2 +- tasmota/xdrv_02_mqtt.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 800c0a1ca..63ebc371e 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -2125,7 +2125,7 @@ void SyslogAsync(bool refresh) { static uint32_t syslog_host_hash = 0; // Syslog host name hash static uint32_t index = 1; - if (!TasmotaGlobal.syslog_level) { return; } + if (!TasmotaGlobal.syslog_level || TasmotaGlobal.global_state.network_down) { return; } if (refresh && !NeedLogRefresh(TasmotaGlobal.syslog_level, index)) { return; } char* line; diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index 02fe422f1..3ef1ec84b 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -311,7 +311,7 @@ void MqttUnsubscribe(const char *topic) { void MqttPublishLoggingAsync(bool refresh) { static uint32_t index = 1; - if (!Settings.mqttlog_level || !Settings.flag.mqtt_enabled) { return; } // SetOption3 - Enable MQTT + if (!Settings.mqttlog_level || !Settings.flag.mqtt_enabled || !Mqtt.connected) { return; } // SetOption3 - Enable MQTT if (refresh && !NeedLogRefresh(Settings.mqttlog_level, index)) { return; } char* line;