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

Separate logger implementations for each hardware platform into different files (#6167)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
tomaszduda23
2024-03-04 22:52:52 +01:00
committed by GitHub
parent d5bfcd3bcf
commit de2d5a65b5
8 changed files with 398 additions and 336 deletions

View File

@@ -0,0 +1,22 @@
#if defined(USE_HOST)
#include "logger.h"
namespace esphome {
namespace logger {
void HOT Logger::write_msg_(const char *msg) {
time_t rawtime;
struct tm *timeinfo;
char buffer[80];
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer, sizeof buffer, "[%H:%M:%S]", timeinfo);
fputs(buffer, stdout);
puts(msg);
}
} // namespace logger
} // namespace esphome
#endif