From ef2da4426dc5c75c779d8d224e084d4e53d0ffb6 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Wed, 30 Nov 2022 07:20:00 -0600 Subject: [PATCH 1/2] More efficient string creation for spdlog --- inst/include/spdlog_r_sink.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 { From d5721fa23b5aba629e12792b92ad0d7cd9f88430 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Wed, 30 Nov 2022 07:46:45 -0600 Subject: [PATCH 2/2] Update NEWS.md [ci skip] --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)