diff options
| author | bors <bors@rust-lang.org> | 2015-02-23 01:53:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-23 01:53:38 +0000 |
| commit | f0f7ca27de6b4e03f30012656dad270cda55a363 (patch) | |
| tree | 862b2d4252579c51278661075d8d0cf1f4149dcd /src/liblog | |
| parent | 67eb38ee4cfd7b28f8498b5b6492da172768dcb9 (diff) | |
| parent | fc9fa1a563c48cc928c8c5754597ffba6f53a635 (diff) | |
| download | rust-f0f7ca27de6b4e03f30012656dad270cda55a363.tar.gz rust-f0f7ca27de6b4e03f30012656dad270cda55a363.zip | |
Auto merge of #21769 - brooksbp:column-line-macro, r=nick29581
Please see discussion in #19284 .
Diffstat (limited to 'src/liblog')
| -rw-r--r-- | src/liblog/lib.rs | 4 | ||||
| -rw-r--r-- | src/liblog/macros.rs | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/liblog/lib.rs b/src/liblog/lib.rs index c2c7f20ce9c..5c008d35cb3 100644 --- a/src/liblog/lib.rs +++ b/src/liblog/lib.rs @@ -342,7 +342,7 @@ pub struct LogRecord<'a> { pub file: &'a str, /// The line number of where the LogRecord originated. - pub line: uint, + pub line: u32, } #[doc(hidden)] @@ -350,7 +350,7 @@ pub struct LogRecord<'a> { pub struct LogLocation { pub module_path: &'static str, pub file: &'static str, - pub line: uint, + pub line: u32, } /// Tests whether a given module's name is enabled for a particular level of diff --git a/src/liblog/macros.rs b/src/liblog/macros.rs index 4a9a9bd4060..b1d292ebaa8 100644 --- a/src/liblog/macros.rs +++ b/src/liblog/macros.rs @@ -50,6 +50,13 @@ #[macro_export] macro_rules! log { ($lvl:expr, $($arg:tt)+) => ({ + #[cfg(stage0)] + static LOC: ::log::LogLocation = ::log::LogLocation { + line: line!() as u32, + file: file!(), + module_path: module_path!(), + }; + #[cfg(not(stage0))] static LOC: ::log::LogLocation = ::log::LogLocation { line: line!(), file: file!(), |
