In zephyr we define a central verbosity level to control the amount of messages the user receives when using zephyr and other packages in the ecosystem.
Verbosity level can be any of the four values below:
quiet
: No messages are displayed.minimal
: Only essential messages are displayed.verbose
(default): More informative messages are displayed.debug
: Detailed messages for debugging are displayed.
See use_zephyr()
and msg for how to implement the use of verbosity levels
in your package and its functions.
Verbosity level is a special kind of option that can be scoped both for a
specific package and and globally for the ecosystem
(assigned to the zephyr package).
It can be set using either R options()
or environment variables.
Verbosity level is retrieved using the get_verbosity_level()
function.
Since the level can have multiples scopes, the following hierarchy is used:
Package specific option:
{pkgname}.verbosity_level
Package specific environment variable:
R_{PKGNAME}_VERBOSITY_LEVEL
Ecosystem wide option:
zephyr.verbosity_level
Ecosystem wide environment variable (
R_ZEPHYR_VERBOSITY_LEVEL
)Default value specified in zephyr (
verbose
, see above).
In order to see all registered verbosity levels across scopes call
get_all_verbosity_levels()
.
Examples
get_verbosity_level("zephyr")
#> [1] "verbose"
get_all_verbosity_levels()
#> zephyr
#> "verbose"