
Last chance! 50% off unlimited learning
Sale ends in
This function retrieves the verbosity_level
for your environment using the
priority hierarchy as described in verbosity_level.
While the examples use zephyr
, this function works with any package,
and inside a package it is not necessary to specify it; the default value
of .envir
is enough.
It is normally not relevant to query the verbosity_level
yourself. Instead
use the appropriate msg function.
get_verbosity_level(.envir = sys.function(which = -1))
[character(1)]
representing the verbosity level.
Environment in which the options are defined. Default is suitable for use inside your package.
# Get the verbosity level
# Note: Specifying the environment is not needed when used inside a package
get_verbosity_level("zephyr")
# Temporarily change verbosity level using an environment variable
withr::with_envvar(
new = c("R_ZEPHYR_VERBOSITY_LEVEL" = "quiet"),
code = get_verbosity_level("zephyr")
)
# Temporarily change verbosity level using an option value
withr::with_options(
new = c("zephyr.verbosity_level" = "minimal"),
code = get_verbosity_level("zephyr")
)
Run the code above in your browser using DataLab