1

我得到错误的std::string尺寸值。

statsd_link* statsd_init(std::string& host, int port) {
    switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
         "statsd_init print data to %s:%d and length: %ld, %ld\n", 
             host.c_str(), port, strlen(host.c_str()), host.size());
}

输出是:

2019-06-22 20:55:35.553331 [DEBUG] statsd_init print data to 127.0.0.1:8125 and length: 9, 0
4

0 回答 0