Let syslog to be active when emulation is active too

solves issue https://github.com/arendst/Sonoff-Tasmota/issues/2109
This commit is contained in:
Adrian Scillato 2018-09-12 19:00:35 -03:00 committed by GitHub
parent 10f2e0abf2
commit 8025f28409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1004,7 +1004,7 @@ void MqttDataHandler(char* topic, byte* data, unsigned int data_len)
else if (CMND_SYSLOG == command_code) {
if ((payload >= LOG_LEVEL_NONE) && (payload <= LOG_LEVEL_ALL)) {
Settings.syslog_level = payload;
syslog_level = (Settings.flag2.emulation) ? 0 : payload;
syslog_level = payload;
syslog_timer = 0;
}
snprintf_P(mqtt_data, sizeof(mqtt_data), S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE, command, Settings.syslog_level, syslog_level);
@ -1596,7 +1596,7 @@ void PerformEverySecond()
if (syslog_timer) { // Restore syslog level
syslog_timer--;
if (!syslog_timer) {
syslog_level = (Settings.flag2.emulation) ? 0 : Settings.syslog_level;
syslog_level = Settings.syslog_level;
if (Settings.syslog_level) {
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_APPLICATION D_SYSLOG_LOGGING_REENABLED)); // Might trigger disable again (on purpose)
}
@ -2513,7 +2513,7 @@ void setup()
#ifndef USE_EMULATION
Settings.flag2.emulation = 0;
#endif // USE_EMULATION
syslog_level = (Settings.flag2.emulation) ? 0 : Settings.syslog_level;
syslog_level = Settings.syslog_level;
stop_flash_rotate = Settings.flag.stop_flash_rotate;
save_data_counter = Settings.save_data;
sleep = Settings.sleep;