dev24, fix syslog timestamp #2704

This commit is contained in:
MichaelDvP
2025-11-02 17:43:13 +01:00
parent ea9783dbfc
commit f2dca2a90a
5 changed files with 8 additions and 7 deletions

View File

@@ -48,6 +48,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
- fix wwMaxPower on Junkers ZBS14 [#2609](https://github.com/emsesp/EMS-ESP32/issues/2609)
- ventilation bypass state from telegram 0x55C [#1197](https://github.com/emsesp/EMS-ESP32/issues/1197)
- set selflowtemp for ems+ boilers [#2641](https://github.com/emsesp/EMS-ESP32/discussions/2641)
- syslog timestamp [#2704](https://github.com/emsesp/EMS-ESP32/issues/2704)
## Changed

View File

@@ -17,6 +17,7 @@
*/
#include "uuid/syslog.h"
#include "../../src/core/emsesp.h"
#ifndef UUID_SYSLOG_HAVE_GETTIMEOFDAY
#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
@@ -230,8 +231,7 @@ SyslogService::QueuedLogMessage::QueuedLogMessage(unsigned long id, std::shared_
: id_(id)
, content_(std::move(content)) {
// Added for EMS-ESP
// if (time_good_ || emsesp::EMSESP::system_.network_connected()) {
if (time_good_) {
if (time_good_ || emsesp::EMSESP::system_.network_connected()) {
#if UUID_SYSLOG_HAVE_GETTIMEOFDAY
if (gettimeofday(&time_, nullptr) != 0) {
time_.tv_sec = (time_t)-1;
@@ -523,7 +523,7 @@ bool SyslogService::transmit(const QueuedLogMessage & message) {
// (unsigned long)message.time_.tv_usec);
// added for EMS-ESP
udp_.printf("%04u-%02u-%02uT%02u:%02u:%02u.%06lu%+02d:%02d",
udp_.printf("%04u-%02u-%02uT%02u:%02u:%02u.%06lu%+03d:%02d",
tm.tm_year + 1900,
tm.tm_mon + 1,
tm.tm_mday,
@@ -537,7 +537,7 @@ bool SyslogService::transmit(const QueuedLogMessage & message) {
udp_.print('-');
}
udp_.printf(" %s %s - - - ", hostname_.c_str(), message.content_->name);
udp_.printf(" %s %s - - - ", hostname_.c_str(), message.content_->name ? message.content_->name : "emsesp");
char id_c_str[15];
snprintf(id_c_str, sizeof(id_c_str), " %lu: ", message.id_);

View File

@@ -38,7 +38,7 @@
#endif
#ifndef EMSESP_STANDALONE
#include "ESP32React/ESP32React.h"
#include "../ESP32React/ESP32React.h"
#else
#include "../lib_standalone/ESP32React.h"
#endif

View File

@@ -25,7 +25,7 @@
// UART drivers
#if defined(ESP32)
#include "uart/emsuart_esp32.h"
#include "../uart/emsuart_esp32.h"
#elif defined(EMSESP_STANDALONE)
#include "emsuart_standalone.h"
#endif

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.3-dev.23"
#define EMSESP_APP_VERSION "3.7.3-dev.24"