mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-31 14:37:49 +00:00
Fix setting seriallog using web gui (old) regression
Fix setting seriallog using web gui (old) regression
This commit is contained in:
parent
8f3368271e
commit
7fdbd81def
@ -1193,9 +1193,7 @@ void MqttDataHandler(char* topic, uint8_t* data, unsigned int data_len)
|
|||||||
}
|
}
|
||||||
else if (CMND_SYSLOG == command_code) {
|
else if (CMND_SYSLOG == command_code) {
|
||||||
if ((payload >= LOG_LEVEL_NONE) && (payload <= LOG_LEVEL_ALL)) {
|
if ((payload >= LOG_LEVEL_NONE) && (payload <= LOG_LEVEL_ALL)) {
|
||||||
Settings.syslog_level = payload;
|
SetSyslog(payload);
|
||||||
syslog_level = payload;
|
|
||||||
syslog_timer = 0;
|
|
||||||
}
|
}
|
||||||
Response_P(S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE, command, Settings.syslog_level, syslog_level);
|
Response_P(S_JSON_COMMAND_NVALUE_ACTIVE_NVALUE, command, Settings.syslog_level, syslog_level);
|
||||||
}
|
}
|
||||||
|
@ -1455,6 +1455,13 @@ void SetSeriallog(uint8_t loglevel)
|
|||||||
seriallog_timer = 0;
|
seriallog_timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetSyslog(uint8_t loglevel)
|
||||||
|
{
|
||||||
|
Settings.syslog_level = loglevel;
|
||||||
|
syslog_level = loglevel;
|
||||||
|
syslog_timer = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_WEBSERVER
|
#ifdef USE_WEBSERVER
|
||||||
void GetLog(uint8_t idx, char** entry_pp, size_t* len_p)
|
void GetLog(uint8_t idx, char** entry_pp, size_t* len_p)
|
||||||
{
|
{
|
||||||
|
@ -1516,13 +1516,11 @@ void LoggingSaveSettings(void)
|
|||||||
char tmp[sizeof(Settings.syslog_host)]; // Max length is currently 33
|
char tmp[sizeof(Settings.syslog_host)]; // Max length is currently 33
|
||||||
|
|
||||||
WebGetArg("l0", tmp, sizeof(tmp));
|
WebGetArg("l0", tmp, sizeof(tmp));
|
||||||
Settings.seriallog_level = (!strlen(tmp)) ? SERIAL_LOG_LEVEL : atoi(tmp);
|
SetSeriallog((!strlen(tmp)) ? SERIAL_LOG_LEVEL : atoi(tmp));
|
||||||
WebGetArg("l1", tmp, sizeof(tmp));
|
WebGetArg("l1", tmp, sizeof(tmp));
|
||||||
Settings.weblog_level = (!strlen(tmp)) ? WEB_LOG_LEVEL : atoi(tmp);
|
Settings.weblog_level = (!strlen(tmp)) ? WEB_LOG_LEVEL : atoi(tmp);
|
||||||
WebGetArg("l2", tmp, sizeof(tmp));
|
WebGetArg("l2", tmp, sizeof(tmp));
|
||||||
Settings.syslog_level = (!strlen(tmp)) ? SYS_LOG_LEVEL : atoi(tmp);
|
SetSyslog((!strlen(tmp)) ? SYS_LOG_LEVEL : atoi(tmp));
|
||||||
syslog_level = Settings.syslog_level;
|
|
||||||
syslog_timer = 0;
|
|
||||||
WebGetArg("lh", tmp, sizeof(tmp));
|
WebGetArg("lh", tmp, sizeof(tmp));
|
||||||
strlcpy(Settings.syslog_host, (!strlen(tmp)) ? SYS_LOG_HOST : tmp, sizeof(Settings.syslog_host));
|
strlcpy(Settings.syslog_host, (!strlen(tmp)) ? SYS_LOG_HOST : tmp, sizeof(Settings.syslog_host));
|
||||||
WebGetArg("lp", tmp, sizeof(tmp));
|
WebGetArg("lp", tmp, sizeof(tmp));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user