Skip to content

Commit 59a034a

Browse files
committed
rt: bump log levels up by one, fix tautological-compare error (and permit turning off logging entirely).
1 parent adc4bed commit 59a034a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

Diff for: src/libcore/core.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,23 @@ pub use coreops::ops::{Shl, Shr, Index};
5454
// warn-and-below.
5555

5656
/// The error log level
57-
pub const error : u32 = 0_u32;
57+
pub const error : u32 = 1_u32;
5858
/// The warning log level
59-
pub const warn : u32 = 1_u32;
59+
pub const warn : u32 = 2_u32;
6060
/// The info log level
61-
pub const info : u32 = 2_u32;
61+
pub const info : u32 = 3_u32;
6262
/// The debug log level
63-
pub const debug : u32 = 3_u32;
63+
pub const debug : u32 = 4_u32;
6464

6565
// A curious inner-module that's not exported that contains the binding
6666
// 'core' so that macro-expanded references to core::error and such
6767
// can be resolved within libcore.
6868
#[doc(hidden)] // FIXME #3538
6969
mod core {
70-
pub const error : u32 = 0_u32;
71-
pub const warn : u32 = 1_u32;
72-
pub const info : u32 = 2_u32;
73-
pub const debug : u32 = 3_u32;
70+
pub const error : u32 = 1_u32;
71+
pub const warn : u32 = 2_u32;
72+
pub const info : u32 = 3_u32;
73+
pub const debug : u32 = 4_u32;
7474
}
7575

7676
// Similar to above. Some magic to make core testable.

Diff for: src/librustc/rustc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ fn monitor(+f: fn~(diagnostic::emitter)) {
222222
for [
223223
~"the compiler hit an unexpected failure path. \
224224
this is a bug",
225-
~"try running with RUST_LOG=rustc=0,::rt::backtrace \
225+
~"try running with RUST_LOG=rustc=1,::rt::backtrace \
226226
to get further details and report the results \
227227
to github.com/mozilla/rust/issues"
228228
].each |note| {

Diff for: src/rt/rust_log.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ struct log_directive {
168168

169169
const size_t max_log_directives = 255;
170170
const size_t max_log_level = 255;
171-
const size_t default_log_level = 0;
171+
const size_t default_log_level = log_err;
172172

173173
// This is a rather ugly parser for strings in the form
174174
// "crate1,crate2.mod3,crate3.x=1". Log levels are 0-255,

Diff for: src/rt/rust_log.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
#include "rust_globals.h"
66

7-
const uint32_t log_err = 0;
8-
const uint32_t log_warn = 1;
9-
const uint32_t log_info = 2;
10-
const uint32_t log_debug = 3;
7+
const uint32_t log_err = 1;
8+
const uint32_t log_warn = 2;
9+
const uint32_t log_info = 3;
10+
const uint32_t log_debug = 4;
1111

1212
#define LOG(task, field, ...) \
1313
DLOG_LVL(log_debug, task, task->sched_loop, field, __VA_ARGS__)

0 commit comments

Comments
 (0)