diff --git a/lib/include/srslte/common/log.h b/lib/include/srslte/common/log.h index 0bb876446..0230a350a 100644 --- a/lib/include/srslte/common/log.h +++ b/lib/include/srslte/common/log.h @@ -133,6 +133,7 @@ public: virtual void error(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0; virtual void warning(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0; virtual void info(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0; + virtual void info_long(const char* message, ...) __attribute__((format(printf, 2, 3))) = 0; virtual void debug(const char * message, ...) __attribute__ ((format (printf, 2, 3))) = 0; virtual void debug_long(const char* message, ...) __attribute__((format(printf, 2, 3))) = 0; diff --git a/lib/include/srslte/common/log_filter.h b/lib/include/srslte/common/log_filter.h index ff86cae0f..8cde2b96d 100644 --- a/lib/include/srslte/common/log_filter.h +++ b/lib/include/srslte/common/log_filter.h @@ -57,6 +57,7 @@ public: void error(const char * message, ...) __attribute__ ((format (printf, 2, 3))); void warning(const char * message, ...) __attribute__ ((format (printf, 2, 3))); void info(const char * message, ...) __attribute__ ((format (printf, 2, 3))); + void info_long(const char* message, ...) __attribute__((format(printf, 2, 3))); void debug(const char * message, ...) __attribute__ ((format (printf, 2, 3))); void debug_long(const char* message, ...) __attribute__((format(printf, 2, 3))); diff --git a/lib/src/common/log_filter.cc b/lib/src/common/log_filter.cc index 058a1b4fe..040e5e48a 100644 --- a/lib/src/common/log_filter.cc +++ b/lib/src/common/log_filter.cc @@ -153,6 +153,19 @@ void log_filter::info(const char * message, ...) { all_log_expand(LOG_LEVEL_INFO); } +void log_filter::info_long(const char* message, ...) +{ + if (level >= LOG_LEVEL_INFO) { + char* args_msg = NULL; + va_list args; + va_start(args, message); + if (vasprintf(&args_msg, message, args) > 0) + all_log(LOG_LEVEL_INFO, tti, args_msg, nullptr, strlen(args_msg), true); + va_end(args); + free(args_msg); + } +} + void log_filter::debug(const char * message, ...) { all_log_expand(LOG_LEVEL_DEBUG); }