rust/src/libstd
Alex Crichton ac2a24ecc9 Support arbitrary stdout/stderr/logger handles
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
2014-01-06 13:19:53 -08:00
..
comm Actually block in a windows cvar 2013-12-29 15:23:15 -08:00
fmt Remove std::either 2014-01-03 10:25:23 -08:00
io Support arbitrary stdout/stderr/logger handles 2014-01-06 13:19:53 -08:00
num libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
path Add more benchmark tests to path/posix 2013-12-30 22:59:48 +02:00
rand Don't allow newtype structs to be dereferenced. #6246 2014-01-04 14:44:12 -08:00
rt Support arbitrary stdout/stderr/logger handles 2014-01-06 13:19:53 -08:00
sync Test fixes and rebase conflicts 2013-12-25 23:10:46 -08:00
unstable fixup! libstd: Always inline all byteswap functions 2014-01-03 00:28:17 +01:00
any.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
ascii.rs auto merge of #10828 : SimonSapin/rust/ascii_opt, r=pcwalton 2014-01-02 14:41:50 -08:00
at_vec.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
bool.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
borrow.rs Make 'self lifetime illegal. 2013-12-11 10:54:06 -08:00
c_str.rs std: Fix all code examples 2013-12-23 09:10:36 -08:00
cast.rs std: Fix all code examples 2013-12-23 09:10:36 -08:00
cell.rs libstd: Make a temporary separate stage0 implementation for Cell to 2013-12-26 13:01:25 -08:00
char.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
cleanup.rs librustc: Remove identifiers named box, since it's about to become a keyword. 2013-12-15 10:41:15 -08:00
clone.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
cmp.rs Now inline default 'ne' methods 2013-08-30 22:02:24 -04:00
condition.rs std: Fix all code examples 2013-12-23 09:10:36 -08:00
container.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
default.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
from_str.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
gc.rs libstd: Fix Win32 and other bustage. 2013-11-26 08:25:27 -08:00
hash.rs Don't allow newtype structs to be dereferenced. #6246 2014-01-04 14:44:12 -08:00
hashmap.rs Fix issue #11216 - Replace std::hashmap::{each_key, each_value} with iterators. 2013-12-31 20:29:39 +00:00
iter.rs Renamed ClonableIterator to CloneableIterator 2013-12-27 16:10:11 +02:00
kinds.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
lib.rs auto merge of #11149 : alexcrichton/rust/remove-either, r=brson 2014-01-03 12:16:48 -08:00
libc.rs auto merge of #11186 : alexcrichton/rust/native-udp, r=brson 2013-12-31 16:21:55 -08:00
local_data.rs Conservatively export all trait methods and impls 2013-12-31 12:42:13 -08:00
logging.rs Support arbitrary stdout/stderr/logger handles 2014-01-06 13:19:53 -08:00
managed.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
mem.rs Cleaned, documented, wrote tests for up std::bool 2013-10-24 17:21:39 +02:00
ops.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
option.rs auto merge of #11134 : lucab/rust/lucab/libstd-doc, r=cmr 2013-12-29 08:22:04 -08:00
os.rs std: Stop reexporting the contents of 'mod consts' 2013-12-24 19:59:54 -08:00
owned.rs std: implement Total{Ord,Eq} for pointers. 2013-08-04 19:46:52 +10:00
prelude.rs Remove std::either 2014-01-03 10:25:23 -08:00
ptr.rs std: silence warnings when compiling test. 2013-12-20 01:26:03 +11:00
rc.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
reflect.rs libstd: Remove all non-proc uses of do from libstd 2013-11-26 08:23:57 -08:00
repr.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
result.rs auto merge of #11134 : lucab/rust/lucab/libstd-doc, r=cmr 2013-12-29 08:22:04 -08:00
rtdeps.rs Convert some C functions to rust functions 2013-12-30 14:35:55 -08:00
run.rs auto merge of #11134 : lucab/rust/lucab/libstd-doc, r=cmr 2013-12-29 08:22:04 -08:00
send_str.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
str.rs Don't allow newtype structs to be dereferenced. #6246 2014-01-04 14:44:12 -08:00
task.rs Support arbitrary stdout/stderr/logger handles 2014-01-06 13:19:53 -08:00
to_bytes.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
to_str.rs Rename To{Str,Bytes}Consume traits to Into*. 2013-12-15 01:04:22 +11:00
trie.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
tuple.rs Removed a few macro-expanding-to-module workarounds 2013-11-29 17:33:36 +01:00
unicode.rs Remove dead codes 2013-12-08 02:55:28 -05:00
unit.rs Reordered the methods in std::Option and std::Result 2013-11-01 15:00:46 +01:00
util.rs Remove std::either 2014-01-03 10:25:23 -08:00
vec.rs Add method .as_mut_slice() to MutableVector 2013-12-29 13:27:59 -05:00