Skip to content
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

Should rlang::inform() use stdout() by default? #852

Closed
jimhester opened this issue Oct 21, 2019 · 1 comment · Fixed by #865
Closed

Should rlang::inform() use stdout() by default? #852

jimhester opened this issue Oct 21, 2019 · 1 comment · Fixed by #865
Labels

Comments

@jimhester
Copy link
Member

jimhester commented Oct 21, 2019

One issue with base::message() is that it outputs to stderr(), which while it works great for terminal usage, in RStudio and in the Windows GUI causes the output to be in red.

I just did a workaround for this in vroom. Maybe we should do this by default in rlang::inform()?

Currently some packages (such as usethis) use cat() for user messaging to avoid the red text issue, but they really should use message conditions, so users can use suppressMessages() to suppress the messages.

@lionel-
Copy link
Member

lionel- commented Oct 28, 2019

We could send to stdout if the session is interactive, and stderr otherwise. This way the output of messages can be filtered out when piping.

lionel- added a commit to lionel-/rlang that referenced this issue Nov 12, 2019
lionel- added a commit that referenced this issue Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants