rt: bump log levels up by one, fix tautological-compare error (and permit turning off logging entirely).

This commit is contained in:
Graydon Hoare 2012-11-15 12:03:45 -08:00
parent adc4bed773
commit 59a034a63f
4 changed files with 14 additions and 14 deletions

View File

@ -54,23 +54,23 @@ pub use coreops::ops::{Shl, Shr, Index};
// warn-and-below.
/// The error log level
pub const error : u32 = 0_u32;
pub const error : u32 = 1_u32;
/// The warning log level
pub const warn : u32 = 1_u32;
pub const warn : u32 = 2_u32;
/// The info log level
pub const info : u32 = 2_u32;
pub const info : u32 = 3_u32;
/// The debug log level
pub const debug : u32 = 3_u32;
pub const debug : u32 = 4_u32;
// A curious inner-module that's not exported that contains the binding
// 'core' so that macro-expanded references to core::error and such
// can be resolved within libcore.
#[doc(hidden)] // FIXME #3538
mod core {
pub const error : u32 = 0_u32;
pub const warn : u32 = 1_u32;
pub const info : u32 = 2_u32;
pub const debug : u32 = 3_u32;
pub const error : u32 = 1_u32;
pub const warn : u32 = 2_u32;
pub const info : u32 = 3_u32;
pub const debug : u32 = 4_u32;
}
// Similar to above. Some magic to make core testable.

View File

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

View File

@ -168,7 +168,7 @@ struct log_directive {
const size_t max_log_directives = 255;
const size_t max_log_level = 255;
const size_t default_log_level = 0;
const size_t default_log_level = log_err;
// This is a rather ugly parser for strings in the form
// "crate1,crate2.mod3,crate3.x=1". Log levels are 0-255,

View File

@ -4,10 +4,10 @@
#include "rust_globals.h"
const uint32_t log_err = 0;
const uint32_t log_warn = 1;
const uint32_t log_info = 2;
const uint32_t log_debug = 3;
const uint32_t log_err = 1;
const uint32_t log_warn = 2;
const uint32_t log_info = 3;
const uint32_t log_debug = 4;
#define LOG(task, field, ...) \
DLOG_LVL(log_debug, task, task->sched_loop, field, __VA_ARGS__)