[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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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];
}
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;
// remove color formatting
if (this->strip_ && message[0] == 0x1B && len > 11) {