fujuntang
2021-08-31 3eaf53d55e0d896db4de4b5ec74f76163c6e0bd5
Test the logger debug api.
1个文件已修改
10 ■■■■■ 已修改文件
src/bh_api.cpp 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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]);
        }
        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