R: The 'plog' C++ Logging Library

plogr-package {plogr} | R Documentation

## The 'plog' C++ Logging Library

### Description

A simple header-only logging library for C++. Add 'LinkingTo: plogr' to 'DESCRIPTION', and '#include <plogr.h>' in your C++ modules to use it.

### Examples

    plogr_demo <- Rcpp::cppFunction(depends = "plogr", '
    // C++ code begin
    #include <plogr.h>

    RObject plogr_demo() {
      plog::init_r(plog::info);
      LOG_INFO << "shown";
      LOG_DEBUG << "not shown";
      plog::init_r("DEBUG");
      LOG_DEBUG << "shown now";
      return R_NilValue;
    }

    #include <Rcpp.h> // not necessary to use plogr
    // C++ code end
    '
    )

    plogr_demo()

[Package plogr version 0.1-1 Index]