1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 00:31:58 +00:00
This commit is contained in:
J. Nick Koston
2026-01-30 01:11:31 -06:00
parent 31859a3eb5
commit cfea3472bd

View File

@@ -9,9 +9,9 @@ void HOT Logger::write_msg_(const char *msg, size_t len) {
char buffer[TIMESTAMP_LEN + 768];
time_t rawtime;
::time(&rawtime);
time(&rawtime);
struct tm timeinfo;
localtime_r(&rawtime, &timeinfo); // TZ env var set by time component
localtime_r(&rawtime, &timeinfo); // Thread-safe version
size_t pos = strftime(buffer, TIMESTAMP_LEN + 1, "[%H:%M:%S]", &timeinfo);
// Copy message (with newline already included by caller)