Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


zephyr (version 0.1.2)

get_verbosity_level: Get verbosity level

Description

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.

Usage

get_verbosity_level(.envir = sys.function(which = -1))

Value

[character(1)] representing the verbosity level.

Arguments

.envir

Environment in which the options are defined. Default is suitable for use inside your package.

Examples

Run this code
# 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