1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-03 09:20:29 +01:00
esphome/esphome/components/logger/logger_host.cpp
tomaszduda23 de2d5a65b5
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>
2024-03-05 10:52:52 +13:00

23 lines
398 B
C++

#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