Sun, 18 Jun 2023

spdl 0.0.5 on CRAN: Small Extension

Another quick update to the still somewhat new package spdl is now om CRAN, and will go to Debian soon too. The key focus of spdl is to offer the exact same interface to logging from both R and C++ by relying on spdlog via my RcppSpdlog package. Usage examples are shown on the RcppSpdlog docs page.

This release add support for the wrappers init() and log() wrapping the existing setup() function but requiring only the level argument. This requires version 0.0.13 of RcppSpdlog which was released to CRAN yesterday.

The short NEWS entry follows.

Changes in spdl version 0.0.5 (2023-06-18)

  • Add simple aliases init() and log() wrapping setup() but requiring only the logging level argument

Courtesy of my CRANberries, there is also a diffstat report. More detailed information is on the spdl page

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

/code/spdl | permanent link

Sun, 08 Jan 2023

spdl 0.0.4 on CRAN: Adding Stopwatch

Another quick update to the still new-ish package spdl is now om CRAN, and in Debian. The key focus of spdl is a offering the same interface from both R and C++ for logging by relying on spdlog via my RcppSpdlog package.

This release add support for the stopwatch() facility. One can now instantiate such an object, and referencing it in a log message shows the elapsed time. No more, no less, and it works the same way in R and C++.

The short NEWS entry follows.

Changes in spdl version 0.0.4 (2023-01-08)

  • Add support for stopwatch

Courtesy of my CRANberries, there is also a diffstat report. More detailed information is on the spdl page.

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

/code/spdl | permanent link

Wed, 14 Dec 2022

spdl 0.0.3 on CRAN: Adding File Logger

A second update to the still-new package spdl is now om CRAN, and in Debian. The key focus of spdl is a offering the same interface from both R and C++ for logging by relying on spdlog via my RcppSpdlog package.

This release add support for a simple filesetup() initialiser to direct logging output to a file. For now the console logger and the file logger are exclusive, if there is interest we could borrow a page from upstream and combine them.

The short NEWS entry follows.

Changes in spld version 0.0.3 (2022-12-14)

  • Add filesetup method

Courtesy of my CRANberries, there is also a diffstat report. More detailed information is on the spdl page.

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

/code/spdl | permanent link

Thu, 01 Dec 2022

spdl 0.0.2 on CRAN: First Update

A first update to the recently-released package spdl is now om CRAN. The key focus of spdl is a offering the same interface from both R and C++ for logging by relying on spdlog via my RcppSpdlog package.

This release exposes simple helpers fmt() (to format text according to the included fmt library) and cat() which formats and prints.

The very short NEWS entry for this release follows.

Changes in spld version 0.0.2 (2022-12-01)

  • Helper functions fmt() and cat() have been added

Courtesy of my CRANberries, there is also a diffstat report. More detailed information is on the spdl page.

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

/code/spdl | permanent link

Tue, 22 Nov 2022

spdl 0.0.1 on CRAN: New Package!

A new package made it to CRAN today: spdl. It provides a very simple interface to spdlog with the key focus being that provides the same interface from both R and C++. I had brought spdlog to R a little while ago via RcppSpdlog, but its use was generally limited to C++ code where we would write something like (taken from one of the examples included in the package)

spdlog::info("Welcome to spdlog!");

I then provided C-level exports from the package accessible in other package but with that the signature only became longer as it also included the package name, here RcppSpdlog. So I experimented a little with that and added another ‘more compactly named’ namespace spdl around it. So then it becomes

spdl::info("Info message with values {} and {}", 42, 1.23);  // C++ code

which now also shows the power of the included fmt library. And I got quite used to that … and now wanted to same from R! But to create a new namespace, we need a new package. So … we made one. Now from R too:

spdl::info("Info message with values {} and {}", 42L, 1.23)  # R code

We layered a very simple wrapper for fmt over this. All R argument are passed to format() and we simply send a vector of strings over the C interface to the RcppSpdlog package where the templated formatter of fmt is invoked – but for character values. You can equally well format the string locally first. Everything works: from paste() to sprintf() to any of the existing string interpolators all of which are nice. But none works just like fmt and I wanted to have the same formatter in both languages, and like how fmt works.

By tradition, the NEWS entry for this release follows.

Changes in spld version 0.0.1 (2022-11-21)

  • Initial release of R and C++ loggers using spdl::* namespace

More detailed information is on the spdl page.

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

/code/spdl | permanent link