diff --git a/NEWS.md b/NEWS.md index d36ef64f5b..a57d089670 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ * Support for testing group URIs on being relative has been added (#478) -* Logging support at the R and C++ level has been added (#479, #487) +* Logging support at the R and C++ level has been added (#479, #487, #489) * Use of TileDB Embedded was upgraded to release 2.12.1, and 2.12.2 (#480, #481) diff --git a/inst/include/spdlog_r_sink.h b/inst/include/spdlog_r_sink.h index 3f0ea824d8..8cd3723264 100644 --- a/inst/include/spdlog_r_sink.h +++ b/inst/include/spdlog_r_sink.h @@ -42,7 +42,8 @@ namespace spdlog { // sending it to its final destination: spdlog::memory_buf_t formatted; spdlog::sinks::base_sink::formatter_->format(msg, formatted); - Rprintf(fmt::to_string(formatted).c_str()); + formatted.push('\0'); // convert to c string + Rprintf(formatted.data()); // and print via R's i/o streams } void flush_() override {