Update for new logger API
This commit is contained in:
@@ -67,9 +67,10 @@ void Syslog::setup() {
|
|||||||
#ifdef USE_LOGGER
|
#ifdef USE_LOGGER
|
||||||
if (logger::global_logger != nullptr && this->forward_logger_) {
|
if (logger::global_logger != nullptr && this->forward_logger_) {
|
||||||
logger::global_logger->add_on_log_callback(
|
logger::global_logger->add_on_log_callback(
|
||||||
[this](int level, const char *tag, const char *message) {
|
[this](int level, const char *tag, const char *raw_message, size_t raw_message_len) {
|
||||||
if (level > this->min_log_level_) return;
|
if (level > this->min_log_level_) return;
|
||||||
|
|
||||||
|
std::string message = std::string(raw_message, raw_message_len);
|
||||||
if (this->strip_color_codes_) {
|
if (this->strip_color_codes_) {
|
||||||
std::string clean_message = remove_ansi_colors(message);
|
std::string clean_message = remove_ansi_colors(message);
|
||||||
this->log(level, tag, clean_message);
|
this->log(level, tag, clean_message);
|
||||||
|
|||||||
Reference in New Issue
Block a user