set_dvs_log_level() controls which log messages from the dvs core are routed to R's console. error and warn go to stderr; info, debug, and trace go to stdout. The default at package load is off.

set_dvs_log_level(level = c("off", "error", "warn", "info", "debug", "trace"))

🔗Parameters

NameTypeDefaultBehavior
levelcharacter(1)"off"One of off, error, warn, info, debug, trace. Validated with match.arg().

Called for its side effect; returns NULL invisibly.

🔗Setup

options(width = 1000)
library(dvs)
proj  <- tempfile("project_")
store <- tempfile("storage_")
dir.create(proj)
dir.create(store)
write.csv(mtcars, file.path(proj, "cars.csv"))
setwd(proj)
dvs_init(store)
DVS Initialized

🔗Enable logging around an operation

Set the level to "info" before an add, then reset to "off".

setwd(proj)
set_dvs_log_level("info")
dvs_add("cars.csv")
Successfully added cars.csv (Copied)
# A tibble: 1 × 5
  path     outcome hash                                                                size stored_size
  <chr>    <chr>   <chr>                                                            <bytes>     <bytes>
1 cars.csv copied  5920946da5cfd6b4b32cf7b2fb866d926637dadb1b38d3d943bf8db3b9ebdb63  1.7 KB       905 B
set_dvs_log_level("off")

🔗Restore the default

"off" is the load-time default and silences core log output.

set_dvs_log_level("off")

The R package does not consult the RUST_LOG environment variable; set_dvs_log_level() is the only way to change the level. RUST_LOG applies to the CLI binary only.

🔗See also