Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
timestamp back to syslog
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Apr 15, 2021
1 parent 6a4ea8f commit 3c13c37
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/uuid-syslog/src/syslog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,13 @@ bool SyslogService::can_transmit() {
}

bool SyslogService::transmit(const QueuedLogMessage & message) {
/*
// modifications by Proddy. From https://github.com/emsesp/EMS-ESP/issues/395#issuecomment-640053528
struct tm tm;

tm.tm_year = 0;
if (message.time_.tv_sec != (time_t)-1) {
gmtime_r(&message.time_.tv_sec, &tm);
}
*/

if (udp_.beginPacket(host_, port_) != 1) {
last_transmit_ = uuid::get_uptime_ms();
Expand All @@ -404,7 +402,6 @@ bool SyslogService::transmit(const QueuedLogMessage & message) {

udp_.printf_P(PSTR("<%u>1 "), ((unsigned int)message.content_->facility * 8) + std::min(7U, (unsigned int)message.content_->level));

/*
if (tm.tm_year != 0) {
udp_.printf_P(PSTR("%04u-%02u-%02uT%02u:%02u:%02u.%06luZ"),
tm.tm_year + 1900,
Expand All @@ -417,9 +414,7 @@ bool SyslogService::transmit(const QueuedLogMessage & message) {
} else {
udp_.print('-');
}
*/

udp_.print('-');
udp_.printf_P(PSTR(" %s - - - - \xEF\xBB\xBF"), hostname_.c_str());
udp_.print(uuid::log::format_timestamp_ms(message.content_->uptime_ms, 3).c_str());

Expand Down

0 comments on commit 3c13c37

Please sign in to comment.