1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

[syslog] Fix RFC3164 timestamp compliance for single-digit days (#10034)

Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
Copilot
2025-08-03 08:21:54 +10:00
committed by GitHub
parent 4f58e1c8b9
commit fd442cc485

View File

@@ -35,7 +35,7 @@ void Syslog::log_(const int level, const char *tag, const char *message, size_t
severity = LOG_LEVEL_TO_SYSLOG_SEVERITY[level]; severity = LOG_LEVEL_TO_SYSLOG_SEVERITY[level];
} }
int pri = this->facility_ * 8 + severity; int pri = this->facility_ * 8 + severity;
auto timestamp = this->time_->now().strftime("%b %d %H:%M:%S"); auto timestamp = this->time_->now().strftime("%b %e %H:%M:%S");
size_t len = message_len; size_t len = message_len;
// remove color formatting // remove color formatting
if (this->strip_ && message[0] == 0x1B && len > 11) { if (this->strip_ && message[0] == 0x1B && len > 11) {