diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-01 11:38:55 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-03 09:16:31 -0700 |
| commit | 88593fc3fc808e78dd89be95c997c94ba4c816da (patch) | |
| tree | 19ce3ecf02eead4594123bee1b05249ffce7dbb4 /src/libstd/rt | |
| parent | a1ffb06ac828f689af428b715cdd601a41021862 (diff) | |
| download | rust-88593fc3fc808e78dd89be95c997c94ba4c816da.tar.gz rust-88593fc3fc808e78dd89be95c997c94ba4c816da.zip | |
Document logging and remove old functions
This adds a large doc-block to the top of the std::logging module explaining how
to use it. This is mostly just making sure that all the information in the
manual's section about logging is also here (in case someone decides to look
into this module first).
This also removes the old console_{on,off} methods. As far as I can tell, the
functions were only used by the compiler, and there's no reason for them to be
used because they're all turned off by default anyway (maybe they were turned on
by default at some point...)
I believe that this is the final nail in the coffin and closes #5021
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/logging.rs | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/libstd/rt/logging.rs b/src/libstd/rt/logging.rs index 51eb2505f55..ea0f5f59a7e 100644 --- a/src/libstd/rt/logging.rs +++ b/src/libstd/rt/logging.rs @@ -10,7 +10,7 @@ use fmt; use from_str::from_str; -use libc::{uintptr_t, exit}; +use libc::exit; use option::{Some, None, Option}; use rt; use rt::util::dumb_println; @@ -182,9 +182,7 @@ pub struct StdErrLogger; impl Logger for StdErrLogger { fn log(&mut self, args: &fmt::Arguments) { - if should_log_console() { - fmt::writeln(self as &mut rt::io::Writer, args); - } + fmt::writeln(self as &mut rt::io::Writer, args); } } @@ -220,21 +218,6 @@ pub fn init() { } } -#[fixed_stack_segment] #[inline(never)] -pub fn console_on() { unsafe { rust_log_console_on() } } - -#[fixed_stack_segment] #[inline(never)] -pub fn console_off() { unsafe { rust_log_console_off() } } - -#[fixed_stack_segment] #[inline(never)] -fn should_log_console() -> bool { unsafe { rust_should_log_console() != 0 } } - -extern { - fn rust_log_console_on(); - fn rust_log_console_off(); - fn rust_should_log_console() -> uintptr_t; -} - // Tests for parse_logging_spec() #[test] fn parse_logging_spec_valid() { |
