diff options
Diffstat (limited to 'src/liblog/macros.rs')
| -rw-r--r-- | src/liblog/macros.rs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs index 2e8302cc10f..233d1c049f4 100644 --- a/src/liblog/macros.rs +++ b/src/liblog/macros.rs @@ -12,8 +12,6 @@ #![macro_escape] -// NOTE(stage0): Remove cfg after a snapshot -#[cfg(not(stage0))] /// The standard logging macro /// /// This macro will generically log over a provided level (of type u32) with a @@ -67,61 +65,6 @@ macro_rules! log { }) } -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -/// The standard logging macro -/// -/// This macro will generically log over a provided level (of type u32) with a -/// format!-based argument list. See documentation in `std::fmt` for details on -/// how to use the syntax. -/// -/// # Example -/// -/// ``` -/// #![feature(phase)] -/// #[phase(plugin, link)] extern crate log; -/// -/// fn main() { -/// log!(log::WARN, "this is a warning {}", "message"); -/// log!(log::DEBUG, "this is a debug message"); -/// log!(6, "this is a custom logging level: {level}", level=6u); -/// } -/// ``` -/// -/// Assumes the binary is `main`: -/// -/// ```{.bash} -/// $ RUST_LOG=warn ./main -/// WARN:main: this is a warning message -/// ``` -/// -/// ```{.bash} -/// $ RUST_LOG=debug ./main -/// DEBUG:main: this is a debug message -/// WARN:main: this is a warning message -/// ``` -/// -/// ```{.bash} -/// $ RUST_LOG=6 ./main -/// DEBUG:main: this is a debug message -/// WARN:main: this is a warning message -/// 6:main: this is a custom logging level: 6 -/// ``` -#[macro_export] -macro_rules! log { - ($lvl:expr, $($arg:tt)+) => ({ - static LOC: ::log::LogLocation = ::log::LogLocation { - line: line!(), - file: file!(), - module_path: module_path!(), - }; - let lvl = $lvl; - if log_enabled!(lvl) { - format_args!(|args| { ::log::log(lvl, &LOC, args) }, $($arg)+) - } - }) -} - /// A convenience macro for logging at the error log level. /// /// # Example |
