ESPHome  2024.10.2
logger_host.cpp
Go to the documentation of this file.
1 #if defined(USE_HOST)
2 #include "logger.h"
3 
4 namespace esphome {
5 namespace logger {
6 
7 void HOT Logger::write_msg_(const char *msg) {
8  time_t rawtime;
9  struct tm *timeinfo;
10  char buffer[80];
11 
12  time(&rawtime);
13  timeinfo = localtime(&rawtime);
14  strftime(buffer, sizeof buffer, "[%H:%M:%S]", timeinfo);
15  fputs(buffer, stdout);
16  puts(msg);
17 }
18 
19 void Logger::pre_setup() { global_logger = this; }
20 
21 } // namespace logger
22 } // namespace esphome
23 
24 #endif
Logger * global_logger
Definition: logger.cpp:198
void pre_setup()
Set up this component.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void write_msg_(const char *msg)