-
Notifications
You must be signed in to change notification settings - Fork 70
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
cli_fmt()
does not capture output for cat_()
functions
#703
Comments
Here's the workaround function I've been using for anyone running into the same problem: capture_all_output <- function(expr) {
con <- textConnection("out", open = "w", local = TRUE)
sink(con, append = TRUE, type = "output")
sink(con, append = TRUE, type = "message")
force(expr)
sink(type = "output")
sink(type = "message")
close(con)
get("out")
} |
That's intentional. It only captures the semantic CLI elements: https://cli.r-lib.org/reference/index.html#semantic-cli-elements |
Aha, thanks for explaining. Is this because |
No, it is not because of that. It is because cli messages have a class, and |
Here's a reprex:
Created on 2024-07-09 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: