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

It would be nice to be able to redirect stdin/stdout/stderr for individual tasks. #6369

Closed
Thiez opened this issue May 9, 2013 · 2 comments · Fixed by #11353
Closed

It would be nice to be able to redirect stdin/stdout/stderr for individual tasks. #6369

Thiez opened this issue May 9, 2013 · 2 comments · Fixed by #11353
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@Thiez
Copy link
Contributor

Thiez commented May 9, 2013

As the title says, this would be a nice feature to have, and could be a part of the new I/O design (#4248).
One possible application would be buffering stdout/stderr of the tests so that any output can appear without being mixed with output from other tests. I'm sure other (useful) applications exist, such as discarding unwanted output from a task.

@toddaaro
Copy link
Contributor

toddaaro commented Jul 3, 2013

Not sure if this will make it in, but it is an idea worth considering as this whole API is changing a lot. Tagged with runtime.

@catamorphism
Copy link
Contributor

Would be nice; not a milestone blocker.

bors added a commit that referenced this issue Jan 7, 2014
This will allow capturing of common things like logging messages, stdout prints
(using stdio println), and failure messages (printed to stderr).  Any new prints
added to libstd should be funneled through these task handles to allow capture
as well.

Additionally, this commit redirects logging back through a `Logger` trait so the
log level can be usefully consumed by an arbitrary logger.

This commit also introduces methods to set the task-local stdout handles:

* std::io::stdio::set_stdout
* std::io::stdio::set_stderr
* std::io::logging::set_logger

These methods all return the previous logger just in case it needs to be used
for inspection.

I plan on using this infrastructure for extra::test soon, but we don't quite
have the primitives that I'd like to use for it, so it doesn't migrate
extra::test at this time.

Closes #6369
flip1995 pushed a commit to flip1995/rust that referenced this issue Dec 6, 2020
Disable unnecessary_cast for cfg-dependant types

changelog: Disable unnecessary_cast for cfg-dependant types

Fix  rust-lang#6331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants