-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new simple internal options and verbosity level #29
Conversation
options::as_params() options::envvar_is_true() options::envvar_str_split(delim = ";")
…::envvar_str_split
…king for local option.
…, fails since the package environment is locked. Updating to have the option set at global level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose modifying the msg
function to utilize cli::cli_alert
instead of its current use of cli::cli_alert_info
. This change would allow us to create a distinction between the general msg
function and a more specific msg_info
function. As an example:
> foo <- function() {
+ msg_debug("Some important debug information about the function")
+ msg("Starting calculations")
+
+ result <- 1 + 1 # Replace with long calculations and how to create output
+
+ msg("getting output creation status")
+
+ if (result == 2) {
+ msg_success("Output created")
+ } else {
+ msg_danger("Output not created correctly")
+ }
+
+ return(result)
+ }
>
> withr::with_options(
+ new = list(zephyr.verbosity_level = "debug"),
+ code = foo()
+ )
ℹ Some important debug information about the function
→ Starting calculations
→ getting output creation status
✔ Output created
[1] 2
Code coverage
|
Github pagesReview the pkgdown webpage for the PR here |
Large update of zephyr
get_verbosity_level()
functions are now based onget_option()
.use_zephyr()
has been added to easily setup the above in your package.Suggest
imports ofcallr
anddevtools
are due to this test. There may be a way to achieve the same with less imports.