You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q: when a "!DEBUG ..." message does not meet the !-threshold, why is its `expression` still evaluated?
.onLoad<-function(libname, pkgname) {
if (requireNamespace("debugme", quietly=TRUE)) {
# https://github.com/r-lib/debugme/issues/26#issuecomment-773615879
get(".onLoad", asNamespace("debugme"))(libname, pkgname)
debugme::debugme()
}
}
#' @exporttestme<-function(...) {
msg<-"!DEBUG This is a test of debug level `0+1`"
message(msg)
msg<-"!!DEBUG This is a test of debug level `0+2`"
message(msg)
TRUE
}
Sys.setenv(DEBUGME="!mypackage")
devtools::document()
testme()
# mypackage This is a test of debug level 1 +5872ms # This is a test of debug level 1# !!DEBUG This is a test of debug level 2# [1] TRUE
I expected the first expression `0+1` to be evaluated, since it should be displayed. But I expected the second msg with `0+2` to instead message the raw string. This is the output I expected:
testme()
# mypackage This is a test of debug level 1 +5872ms # This is a test of debug level 1# !!DEBUG This is a test of debug level `0+2`# [1] TRUE
(I'm not suggesting that every use of "!DEBUG" will have a corresponding message or such (by definition of this package).)
Q: when a
"!DEBUG ..."
message does not meet the!
-threshold, why is its`expression`
still evaluated?I expected the first expression
`0+1`
to be evaluated, since it should be displayed. But I expected the second msg with`0+2`
to instead message the raw string. This is the output I expected:(I'm not suggesting that every use of
"!DEBUG"
will have a correspondingmessage
or such (by definition of this package).)The text was updated successfully, but these errors were encountered: