about summary refs log tree commit diff
path: root/src/liblog
diff options
context:
space:
mode:
Diffstat (limited to 'src/liblog')
-rw-r--r--src/liblog/lib.rs4
-rw-r--r--src/liblog/macros.rs9
2 files changed, 10 insertions, 3 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 787d9c470d4..b1d292ebaa8 100644
--- a/src/liblog/macros.rs
+++ b/src/liblog/macros.rs
@@ -50,8 +50,15 @@
 #[macro_export]
 macro_rules! log {
     ($lvl:expr, $($arg:tt)+) => ({
+        #[cfg(stage0)]
         static LOC: ::log::LogLocation = ::log::LogLocation {
-            line: line!() as usize,
+            line: line!() as u32,
+            file: file!(),
+            module_path: module_path!(),
+        };
+        #[cfg(not(stage0))]
+        static LOC: ::log::LogLocation = ::log::LogLocation {
+            line: line!(),
             file: file!(),
             module_path: module_path!(),
         };