|
|
@ -31,6 +31,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace srslte{
|
|
|
|
namespace srslte{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CHARS_FOR_HEX_DUMP(size) \
|
|
|
|
|
|
|
|
(3 * size + size / 16 * 20) // 3 chars per byte, plus 20 per line for position and newline)
|
|
|
|
|
|
|
|
|
|
|
|
log_filter::log_filter() : log()
|
|
|
|
log_filter::log_filter() : log()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
do_tti = false;
|
|
|
|
do_tti = false;
|
|
|
@ -75,9 +78,9 @@ void log_filter::all_log(
|
|
|
|
if (logger_h) {
|
|
|
|
if (logger_h) {
|
|
|
|
logger::unique_log_str_t log_str = nullptr;
|
|
|
|
logger::unique_log_str_t log_str = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
if (long_msg) {
|
|
|
|
if (long_msg || hex) {
|
|
|
|
// For long messages, dynamically allocate a new log_str with enough size outside the pool.
|
|
|
|
// For long messages, dynamically allocate a new log_str with enough size outside the pool.
|
|
|
|
uint32_t log_str_msg_len = sizeof(buffer_tti) + sizeof(buffer_time) + 20 + size;
|
|
|
|
uint32_t log_str_msg_len = sizeof(buffer_tti) + sizeof(buffer_time) + 20 + strlen(msg) + CHARS_FOR_HEX_DUMP(size);
|
|
|
|
log_str = logger::unique_log_str_t(new logger::log_str(nullptr, log_str_msg_len), logger::log_str_deleter());
|
|
|
|
log_str = logger::unique_log_str_t(new logger::log_str(nullptr, log_str_msg_len), logger::log_str_deleter());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log_str = logger_h->allocate_unique_log_str();
|
|
|
|
log_str = logger_h->allocate_unique_log_str();
|
|
|
|