A logger using stream for esp-idf.
- esp-idf v2.1.1
Like this
m2d::ESP32::Logger::I << "Hello";
m2d::ESP32::Logger::I << " world"; // Easy to append characters
m2d::ESP32::Logger::I << m2d::ESP32::Logger::endl; // You have to insert `m2d::ESP32::Logger::endl` to print your console.
You can change tag string.
Just call set_tag(std::string tag)
method.
Following formats are available in include/StreamLogger/Logger.h
:
static Stream<Error> E; // wrapper of ESP_LOGE
static Stream<Warning> W; // wrapper of ESP_LOGW
static Stream<Info> I; // wrappaer of ESP_LOGI
static Stream<Debug> D; // wrapper of ESP_LOGD
static Stream<Verbose> V; // wrapper of ESP_LOGV
- Implement subclass of
Impl
. - Implement
void print(const char *str)
method. - Declare as
Stream<OriginalFormat> logger
.
MIT