Drop the '2' suffix from logging macros

Who doesn't like a massive renaming?
This commit is contained in:
Alex Crichton 2013-10-21 13:08:31 -07:00
parent 15a6bdebab
commit daf5f5a4d1
726 changed files with 3060 additions and 3060 deletions

View file

@ -138,7 +138,7 @@ fn is_utf8_ascii() {
for _ in range(0u, 20000) {
v.push('b' as u8);
if !str::is_utf8(v) {
fail2!("is_utf8 failed");
fail!("is_utf8 failed");
}
}
}
@ -149,7 +149,7 @@ fn is_utf8_multibyte() {
for _ in range(0u, 5000) {
v.push_all(s.as_bytes());
if !str::is_utf8(v) {
fail2!("is_utf8 failed");
fail!("is_utf8 failed");
}
}
}

View file

@ -25,6 +25,6 @@ fn main() {
for i in range(0u, n) {
let x = i.to_str();
info2!("{}", x);
info!("{}", x);
}
}

View file

@ -42,7 +42,7 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
match requests.try_recv() {
Some(get_count) => { responses.send(count.clone()); }
Some(bytes(b)) => {
//error2!("server: received {:?} bytes", b);
//error!("server: received {:?} bytes", b);
count += b;
}
None => { done = true; }
@ -50,7 +50,7 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
}
}
responses.send(count);
//error2!("server exiting");
//error!("server exiting");
}
fn run(args: &[~str]) {
@ -70,10 +70,10 @@ fn run(args: &[~str]) {
worker_results.push(builder.future_result());
do builder.spawn {
for _ in range(0u, size / workers) {
//error2!("worker {:?}: sending {:?} bytes", i, num_bytes);
//error!("worker {:?}: sending {:?} bytes", i, num_bytes);
to_child.send(bytes(num_bytes));
}
//error2!("worker {:?} exiting", i);
//error!("worker {:?} exiting", i);
}
}
do task::spawn || {
@ -84,7 +84,7 @@ fn run(args: &[~str]) {
r.recv();
}
//error2!("sending stop message");
//error!("sending stop message");
to_child.send(stop);
move_out(to_child);
let result = from_child.recv();
@ -107,6 +107,6 @@ fn main() {
args.clone()
};
info2!("{:?}", args);
info!("{:?}", args);
run(args);
}

View file

@ -37,7 +37,7 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
match requests.try_recv() {
Some(get_count) => { responses.send(count.clone()); }
Some(bytes(b)) => {
//error2!("server: received {:?} bytes", b);
//error!("server: received {:?} bytes", b);
count += b;
}
None => { done = true; }
@ -45,7 +45,7 @@ fn server(requests: &Port<request>, responses: &Chan<uint>) {
}
}
responses.send(count);
//error2!("server exiting");
//error!("server exiting");
}
fn run(args: &[~str]) {
@ -64,10 +64,10 @@ fn run(args: &[~str]) {
worker_results.push(builder.future_result());
do builder.spawn {
for _ in range(0u, size / workers) {
//error2!("worker {:?}: sending {:?} bytes", i, num_bytes);
//error!("worker {:?}: sending {:?} bytes", i, num_bytes);
to_child.send(bytes(num_bytes));
}
//error2!("worker {:?} exiting", i);
//error!("worker {:?} exiting", i);
};
}
do task::spawn || {
@ -78,7 +78,7 @@ fn run(args: &[~str]) {
r.recv();
}
//error2!("sending stop message");
//error!("sending stop message");
to_child.send(stop);
move_out(to_child);
let result = from_child.recv();
@ -101,6 +101,6 @@ fn main() {
args.clone()
};
info2!("{:?}", args);
info!("{:?}", args);
run(args);
}

View file

@ -66,7 +66,7 @@ fn show_digit(nn: uint) -> ~str {
7 => {~"seven"}
8 => {~"eight"}
9 => {~"nine"}
_ => {fail2!("expected digits from 0 to 9...")}
_ => {fail!("expected digits from 0 to 9...")}
}
}

View file

@ -66,7 +66,7 @@ fn parse_opts(argv: ~[~str]) -> Config {
Ok(ref m) => {
return Config {stress: m.opt_present("stress")}
}
Err(_) => { fail2!(); }
Err(_) => { fail!(); }
}
}
@ -76,7 +76,7 @@ fn stress_task(id: int) {
let n = 15;
assert_eq!(fib(n), fib(n));
i += 1;
error2!("{}: Completed {} iterations", id, i);
error!("{}: Completed {} iterations", id, i);
}
}

View file

@ -44,7 +44,7 @@ fn roundtrip(id: int, n_tasks: int, p: &Port<int>, ch: &Chan<int>) {
return;
}
token => {
info2!("thread: {} got token: {}", id, token);
info!("thread: {} got token: {}", id, token);
ch.send(token - 1);
if token <= n_tasks {
return;

View file

@ -79,7 +79,7 @@ impl Sudoku {
g[row][col] = from_str::<uint>(comps[2]).unwrap() as u8;
}
else {
fail2!("Invalid sudoku file");
fail!("Invalid sudoku file");
}
}
return Sudoku::new(g)
@ -117,7 +117,7 @@ impl Sudoku {
ptr = ptr + 1u;
} else {
// no: redo this field aft recoloring pred; unless there is none
if ptr == 0u { fail2!("No solution found for this sudoku"); }
if ptr == 0u { fail!("No solution found for this sudoku"); }
ptr = ptr - 1u;
}
}

View file

@ -31,11 +31,11 @@ fn main() {
fn run(repeat: int, depth: int) {
for _ in range(0, repeat) {
info2!("starting {:.4f}", precise_time_s());
info!("starting {:.4f}", precise_time_s());
do task::try {
recurse_or_fail(depth, None)
};
info2!("stopping {:.4f}", precise_time_s());
info!("stopping {:.4f}", precise_time_s());
}
}
@ -68,8 +68,8 @@ fn r(l: @nillist) -> r {
fn recurse_or_fail(depth: int, st: Option<State>) {
if depth == 0 {
info2!("unwinding {:.4f}", precise_time_s());
fail2!();
info!("unwinding {:.4f}", precise_time_s());
fail!();
} else {
let depth = depth - 1;

View file

@ -54,6 +54,6 @@ fn main() {
let (p,c) = comm::stream();
child_generation(from_str::<uint>(args[1]).unwrap(), c);
if p.try_recv().is_none() {
fail2!("it happened when we slumbered");
fail!("it happened when we slumbered");
}
}

View file

@ -43,13 +43,13 @@ fn grandchild_group(num_tasks: uint) {
p.recv(); // block forever
}
}
error2!("Grandchild group getting started");
error!("Grandchild group getting started");
for _ in range(0, num_tasks) {
// Make sure all above children are fully spawned; i.e., enlisted in
// their ancestor groups.
po.recv();
}
error2!("Grandchild group ready to go.");
error!("Grandchild group ready to go.");
// Master grandchild task exits early.
}
@ -58,7 +58,7 @@ fn spawn_supervised_blocking(myname: &str, f: ~fn()) {
let res = builder.future_result();
builder.supervised();
builder.spawn(f);
error2!("{} group waiting", myname);
error!("{} group waiting", myname);
let x = res.recv();
assert_eq!(x, task::Success);
}
@ -84,11 +84,11 @@ fn main() {
grandchild_group(num_tasks);
}
// When grandchild group is ready to go, make the middle group exit.
error2!("Middle group wakes up and exits");
error!("Middle group wakes up and exits");
}
// Grandparent group waits for middle group to be gone, then fails
error2!("Grandparent group wakes up and fails");
fail2!();
error!("Grandparent group wakes up and fails");
fail!();
};
assert!(x.is_err());
}