Open cderv opened 5 years ago
I wonder whether it could be linked to lazy eval
After some searching time, I find that the "!DEBUG "
line are replace by two calls to debugme::debug()
.
Exemple from
https://github.com/RLesur/crrri/blob/de6fd8e9f0402bc0d57e8f46b5872fddf7a5d47b/R/chr_connect.R#L227
gets transform in
debugme::debug(paste0(debugme::debug("!DEBUG Trying to find "),
url))
Will look into debugme
- I may have understand it wrong...
This is a debugme
issue.
It happens with :
First debug process transforms the string correctly :
"!DEBUG x= x
" to
debugme::debugme(paste0("!DEBUG x=", x))
. This is inserted in the function in place of debug string. However if the function is called again, "!DEBUG x="
is catched again (the one in paste0
) and replace with a debugme call.
We have to improve debugme or change to our own internals messaging function. Maybe with cli and several levels to print some message to users and others to developers.
Can't reproduce on a dummy 📦 . only happens with crrri. I put this on hold for now.
My guess is it could be related to the use inside promises::promise()
. I don't have tested so far.
Another hint: Here is how the code is transformed after loading the package (this is when DEBUGME is parsed and transformed)
function (host = "localhost", port = 9222, secure = FALSE)
{
debugme::debug(paste0(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug("!DEBUG Retrieving Chrome websocket entrypoint at http://localhost:")))))))),
port, "/json ..."))
targets <- list_targets(host, port, secure)
active_target <- purrr::detect(targets, ~identical(.x$type,
"page"))
address <- active_target$webSocketDebuggerUrl
if (is.null(address))
debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug("!DEBUG ...websocket entrypoint unavailable.")))))))))
else debugme::debug(paste0(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug(debugme::debug("!DEBUG ...found websocket entrypoint ")))))))),
address))
if (isTRUE(secure)) {
address <- httr::modify_url(address, scheme = "wss")
}
address
}
Way too many debugme::debug()
! There is definitely something off with how debugme is doing on our package
Following #10, there seems to be an issue with how
!DEBUG
line are called.some messages are duplicated and I don't know why... Some are printed before the value in backtick is evaluated. It is not really important regarding how the 📦 works but an improvement to look into on the long run. And see if it happens to other people too...
There are other solution to this if debugme as an issue...