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

Cannot suppress warnings or messages from is_online() #9

Closed
ramiromagno opened this issue Oct 21, 2018 · 1 comment
Closed

Cannot suppress warnings or messages from is_online() #9

ramiromagno opened this issue Oct 21, 2018 · 1 comment

Comments

@ramiromagno
Copy link

hi @gaborcsardi,

It seems it is not possible to suppress either warnings or messages from is_online(), perhaps because they are neither. Still, it would be nice to be able to quiet is_online()...

> suppressMessages(pingr::is_online())
ping: google-public-dns-a.google.com: Temporary failure in name resolution
ping: b.resolvers.Level3.net: Temporary failure in name resolution
connect: Network is unreachable
connect: Network is unreachable
[1] FALSE
> suppressWarnings(pingr::is_online())
ping: google-public-dns-a.google.com: Temporary failure in name resolution
ping: b.resolvers.Level3.net: Temporary failure in name resolution
connect: Network is unreachable
connect: Network is unreachable
[1] FALSE

I believe this results from using the system() function:

output <- suppressWarnings(system(os$cmd, intern = ! verbose))

Could you not change that system call to:

output <- suppressWarnings(
                   system(os$cmd, intern = ! verbose,
                               ignore.stdout = TRUE, ignore.stderr = TRUE)
) 
@gaborcsardi
Copy link
Member

After switching to processx (#8), no messages are shown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants