diff options
| author | bors <bors@rust-lang.org> | 2013-09-09 10:41:05 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-09 10:41:05 -0700 |
| commit | 059cbaadfaea9a397c144a0a7beff0fc5e9e2664 (patch) | |
| tree | aa520ddc411d71091bd8c1089bda4f69092fed26 /src/libstd | |
| parent | fd2488bf5aeb1c4959bc91f3a17a0bde848d2eeb (diff) | |
| parent | 8a966183fe5129ea2a55a9898ac1bd0f16f3573d (diff) | |
| download | rust-059cbaadfaea9a397c144a0a7beff0fc5e9e2664.tar.gz rust-059cbaadfaea9a397c144a0a7beff0fc5e9e2664.zip | |
auto merge of #9005 : alexcrichton/rust/rusty-log, r=brson
Also redefine all of the standard logging macros to use more rust code instead of custom LLVM translation code. This makes them a bit easier to understand, but also more flexibile for future types of logging. Additionally, this commit removes the LogType language item in preparation for changing how logging is performed.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/logging.rs | 9 | ||||
| -rw-r--r-- | src/libstd/std.rs | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/libstd/logging.rs b/src/libstd/logging.rs index a885a4f7227..1b91276f904 100644 --- a/src/libstd/logging.rs +++ b/src/libstd/logging.rs @@ -37,7 +37,7 @@ pub fn console_off() { rt::logging::console_off(); } -#[cfg(not(test))] +#[cfg(not(test), stage0)] #[lang="log_type"] #[allow(missing_doc)] pub fn log_type<T>(_level: u32, object: &T) { @@ -67,3 +67,10 @@ fn newsched_log_str(msg: ~str) { } } } + +// XXX: This will change soon to not require an allocation. This is an unstable +// api which should not be used outside of the macros in ext/expand. +#[doc(hidden)] +pub fn log(_level: u32, msg: ~str) { + newsched_log_str(msg); +} diff --git a/src/libstd/std.rs b/src/libstd/std.rs index 65fd24b7219..d78ea9f0093 100644 --- a/src/libstd/std.rs +++ b/src/libstd/std.rs @@ -218,6 +218,7 @@ mod std { pub use option; pub use kinds; pub use local_data; + pub use logging; pub use sys; pub use unstable; pub use str; |
