From 3eaf53d55e0d896db4de4b5ec74f76163c6e0bd5 Mon Sep 17 00:00:00 2001 From: fujuntang <fujuntang@smartai.com> Date: 星期二, 31 八月 2021 16:57:40 +0800 Subject: [PATCH] Test the logger debug api. --- src/bh_api.cpp | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/bh_api.cpp b/src/bh_api.cpp index c6519dc..b4ba52e 100644 --- a/src/bh_api.cpp +++ b/src/bh_api.cpp @@ -341,9 +341,7 @@ strncpy(topics_buf + count, _input.topics[i], min); count += min; - if (total >= strlen(_input.topics[i])) { - total -= strlen(_input.topics[i]); - } + total -= min; if ((_input.amount > 1) && (i < (_input.amount - 1))) { strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); @@ -355,7 +353,7 @@ } } - logger->debug("the parsed compound register topics: %s!\n", topics_buf); + //logger->debug("the parsed compound register topics: %s!\n", topics_buf); #else memcpy(topics_buf, topics, topics_len > (sizeof(topics_buf) - 1) ? (sizeof(topics_buf) - 1) : topics_len); #endif @@ -777,9 +775,7 @@ strncpy(topics_buf + count, _input.topics[i], min); count += min; - if (total >= strlen(_input.topics[i])) { - total -= strlen(_input.topics[i]); - } + total -= strlen(_input.topics[i]); if ((_input.amount > 1) && (i < (_input.amount - 1))) { strncpy(topics_buf + count, STR_MAGIC, strlen(STR_MAGIC)); @@ -790,7 +786,7 @@ topics_buf[strlen(topics_buf) - 1] = '\0'; } } - logger->debug("the parsed compound sub topics: %s!\n", topics_buf); + //logger->debug("the parsed compound sub topics: %s!\n", topics_buf); #else memcpy(topics_buf, topics, topics_len > (sizeof(topics_buf) - 1) ? (sizeof(topics_buf) - 1) : topics_len); #endif -- Gitblit v1.8.0