Skip to content

Commit cb37d09

Browse files
committed
core: Remove logging constants
1 parent 82f1903 commit cb37d09

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

src/libcore/core.rc

+8-1
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,17 @@ pub use clone::Clone;
216216
* more-verbosity. Error is the bottom level, default logging level is
217217
* warn-and-below.
218218
*/
219-
220219
/// The error log level
220+
#[cfg(stage0)]
221221
pub const error : u32 = 1_u32;
222222
/// The warning log level
223+
#[cfg(stage0)]
223224
pub const warn : u32 = 2_u32;
224225
/// The info log level
226+
#[cfg(stage0)]
225227
pub const info : u32 = 3_u32;
226228
/// The debug log level
229+
#[cfg(stage0)]
227230
pub const debug : u32 = 4_u32;
228231

229232

@@ -251,9 +254,13 @@ pub mod rt;
251254
// can be resolved within libcore.
252255
#[doc(hidden)] // FIXME #3538
253256
pub mod core {
257+
#[cfg(stage0)]
254258
pub const error : u32 = 1_u32;
259+
#[cfg(stage0)]
255260
pub const warn : u32 = 2_u32;
261+
#[cfg(stage0)]
256262
pub const info : u32 = 3_u32;
263+
#[cfg(stage0)]
257264
pub const debug : u32 = 4_u32;
258265

259266
pub use cmp;

src/libcore/prelude.rs

-15
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,3 @@ pub use u64;
8282
pub use u8;
8383
pub use uint;
8484
pub use vec;
85-
86-
/*
87-
* Export the log levels as global constants. Higher levels mean
88-
* more-verbosity. Error is the bottom level, default logging level is
89-
* warn-and-below.
90-
*/
91-
92-
/// The error log level
93-
pub const error : u32 = 1_u32;
94-
/// The warning log level
95-
pub const warn : u32 = 2_u32;
96-
/// The info log level
97-
pub const info : u32 = 3_u32;
98-
/// The debug log level
99-
pub const debug : u32 = 4_u32;

src/libsyntax/ext/expand.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -411,34 +411,34 @@ pub fn core_macros() -> ~str {
411411

412412
macro_rules! error (
413413
($arg:expr) => (
414-
log(::core::error, fmt!( \"%?\", $arg ))
414+
log(1u32, fmt!( \"%?\", $arg ))
415415
);
416416
($( $arg:expr ),+) => (
417-
log(::core::error, fmt!( $($arg),+ ))
417+
log(1u32, fmt!( $($arg),+ ))
418418
)
419419
)
420420
macro_rules! warn (
421421
($arg:expr) => (
422-
log(::core::warn, fmt!( \"%?\", $arg ))
422+
log(2u32, fmt!( \"%?\", $arg ))
423423
);
424424
($( $arg:expr ),+) => (
425-
log(::core::warn, fmt!( $($arg),+ ))
425+
log(2u32, fmt!( $($arg),+ ))
426426
)
427427
)
428428
macro_rules! info (
429429
($arg:expr) => (
430-
log(::core::info, fmt!( \"%?\", $arg ))
430+
log(3u32, fmt!( \"%?\", $arg ))
431431
);
432432
($( $arg:expr ),+) => (
433-
log(::core::info, fmt!( $($arg),+ ))
433+
log(3u32, fmt!( $($arg),+ ))
434434
)
435435
)
436436
macro_rules! debug (
437437
($arg:expr) => (
438-
log(::core::debug, fmt!( \"%?\", $arg ))
438+
log(4u32, fmt!( \"%?\", $arg ))
439439
);
440440
($( $arg:expr ),+) => (
441-
log(::core::debug, fmt!( $($arg),+ ))
441+
log(4u32, fmt!( $($arg),+ ))
442442
)
443443
)
444444

0 commit comments

Comments
 (0)