diff --git a/doc/rust.md b/doc/rust.md index e559af62e360c..72e4beff7de37 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -212,7 +212,7 @@ do drop else enum extern false fn for if impl -let log loop +let loop match mod mut priv pub pure ref return @@ -805,21 +805,20 @@ Use declarations support a number of "convenience" notations: An example of `use` declarations: ~~~~ -use foo = core::info; use core::float::sin; use core::str::{slice, to_upper}; use core::option::Some; fn main() { - // Equivalent to 'log(core::info, core::float::sin(1.0));' - log(foo, sin(1.0)); + // Equivalent to 'info!(core::float::sin(1.0));' + info!(sin(1.0)); - // Equivalent to 'log(core::info, core::option::Some(1.0));' - log(info, Some(1.0)); + // Equivalent to 'info!(core::option::Some(1.0));' + info!(Some(1.0)); - // Equivalent to 'log(core::info, - // core::str::to_upper(core::str::slice("foo", 0, 1)));' - log(info, to_upper(slice("foo", 0, 1))); + // Equivalent to + // 'info!(core::str::to_upper(core::str::slice("foo", 0, 1)));' + info!(to_upper(slice("foo", 0, 1))); } ~~~~ @@ -990,7 +989,7 @@ output slot type would normally be. For example: ~~~~ fn my_err(s: &str) -> ! { - log(info, s); + info!(s); fail!(); } ~~~~ @@ -2397,58 +2396,6 @@ fn max(a: int, b: int) -> int { } ~~~~ -### Log expressions - -~~~~~~~~{.ebnf .gram} -log_expr : "log" '(' level ',' expr ')' ; -~~~~~~~~ - -Evaluating a `log` expression may, depending on runtime configuration, cause a -value to be appended to an internal diagnostic logging buffer provided by the -runtime or emitted to a system console. Log expressions are enabled or -disabled dynamically at run-time on a per-task and per-item basis. See -[logging system](#logging-system). - -Each `log` expression must be provided with a *level* argument in -addition to the value to log. The logging level is a `u32` value, where -lower levels indicate more-urgent levels of logging. By default, the lowest -four logging levels (`1_u32 ... 4_u32`) are predefined as the constants -`error`, `warn`, `info` and `debug` in the `core` library. - -Additionally, the macros `error!`, `warn!`, `info!` and `debug!` are defined -in the default syntax-extension namespace. These expand into calls to the -logging facility composed with calls to the `fmt!` string formatting -syntax-extension. - -The following examples all produce the same output, logged at the `error` -logging level: - -~~~~ -# let filename = "bulbasaur"; - -// Full version, logging a value. -log(core::error, ~"file not found: " + filename); - -// Log-level abbreviated, since core::* is used by default. -log(error, ~"file not found: " + filename); - -// Formatting the message using a format-string and fmt! -log(error, fmt!("file not found: %s", filename)); - -// Using the error! macro, that expands to the previous call. -error!("file not found: %s", filename); -~~~~ - -A `log` expression is *not evaluated* when logging at the specified logging-level, module or task is disabled at runtime. -This makes inactive `log` expressions very cheap; -they should be used extensively in Rust code, as diagnostic aids, -as they add little overhead beyond a single integer-compare and branch at runtime. - -Logging is presently implemented as a language built-in feature, -as it makes use of compiler-provided, per-module data tables and flags. -In the future, logging will move into a library, and will no longer be a core expression type. -It is therefore recommended to use the macro forms of logging (`error!`, `debug!`, etc.) to minimize disruption in code that uses logging. - # Type system @@ -3149,7 +3096,7 @@ communication facilities. The runtime contains a system for directing [logging expressions](#log-expressions) to a logging console and/or internal logging -buffers. Logging expressions can be enabled per module. +buffers. Logging can be enabled per module. Logging output is enabled by setting the `RUST_LOG` environment variable. `RUST_LOG` accepts a logging specification made up of a diff --git a/doc/tutorial.md b/doc/tutorial.md index e4775e1b11b4d..3fa53abf6b906 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -744,7 +744,7 @@ unit, `()`, as the empty tuple if you like). ~~~~ let mytup: (int, int, float) = (10, 20, 30.0); match mytup { - (a, b, c) => log(info, a + b + (c as int)) + (a, b, c) => info!(a + b + (c as int)) } ~~~~ @@ -760,7 +760,7 @@ For example: struct MyTup(int, int, float); let mytup: MyTup = MyTup(10, 20, 30.0); match mytup { - MyTup(a, b, c) => log(info, a + b + (c as int)) + MyTup(a, b, c) => info!(a + b + (c as int)) } ~~~~ diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 736c20969e991..616ca8d484053 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -46,6 +46,6 @@ pub fn path_div() -> ~str { ~":" } pub fn path_div() -> ~str { ~";" } pub fn logv(config: config, s: ~str) { - log(debug, s); + debug!("%s", s); if config.verbose { io::println(s); } } diff --git a/src/libcore/core.rc b/src/libcore/core.rc index 026f49cac45b1..31d553f5a8cf3 100644 --- a/src/libcore/core.rc +++ b/src/libcore/core.rc @@ -216,14 +216,17 @@ pub use clone::Clone; * more-verbosity. Error is the bottom level, default logging level is * warn-and-below. */ - /// The error log level +#[cfg(stage0)] pub const error : u32 = 1_u32; /// The warning log level +#[cfg(stage0)] pub const warn : u32 = 2_u32; /// The info log level +#[cfg(stage0)] pub const info : u32 = 3_u32; /// The debug log level +#[cfg(stage0)] pub const debug : u32 = 4_u32; @@ -251,9 +254,13 @@ pub mod rt; // can be resolved within libcore. #[doc(hidden)] // FIXME #3538 pub mod core { + #[cfg(stage0)] pub const error : u32 = 1_u32; + #[cfg(stage0)] pub const warn : u32 = 2_u32; + #[cfg(stage0)] pub const info : u32 = 3_u32; + #[cfg(stage0)] pub const debug : u32 = 4_u32; pub use cmp; diff --git a/src/libcore/io.rs b/src/libcore/io.rs index b04bb15f5e30b..a9dfecfe9b15e 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -683,7 +683,7 @@ impl Writer for *libc::FILE { *self); if nout != len as size_t { error!("error writing buffer"); - log(error, os::last_os_error()); + error!("%s", os::last_os_error()); fail!(); } } @@ -733,7 +733,7 @@ impl Writer for fd_t { let nout = libc::write(*self, vb, len as size_t); if nout < 0 as ssize_t { error!("error writing buffer"); - log(error, os::last_os_error()); + error!("%s", os::last_os_error()); fail!(); } count += nout as uint; @@ -1288,7 +1288,6 @@ pub mod fsync { #[cfg(test)] mod tests { - use debug; use i32; use io::{BytesWriter, SeekCur, SeekEnd, SeekSet}; use io; @@ -1301,10 +1300,10 @@ mod tests { #[test] fn test_simple() { let tmpfile = &Path("tmp/lib-io-test-simple.tmp"); - log(debug, tmpfile); + debug!(tmpfile); let frood: ~str = ~"A hoopy frood who really knows where his towel is."; - log(debug, copy frood); + debug!(copy frood); { let out: io::Writer = result::get( @@ -1313,7 +1312,7 @@ mod tests { } let inp: io::Reader = result::get(&io::file_reader(tmpfile)); let frood2: ~str = inp.read_c_str(); - log(debug, copy frood2); + debug!(copy frood2); fail_unless!(frood == frood2); } diff --git a/src/libcore/os.rs b/src/libcore/os.rs index aa4a6feb76f71..86ea7a491fc63 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -208,8 +208,8 @@ pub fn env() -> ~[(~str,~str)] { let mut result = ~[]; ptr::array_each(environ, |e| { let env_pair = str::raw::from_c_str(e); - log(debug, fmt!("get_env_pairs: %s", - env_pair)); + debug!("get_env_pairs: %s", + env_pair); result.push(env_pair); }); result @@ -219,9 +219,8 @@ pub fn env() -> ~[(~str,~str)] { let mut pairs = ~[]; for input.each |p| { let vs = str::splitn_char(*p, '=', 1); - log(debug, - fmt!("splitting: len: %u", - vs.len())); + debug!("splitting: len: %u", + vs.len()); fail_unless!(vs.len() == 2); pairs.push((copy vs[0], copy vs[1])); } @@ -682,10 +681,10 @@ pub fn list_dir(p: &Path) -> ~[~str] { let input = p.to_str(); let mut strings = ~[]; let input_ptr = ::cast::transmute(&input[0]); - log(debug, "os::list_dir -- BEFORE OPENDIR"); + debug!("os::list_dir -- BEFORE OPENDIR"); let dir_ptr = opendir(input_ptr); if (dir_ptr as uint != 0) { - log(debug, "os::list_dir -- opendir() SUCCESS"); + debug!("os::list_dir -- opendir() SUCCESS"); let mut entry_ptr = readdir(dir_ptr); while (entry_ptr as uint != 0) { strings.push( @@ -697,11 +696,11 @@ pub fn list_dir(p: &Path) -> ~[~str] { closedir(dir_ptr); } else { - log(debug, "os::list_dir -- opendir() FAILURE"); + debug!("os::list_dir -- opendir() FAILURE"); } - log(debug, - fmt!("os::list_dir -- AFTER -- #: %?", - strings.len())); + debug!( + "os::list_dir -- AFTER -- #: %?", + strings.len()); strings } #[cfg(windows)] @@ -1258,7 +1257,6 @@ pub mod consts { #[cfg(test)] #[allow(non_implicitly_copyable_typarams)] mod tests { - use debug; use libc::{c_int, c_void, size_t}; use libc; use option::{None, Option, Some}; @@ -1274,7 +1272,7 @@ mod tests { #[test] pub fn last_os_error() { - log(debug, os::last_os_error()); + debug!(os::last_os_error()); } #[test] @@ -1320,7 +1318,7 @@ mod tests { while i < 100 { s += ~"aaaaaaaaaa"; i += 1; } let n = make_rand_name(); setenv(n, s); - log(debug, copy s); + debug!(copy s); fail_unless!(getenv(n) == option::Some(s)); } @@ -1329,7 +1327,7 @@ mod tests { let path = os::self_exe_path(); fail_unless!(path.is_some()); let path = path.get(); - log(debug, copy path); + debug!(copy path); // Hard to test this function fail_unless!(path.is_absolute); @@ -1342,7 +1340,7 @@ mod tests { fail_unless!(vec::len(e) > 0u); for vec::each(e) |p| { let (n, v) = copy *p; - log(debug, copy n); + debug!(copy n); let v2 = getenv(n); // MingW seems to set some funky environment variables like // "=C:=C:\MinGW\msys\1.0\bin" and "!::=::\" that are returned @@ -1367,10 +1365,10 @@ mod tests { fn test() { fail_unless!((!Path("test-path").is_absolute)); - log(debug, ~"Current working directory: " + getcwd().to_str()); + debug!(~"Current working directory: " + getcwd().to_str()); - log(debug, make_absolute(&Path("test-path"))); - log(debug, make_absolute(&Path("/usr/bin"))); + debug!(make_absolute(&Path("test-path"))); + debug!(make_absolute(&Path("/usr/bin"))); } #[test] @@ -1433,7 +1431,7 @@ mod tests { fail_unless!((vec::len(dirs) > 0u)); for vec::each(dirs) |dir| { - log(debug, copy *dir); + debug!(copy *dir); } } diff --git a/src/libcore/prelude.rs b/src/libcore/prelude.rs index 2f575ce7d2811..c5b1b9eb87593 100644 --- a/src/libcore/prelude.rs +++ b/src/libcore/prelude.rs @@ -82,18 +82,3 @@ pub use u64; pub use u8; pub use uint; pub use vec; - -/* - * Export the log levels as global constants. Higher levels mean - * more-verbosity. Error is the bottom level, default logging level is - * warn-and-below. - */ - -/// The error log level -pub const error : u32 = 1_u32; -/// The warning log level -pub const warn : u32 = 2_u32; -/// The info log level -pub const info : u32 = 3_u32; -/// The debug log level -pub const debug : u32 = 4_u32; diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index ace70d7f061d3..e6e312d01b9f8 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -19,7 +19,6 @@ use sys; #[cfg(test)] use vec; #[cfg(test)] use str; #[cfg(notest)] use cmp::{Eq, Ord}; -use debug; use uint; pub mod libc_ { @@ -191,7 +190,7 @@ pub pure fn ref_eq(thing: &a/T, other: &b/T) -> bool { SAFETY NOTE: Pointer-arithmetic. Dragons be here. */ pub unsafe fn array_each_with_len(arr: **T, len: uint, cb: &fn(*T)) { - log(debug, "array_each_with_len: before iterate"); + debug!("array_each_with_len: before iterate"); if (arr as uint == 0) { fail!(~"ptr::array_each_with_len failure: arr input is null pointer"); } @@ -201,7 +200,7 @@ pub unsafe fn array_each_with_len(arr: **T, len: uint, cb: &fn(*T)) { cb(*n); true }); - log(debug, "array_each_with_len: after iterate"); + debug!("array_each_with_len: after iterate"); } /** @@ -218,8 +217,8 @@ pub unsafe fn array_each(arr: **T, cb: &fn(*T)) { fail!(~"ptr::array_each_with_len failure: arr input is null pointer"); } let len = buf_len(arr); - log(debug, fmt!("array_each inferred len: %u", - len)); + debug!("array_each inferred len: %u", + len); array_each_with_len(arr, len, cb); } @@ -434,7 +433,6 @@ pub fn test_is_null() { #[cfg(test)] pub mod ptr_tests { - use debug; use ptr; use str; use libc; @@ -460,9 +458,9 @@ pub mod ptr_tests { |e| { let actual = str::raw::from_c_str(e); let expected = copy expected_arr[ctr]; - log(debug, - fmt!("test_ptr_array_each e: %s, a: %s", - expected, actual)); + debug!( + "test_ptr_array_each e: %s, a: %s", + expected, actual); fail_unless!(actual == expected); ctr += 1; iteration_count += 1; @@ -492,9 +490,9 @@ pub mod ptr_tests { ptr::array_each(arr_ptr, |e| { let actual = str::raw::from_c_str(e); let expected = copy expected_arr[ctr]; - log(debug, - fmt!("test_ptr_array_each e: %s, a: %s", - expected, actual)); + debug!( + "test_ptr_array_each e: %s, a: %s", + expected, actual); fail_unless!(actual == expected); ctr += 1; iteration_count += 1; diff --git a/src/libcore/rand.rs b/src/libcore/rand.rs index cf90edf86f421..7668513a3ca70 100644 --- a/src/libcore/rand.rs +++ b/src/libcore/rand.rs @@ -494,7 +494,6 @@ pub fn random() -> uint { #[cfg(test)] pub mod tests { - use debug; use option::{None, Option, Some}; use rand; @@ -563,7 +562,7 @@ pub mod tests { let r = rand::Rng(); let a = r.gen_float(); let b = r.gen_float(); - log(debug, (a, b)); + debug!((a, b)); } #[test] @@ -576,9 +575,9 @@ pub mod tests { #[test] pub fn gen_str() { let r = rand::Rng(); - log(debug, r.gen_str(10u)); - log(debug, r.gen_str(10u)); - log(debug, r.gen_str(10u)); + debug!(r.gen_str(10u)); + debug!(r.gen_str(10u)); + debug!(r.gen_str(10u)); fail_unless!(r.gen_str(0u).len() == 0u); fail_unless!(r.gen_str(10u).len() == 10u); fail_unless!(r.gen_str(16u).len() == 16u); diff --git a/src/libcore/run.rs b/src/libcore/run.rs index a9d96d891c944..0d027ba116321 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -458,7 +458,6 @@ pub fn waitpid(pid: pid_t) -> int { #[cfg(test)] mod tests { - use debug; use option::{None, Some}; use os; use run::{readclose, writeclose}; @@ -494,8 +493,8 @@ mod tests { readclose(pipe_err.in); os::waitpid(pid); - log(debug, copy expected); - log(debug, copy actual); + debug!(copy expected); + debug!(copy actual); fail_unless!((expected == actual)); } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index ae778cb7649b7..4163679a98d74 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -2437,7 +2437,6 @@ impl OwnedStr for ~str { mod tests { use char; use option::Some; - use debug; use libc::c_char; use libc; use ptr; @@ -2523,7 +2522,7 @@ mod tests { #[test] fn test_split_char() { fn t(s: &str, c: char, u: &[~str]) { - log(debug, ~"split_byte: " + s); + debug!(~"split_byte: " + s); let v = split_char(s, c); debug!("split_byte to: %?", v); fail_unless!(vec::all2(v, u, |a,b| a == b)); @@ -2552,7 +2551,7 @@ mod tests { #[test] fn test_splitn_char() { fn t(s: &str, c: char, n: uint, u: &[~str]) { - log(debug, ~"splitn_byte: " + s); + debug!(~"splitn_byte: " + s); let v = splitn_char(s, c, n); debug!("split_byte to: %?", v); debug!("comparing vs. %?", u); @@ -3192,8 +3191,8 @@ mod tests { while i < n1 { let a: u8 = s1[i]; let b: u8 = s2[i]; - log(debug, a); - log(debug, b); + debug!(a); + debug!(b); fail_unless!((a == b)); i += 1u; } diff --git a/src/libcore/unstable/uvll.rs b/src/libcore/unstable/uvll.rs index 0aed2567a220f..80f04cf4ac0c1 100644 --- a/src/libcore/unstable/uvll.rs +++ b/src/libcore/unstable/uvll.rs @@ -930,8 +930,8 @@ pub unsafe fn tcp_connect(connect_ptr: *uv_connect_t, addr_ptr: *sockaddr_in, after_connect_cb: *u8) -> libc::c_int { - log(debug, fmt!("b4 foreign tcp_connect--addr port: %u cb: %u", - (*addr_ptr).sin_port as uint, after_connect_cb as uint)); + debug!("b4 foreign tcp_connect--addr port: %u cb: %u", + (*addr_ptr).sin_port as uint, after_connect_cb as uint); return rustrt::rust_uv_tcp_connect(connect_ptr, tcp_handle_ptr, after_connect_cb, addr_ptr); } @@ -1021,20 +1021,20 @@ pub unsafe fn async_send(async_handle: *uv_async_t) { pub unsafe fn buf_init(input: *u8, len: uint) -> uv_buf_t { let out_buf = uv_buf_t { base: ptr::null(), len: 0 as libc::size_t }; let out_buf_ptr = ptr::addr_of(&out_buf); - log(debug, fmt!("buf_init - input %u len %u out_buf: %u", + debug!("buf_init - input %u len %u out_buf: %u", input as uint, len as uint, - out_buf_ptr as uint)); + out_buf_ptr as uint); // yuck :/ rustrt::rust_uv_buf_init(out_buf_ptr, input, len as size_t); //let result = rustrt::rust_uv_buf_init_2(input, len as size_t); - log(debug, ~"after rust_uv_buf_init"); + debug!("after rust_uv_buf_init"); let res_base = get_base_from_buf(out_buf); let res_len = get_len_from_buf(out_buf); //let res_base = get_base_from_buf(result); - log(debug, fmt!("buf_init - result %u len %u", + debug!("buf_init - result %u len %u", res_base as uint, - res_len as uint)); + res_len as uint); return out_buf; //return result; } @@ -1078,8 +1078,8 @@ pub unsafe fn ip6_name(src: &sockaddr_in6) -> ~str { 0u8,0u8,0u8,0u8,0u8,0u8]; do vec::as_imm_buf(dst) |dst_buf, size| { let src_unsafe_ptr = to_unsafe_ptr(src); - log(debug, fmt!("val of src *sockaddr_in6: %? sockaddr_in6: %?", - src_unsafe_ptr, src)); + debug!("val of src *sockaddr_in6: %? sockaddr_in6: %?", + src_unsafe_ptr, src); let result = rustrt::rust_uv_ip6_name(src_unsafe_ptr, dst_buf, size as libc::size_t); match result { @@ -1257,20 +1257,20 @@ pub mod test { } extern fn after_close_cb(handle: *libc::c_void) { - log(debug, fmt!("after uv_close! handle ptr: %?", - handle)); + debug!("after uv_close! handle ptr: %?", + handle); } extern fn on_alloc_cb(handle: *libc::c_void, suggested_size: libc::size_t) -> uv_buf_t { unsafe { - log(debug, ~"on_alloc_cb!"); + debug!("on_alloc_cb!"); let char_ptr = malloc_buf_base_of(suggested_size); - log(debug, fmt!("on_alloc_cb h: %? char_ptr: %u sugsize: %u", + debug!("on_alloc_cb h: %? char_ptr: %u sugsize: %u", handle, char_ptr as uint, - suggested_size as uint)); + suggested_size as uint); return buf_init(char_ptr, suggested_size as uint); } } @@ -1280,11 +1280,11 @@ pub mod test { ++buf: uv_buf_t) { unsafe { let nread = nread as int; - log(debug, fmt!("CLIENT entering on_read_cb nred: %d", - nread)); + debug!("CLIENT entering on_read_cb nred: %d", + nread); if (nread > 0) { // we have data - log(debug, fmt!("CLIENT read: data! nread: %d", nread)); + debug!("CLIENT read: data! nread: %d", nread); read_stop(stream); let client_data = get_data_for_uv_handle(stream as *libc::c_void) @@ -1298,65 +1298,65 @@ pub mod test { } else if (nread == -1) { // err .. possibly EOF - log(debug, ~"read: eof!"); + debug!("read: eof!"); } else { // nread == 0 .. do nothing, just free buf as below - log(debug, ~"read: do nothing!"); + debug!("read: do nothing!"); } // when we're done free_base_of_buf(buf); - log(debug, ~"CLIENT exiting on_read_cb"); + debug!("CLIENT exiting on_read_cb"); } } extern fn on_write_complete_cb(write_req: *uv_write_t, status: libc::c_int) { unsafe { - log(debug, - fmt!("CLIENT beginning on_write_complete_cb status: %d", - status as int)); + debug!( + "CLIENT beginning on_write_complete_cb status: %d", + status as int); let stream = get_stream_handle_from_write_req(write_req); - log(debug, - fmt!("CLIENT on_write_complete_cb: tcp:%d write_handle:%d", - stream as int, write_req as int)); + debug!( + "CLIENT on_write_complete_cb: tcp:%d write_handle:%d", + stream as int, write_req as int); let result = read_start(stream, on_alloc_cb, on_read_cb); - log(debug, - fmt!("CLIENT ending on_write_complete_cb .. status: %d", - result as int)); + debug!( + "CLIENT ending on_write_complete_cb .. status: %d", + result as int); } } extern fn on_connect_cb(connect_req_ptr: *uv_connect_t, status: libc::c_int) { unsafe { - log(debug, fmt!("beginning on_connect_cb .. status: %d", - status as int)); + debug!("beginning on_connect_cb .. status: %d", + status as int); let stream = get_stream_handle_from_connect_req(connect_req_ptr); if (status == 0i32) { - log(debug, ~"on_connect_cb: in status=0 if.."); + debug!("on_connect_cb: in status=0 if.."); let client_data = get_data_for_req( connect_req_ptr as *libc::c_void) as *request_wrapper; let write_handle = (*client_data).write_req; - log(debug, fmt!("on_connect_cb: tcp: %d write_hdl: %d", - stream as int, write_handle as int)); + debug!("on_connect_cb: tcp: %d write_hdl: %d", + stream as int, write_handle as int); let write_result = write(write_handle, stream as *libc::c_void, (*client_data).req_buf, on_write_complete_cb); - log(debug, fmt!("on_connect_cb: write() status: %d", - write_result as int)); + debug!("on_connect_cb: write() status: %d", + write_result as int); } else { let test_loop = get_loop_for_uv_handle( stream as *libc::c_void); let err_msg = get_last_err_info(test_loop); - log(debug, err_msg); + debug!("%?", err_msg); fail_unless!(false); } - log(debug, ~"finishing on_connect_cb"); + debug!("finishing on_connect_cb"); } } @@ -1376,7 +1376,7 @@ pub mod test { // data field in our uv_connect_t struct let req_str_bytes = str::to_bytes(req_str); let req_msg_ptr: *u8 = vec::raw::to_ptr(req_str_bytes); - log(debug, fmt!("req_msg ptr: %u", req_msg_ptr as uint)); + debug!("req_msg ptr: %u", req_msg_ptr as uint); let req_msg = ~[ buf_init(req_msg_ptr, vec::len(req_str_bytes)) ]; @@ -1384,9 +1384,9 @@ pub mod test { // this to C.. let write_handle = write_t(); let write_handle_ptr = ptr::addr_of(&write_handle); - log(debug, fmt!("tcp req: tcp stream: %d write_handle: %d", + debug!("tcp req: tcp stream: %d write_handle: %d", tcp_handle_ptr as int, - write_handle_ptr as int)); + write_handle_ptr as int); let client_data = request_wrapper { write_req: write_handle_ptr, req_buf: ptr::addr_of(&req_msg), @@ -1396,18 +1396,18 @@ pub mod test { let tcp_init_result = tcp_init( test_loop as *libc::c_void, tcp_handle_ptr); if (tcp_init_result == 0i32) { - log(debug, ~"sucessful tcp_init_result"); + debug!("sucessful tcp_init_result"); - log(debug, ~"building addr..."); + debug!("building addr..."); let addr = ip4_addr(ip, port); // FIXME ref #2064 let addr_ptr = ptr::addr_of(&addr); - log(debug, fmt!("after build addr in rust. port: %u", - addr.sin_port as uint)); + debug!("after build addr in rust. port: %u", + addr.sin_port as uint); // this should set up the connection request.. - log(debug, fmt!("b4 call tcp_connect connect cb: %u ", - on_connect_cb as uint)); + debug!("b4 call tcp_connect connect cb: %u ", + on_connect_cb as uint); let tcp_connect_result = tcp_connect( connect_req_ptr, tcp_handle_ptr, addr_ptr, on_connect_cb); @@ -1420,17 +1420,17 @@ pub mod test { set_data_for_uv_handle( tcp_handle_ptr as *libc::c_void, ptr::addr_of(&client_data) as *libc::c_void); - log(debug, ~"before run tcp req loop"); + debug!("before run tcp req loop"); run(test_loop); - log(debug, ~"after run tcp req loop"); + debug!("after run tcp req loop"); } else { - log(debug, ~"tcp_connect() failure"); + debug!("tcp_connect() failure"); fail_unless!(false); } } else { - log(debug, ~"tcp_init() failure"); + debug!("tcp_init() failure"); fail_unless!(false); } loop_delete(test_loop); @@ -1439,15 +1439,15 @@ pub mod test { extern fn server_after_close_cb(handle: *libc::c_void) { unsafe { - log(debug, fmt!("SERVER server stream closed, should exit. h: %?", - handle)); + debug!("SERVER server stream closed, should exit. h: %?", + handle); } } extern fn client_stream_after_close_cb(handle: *libc::c_void) { unsafe { - log(debug, - ~"SERVER: closed client stream, now closing server stream"); + debug!( + "SERVER: closed client stream, now closing server stream"); let client_data = get_data_for_uv_handle( handle) as *tcp_server_data; @@ -1460,7 +1460,7 @@ pub mod test { unsafe { let client_stream_ptr = get_stream_handle_from_write_req(req); - log(debug, ~"SERVER: resp sent... closing client stream"); + debug!("SERVER: resp sent... closing client stream"); close(client_stream_ptr as *libc::c_void, client_stream_after_close_cb) } @@ -1473,15 +1473,15 @@ pub mod test { let nread = nread as int; if (nread > 0) { // we have data - log(debug, fmt!("SERVER read: data! nread: %d", nread)); + debug!("SERVER read: data! nread: %d", nread); // pull out the contents of the write from the client let buf_base = get_base_from_buf(buf); let buf_len = get_len_from_buf(buf) as uint; - log(debug, fmt!("SERVER buf base: %u, len: %u, nread: %d", + debug!("SERVER buf base: %u, len: %u, nread: %d", buf_base as uint, buf_len as uint, - nread)); + nread); let bytes = vec::from_buf(buf_base, nread as uint); let request_str = str::from_bytes(bytes); @@ -1491,8 +1491,8 @@ pub mod test { let server_kill_msg = copy (*client_data).server_kill_msg; let write_req = (*client_data).server_write_req; if str::contains(request_str, server_kill_msg) { - log(debug, ~"SERVER: client req contains kill_msg!"); - log(debug, ~"SERVER: sending response to client"); + debug!("SERVER: client req contains kill_msg!"); + debug!("SERVER: sending response to client"); read_stop(client_stream_ptr); let server_chan = (*client_data).server_chan.clone(); server_chan.send(request_str); @@ -1501,31 +1501,31 @@ pub mod test { client_stream_ptr as *libc::c_void, (*client_data).server_resp_buf, after_server_resp_write); - log(debug, fmt!("SERVER: resp write result: %d", - write_result as int)); + debug!("SERVER: resp write result: %d", + write_result as int); if (write_result != 0i32) { - log(debug, ~"bad result for server resp write()"); - log(debug, get_last_err_info( + debug!("bad result for server resp write()"); + debug!("%s", get_last_err_info( get_loop_for_uv_handle(client_stream_ptr as *libc::c_void))); fail_unless!(false); } } else { - log(debug, ~"SERVER: client req !contain kill_msg!"); + debug!("SERVER: client req !contain kill_msg!"); } } else if (nread == -1) { // err .. possibly EOF - log(debug, ~"read: eof!"); + debug!("read: eof!"); } else { // nread == 0 .. do nothing, just free buf as below - log(debug, ~"read: do nothing!"); + debug!("read: do nothing!"); } // when we're done free_base_of_buf(buf); - log(debug, ~"SERVER exiting on_read_cb"); + debug!("SERVER exiting on_read_cb"); } } @@ -1533,13 +1533,13 @@ pub mod test { *uv_stream_t, status: libc::c_int) { unsafe { - log(debug, ~"client connecting!"); + debug!("client connecting!"); let test_loop = get_loop_for_uv_handle( server_stream_ptr as *libc::c_void); if status != 0i32 { let err_msg = get_last_err_info(test_loop); - log(debug, fmt!("server_connect_cb: non-zero status: %?", - err_msg)); + debug!("server_connect_cb: non-zero status: %?", + err_msg); return; } let server_data = get_data_for_uv_handle( @@ -1551,7 +1551,7 @@ pub mod test { client_stream_ptr as *libc::c_void, server_data as *libc::c_void); if (client_init_result == 0i32) { - log(debug, ~"successfully initialized client stream"); + debug!("successfully initialized client stream"); let accept_result = accept(server_stream_ptr as *libc::c_void, client_stream_ptr as @@ -1563,23 +1563,23 @@ pub mod test { on_alloc_cb, on_server_read_cb); if (read_result == 0i32) { - log(debug, ~"successful server read start"); + debug!("successful server read start"); } else { - log(debug, fmt!("server_connection_cb: bad read:%d", - read_result as int)); + debug!("server_connection_cb: bad read:%d", + read_result as int); fail_unless!(false); } } else { - log(debug, fmt!("server_connection_cb: bad accept: %d", - accept_result as int)); + debug!("server_connection_cb: bad accept: %d", + accept_result as int); fail_unless!(false); } } else { - log(debug, fmt!("server_connection_cb: bad client init: %d", - client_init_result as int)); + debug!("server_connection_cb: bad client init: %d", + client_init_result as int); fail_unless!(false); } } @@ -1599,8 +1599,8 @@ pub mod test { } extern fn async_close_cb(handle: *libc::c_void) { - log(debug, fmt!("SERVER: closing async cb... h: %?", - handle)); + debug!("SERVER: closing async cb... h: %?", + handle); } extern fn continue_async_cb(async_handle: *uv_async_t, @@ -1638,7 +1638,7 @@ pub mod test { let resp_str_bytes = str::to_bytes(server_resp_msg); let resp_msg_ptr: *u8 = vec::raw::to_ptr(resp_str_bytes); - log(debug, fmt!("resp_msg ptr: %u", resp_msg_ptr as uint)); + debug!("resp_msg ptr: %u", resp_msg_ptr as uint); let resp_msg = ~[ buf_init(resp_msg_ptr, vec::len(resp_str_bytes)) ]; @@ -1674,7 +1674,7 @@ pub mod test { let bind_result = tcp_bind(tcp_server_ptr, server_addr_ptr); if (bind_result == 0i32) { - log(debug, ~"successful uv_tcp_bind, listening"); + debug!("successful uv_tcp_bind, listening"); // uv_listen() let listen_result = listen(tcp_server_ptr as @@ -1694,29 +1694,29 @@ pub mod test { async_send(continue_async_handle_ptr); // uv_run() run(test_loop); - log(debug, ~"server uv::run() has returned"); + debug!("server uv::run() has returned"); } else { - log(debug, fmt!("uv_async_init failure: %d", - async_result as int)); + debug!("uv_async_init failure: %d", + async_result as int); fail_unless!(false); } } else { - log(debug, fmt!("non-zero result on uv_listen: %d", - listen_result as int)); + debug!("non-zero result on uv_listen: %d", + listen_result as int); fail_unless!(false); } } else { - log(debug, fmt!("non-zero result on uv_tcp_bind: %d", - bind_result as int)); + debug!("non-zero result on uv_tcp_bind: %d", + bind_result as int); fail_unless!(false); } } else { - log(debug, fmt!("non-zero result on uv_tcp_init: %d", - tcp_init_result as int)); + debug!("non-zero result on uv_tcp_init: %d", + tcp_init_result as int); fail_unless!(false); } loop_delete(test_loop); @@ -1751,9 +1751,9 @@ pub mod test { }; // block until the server up is.. possibly a race? - log(debug, ~"before receiving on server continue_port"); + debug!("before receiving on server continue_port"); continue_port.recv(); - log(debug, ~"received on continue port, set up tcp client"); + debug!("received on continue port, set up tcp client"); let kill_server_msg_copy = copy kill_server_msg; do task::spawn_sched(task::ManualThreads(1u)) { @@ -1808,7 +1808,7 @@ pub mod test { let output = fmt!( "STRUCT_SIZE FAILURE: %s -- actual: %u expected: %u", t_name, rust_size, foreign_size as uint); - log(debug, output); + debug!("%s", output); } fail_unless!(sizes_match); } @@ -1869,7 +1869,7 @@ pub mod test { let rust_handle_size = sys::size_of::(); let output = fmt!("sockaddr_in6 -- foreign: %u rust: %u", foreign_handle_size as uint, rust_handle_size); - log(debug, output); + debug!(output); // FIXME #1645 .. rust appears to pad structs to the nearest // byte..? // .. can't get the uv::ll::sockaddr_in6 to == 28 :/ @@ -1888,7 +1888,7 @@ pub mod test { let rust_handle_size = sys::size_of::(); let output = fmt!("addr_in -- foreign: %u rust: %u", foreign_handle_size as uint, rust_handle_size); - log(debug, output); + debug!(output); // FIXME #1645 .. see note above about struct padding fail_unless!((4u+foreign_handle_size as uint) == rust_handle_size); diff --git a/src/libfuzzer/fuzzer.rc b/src/libfuzzer/fuzzer.rc index 90ada832327f4..b1379b9ab36ab 100644 --- a/src/libfuzzer/fuzzer.rc +++ b/src/libfuzzer/fuzzer.rc @@ -289,10 +289,10 @@ pub fn check_variants_T( if L < 100 { do under(uint::min(L, 20)) |i| { - log(error, ~"Replacing... #" + uint::to_str(i)); + error!("Replacing... #%?", uint::to_str(i)); let fname = str::from_slice(filename.to_str()); do under(uint::min(L, 30)) |j| { - log(error, ~"With... " + stringifier(@things[j], intr)); + error!("With... %?", stringifier(@things[j], intr)); let crate2 = @replacer(crate, i, things[j], cx.mode); // It would be best to test the *crate* for stability, but // testing the string for stability is easier and ok for now. @@ -363,8 +363,8 @@ pub fn check_whole_compiler(code: ~str, suggested_filename_prefix: &Path, removeDirIfExists(&suggested_filename_prefix.with_filetype("dSYM")); } failed(s) => { - log(error, ~"check_whole_compiler failure: " + s); - log(error, ~"Saved as: " + filename.to_str()); + error!("check_whole_compiler failure: %?", s); + error!("Saved as: %?", filename.to_str()); } } } @@ -387,7 +387,7 @@ pub fn check_running(exe_filename: &Path) -> happiness { ~[exe_filename.to_str()]); let comb = p.out + ~"\n" + p.err; if str::len(comb) > 1u { - log(error, ~"comb comb comb: " + comb); + error!("comb comb comb: %?", comb); } if contains(comb, ~"Assertion failed:") { @@ -433,21 +433,21 @@ pub fn check_compiling(filename: &Path) -> happiness { if contains(p.err, ~"error:") { cleanly_rejected(~"rejected with span_error") } else { - log(error, ~"Stderr: " + p.err); + error!("Stderr: %?", p.err); failed(~"Unfamiliar error message") } } else if contains(p.out, ~"Assertion") && contains(p.out, ~"failed") { - log(error, ~"Stdout: " + p.out); + error!("Stdout: %?", p.out); failed(~"Looks like an llvm assertion failure") } else if contains(p.out, ~"internal compiler error unimplemented") { known_bug(~"Something unimplemented") } else if contains(p.out, ~"internal compiler error") { - log(error, ~"Stdout: " + p.out); + error!("Stdout: %?", p.out); failed(~"internal compiler error") } else { - log(error, p.status); - log(error, ~"!Stdout: " + p.out); + error!("%?", p.status); + error!("!Stdout: %?", p.out); failed(~"What happened?") } } @@ -609,7 +609,7 @@ pub fn check_variants(files: &[Path], cx: Context) { let file_str = file.to_str(); - log(error, ~"check_variants: " + file_str); + error!("check_variants: %?", file_str); let sess = parse::new_parse_sess(option::None); let crate = parse::parse_crate_from_source_str( diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index fec3f77668137..40cb70764304b 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -758,7 +758,7 @@ pub fn link_binary(sess: Session, /*bad*/copy *out_filename }; - log(debug, ~"output: " + output.to_str()); + debug!("output: %s", output.to_str()); // The default library location, we need this to find the runtime. // The location of crates will be determined as needed. diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs index d4ed0004c8f9b..ac315a36e4034 100644 --- a/src/librustc/middle/trans/base.rs +++ b/src/librustc/middle/trans/base.rs @@ -803,12 +803,12 @@ pub fn invoke(bcx: block, llfn: ValueRef, +llargs: ~[ValueRef]) -> block { let _icx = bcx.insn_ctxt("invoke_"); if bcx.unreachable { return bcx; } if need_invoke(bcx) { - log(debug, ~"invoking"); + debug!("invoking"); let normal_bcx = sub_block(bcx, ~"normal return"); Invoke(bcx, llfn, llargs, normal_bcx.llbb, get_landing_pad(bcx)); return normal_bcx; } else { - log(debug, ~"calling"); + debug!("calling"); Call(bcx, llfn, llargs); return bcx; } @@ -1487,7 +1487,7 @@ pub fn alloc_ty(bcx: block, t: ty::t) -> ValueRef { let _icx = bcx.insn_ctxt("alloc_ty"); let ccx = bcx.ccx(); let llty = type_of::type_of(ccx, t); - if ty::type_has_params(t) { log(error, ty_to_str(ccx.tcx, t)); } + if ty::type_has_params(t) { error!("%s", ty_to_str(ccx.tcx, t)); } fail_unless!(!ty::type_has_params(t)); let val = alloca(bcx, llty); return val; diff --git a/src/librustc/middle/trans/build.rs b/src/librustc/middle/trans/build.rs index 45104480b4c9d..4c9eb4ada35f1 100644 --- a/src/librustc/middle/trans/build.rs +++ b/src/librustc/middle/trans/build.rs @@ -848,7 +848,7 @@ pub fn add_span_comment(bcx: block, sp: span, text: &str) { let ccx = bcx.ccx(); if !ccx.sess.no_asm_comments() { let s = fmt!("%s (%s)", text, ccx.sess.codemap.span_to_str(sp)); - log(debug, copy s); + debug!("%s", copy s); add_comment(bcx, s); } } diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index af54d4734314c..a08bc0ba9fb42 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -806,10 +806,10 @@ pub fn create_function(fcx: fn_ctxt) -> @Metadata { let dbg_cx = (/*bad*/copy cx.dbg_cx).get(); debug!("~~"); - log(debug, fcx.id); + debug!("%?", fcx.id); let sp = fcx.span.get(); - log(debug, cx.sess.codemap.span_to_str(sp)); + debug!("%s", cx.sess.codemap.span_to_str(sp)); let (ident, ret_ty, id) = match cx.tcx.items.get(&fcx.id) { ast_map::node_item(item, _) => { @@ -841,8 +841,8 @@ pub fn create_function(fcx: fn_ctxt) -> @Metadata { sort of node") }; - log(debug, ident); - log(debug, id); + debug!("%?", ident); + debug!("%?", id); let cache = get_cache(cx); match cached_metadata::<@Metadata>( diff --git a/src/librustc/middle/trans/glue.rs b/src/librustc/middle/trans/glue.rs index 7f860bc0c8556..b3905680f721b 100644 --- a/src/librustc/middle/trans/glue.rs +++ b/src/librustc/middle/trans/glue.rs @@ -708,7 +708,7 @@ pub fn declare_tydesc(ccx: @CrateContext, t: ty::t) -> @mut tydesc_info { free_glue: None, visit_glue: None }; - log(debug, ~"--- declare_tydesc " + ppaux::ty_to_str(ccx.tcx, t)); + debug!("--- declare_tydesc %s", ppaux::ty_to_str(ccx.tcx, t)); return inf; } diff --git a/src/librustdoc/demo.rs b/src/librustdoc/demo.rs index 6a3a509ded444..ad57af8942d35 100644 --- a/src/librustdoc/demo.rs +++ b/src/librustdoc/demo.rs @@ -128,7 +128,7 @@ struct Bored { } impl Drop for Bored { - fn finalize(&self) { log(error, self.bored); } + fn finalize(&self) { } } /** diff --git a/src/librustdoc/pass.rs b/src/librustdoc/pass.rs index 7b80b0b4ae8c9..e71b145d7df97 100644 --- a/src/librustdoc/pass.rs +++ b/src/librustdoc/pass.rs @@ -31,7 +31,7 @@ pub fn run_passes( ) -> doc::Doc { let mut passno = 0; do vec::foldl(doc, passes) |doc, pass| { - log(debug, fmt!("pass #%d", passno)); + debug!("pass #%d", passno); passno += 1; do time(copy pass.name) { (pass.f)(srv.clone(), copy doc) diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index d7d878fa192dd..b91af9a006903 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -509,7 +509,7 @@ mod tests { fail_unless!((*arc::get(&arc_v))[2] == 3); - log(info, arc_v); + info!(arc_v); } #[test] diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index 33b0fd4eb6819..b1ba838865dd8 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -116,7 +116,6 @@ mod tests { use super::*; use core::cmp::Eq; use core::kinds::{Durable, Copy}; - use core::prelude::debug; #[test] fn test_simple() { @@ -128,21 +127,21 @@ mod tests { fail_unless!(d.len() == 3u); d.add_back(137); fail_unless!(d.len() == 4u); - log(debug, d.peek_front()); + debug!(d.peek_front()); fail_unless!(*d.peek_front() == 42); - log(debug, d.peek_back()); + debug!(d.peek_back()); fail_unless!(*d.peek_back() == 137); let mut i: int = d.pop_front(); - log(debug, i); + debug!(i); fail_unless!(i == 42); i = d.pop_back(); - log(debug, i); + debug!(i); fail_unless!(i == 137); i = d.pop_back(); - log(debug, i); + debug!(i); fail_unless!(i == 137); i = d.pop_back(); - log(debug, i); + debug!(i); fail_unless!(i == 17); fail_unless!(d.len() == 0u); d.add_back(3); @@ -153,10 +152,10 @@ mod tests { fail_unless!(d.len() == 3u); d.add_front(1); fail_unless!(d.len() == 4u); - log(debug, d.get(0)); - log(debug, d.get(1)); - log(debug, d.get(2)); - log(debug, d.get(3)); + debug!(d.get(0)); + debug!(d.get(1)); + debug!(d.get(2)); + debug!(d.get(3)); fail_unless!(*d.get(0) == 1); fail_unless!(*d.get(1) == 2); fail_unless!(*d.get(2) == 3); diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index eed00ccacffcc..4cf60695266dd 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -881,7 +881,7 @@ mod tests { let rs = getopts(args, opts); match rs { Err(copy f) => { - log(error, fail_str(f)); + error!(fail_str(f)); check_fail_type(f, UnexpectedArgument_); } _ => fail!() diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs index a5e689077738b..04283674d88be 100644 --- a/src/libstd/net_ip.rs +++ b/src/libstd/net_ip.rs @@ -117,7 +117,7 @@ pub fn get_addr(node: &str, iotask: &iotask) do str::as_buf(node) |node_ptr, len| { let output_ch = output_ch.swap_unwrap(); unsafe { - log(debug, fmt!("slice len %?", len)); + debug!("slice len %?", len); let handle = create_uv_getaddrinfo_t(); let handle_ptr = ptr::addr_of(&handle); let handle_data = GetAddrData { @@ -228,8 +228,8 @@ pub mod v4 { let new_addr = uv_ip4_addr(str::from_slice(ip), 22); let reformatted_name = uv_ip4_name(&new_addr); - log(debug, fmt!("try_parse_addr: input ip: %s reparsed ip: %s", - ip, reformatted_name)); + debug!("try_parse_addr: input ip: %s reparsed ip: %s", + ip, reformatted_name); let ref_ip_rep_result = parse_to_ipv4_rep(reformatted_name); if result::is_err(&ref_ip_rep_result) { let err_str = result::get_err(&ref_ip_rep_result); @@ -282,8 +282,8 @@ pub mod v6 { // need to figure out how to establish a parse failure.. let new_addr = uv_ip6_addr(str::from_slice(ip), 22); let reparsed_name = uv_ip6_name(&new_addr); - log(debug, fmt!("v6::try_parse_addr ip: '%s' reparsed '%s'", - ip, reparsed_name)); + debug!("v6::try_parse_addr ip: '%s' reparsed '%s'", + ip, reparsed_name); // '::' appears to be uv_ip6_name() returns for bogus // parses.. if ip != &"::" && reparsed_name == ~"::" { @@ -303,14 +303,14 @@ struct GetAddrData { extern fn get_addr_cb(handle: *uv_getaddrinfo_t, status: libc::c_int, res: *addrinfo) { unsafe { - log(debug, ~"in get_addr_cb"); + debug!("in get_addr_cb"); let handle_data = get_data_for_req(handle) as *GetAddrData; let output_ch = (*handle_data).output_ch.clone(); if status == 0i32 { if res != (ptr::null::()) { let mut out_vec = ~[]; - log(debug, fmt!("initial addrinfo: %?", res)); + debug!("initial addrinfo: %?", res); let mut curr_addr = res; loop { let new_ip_addr = if ll::is_ipv4_addrinfo(curr_addr) { @@ -322,8 +322,8 @@ extern fn get_addr_cb(handle: *uv_getaddrinfo_t, status: libc::c_int, *ll::addrinfo_as_sockaddr_in6(curr_addr)))) } else { - log(debug, ~"curr_addr is not of family AF_INET or "+ - ~"AF_INET6. Error."); + debug!("curr_addr is not of family AF_INET or \ + AF_INET6. Error."); output_ch.send( result::Err(GetAddrUnknownError)); break; @@ -332,33 +332,33 @@ extern fn get_addr_cb(handle: *uv_getaddrinfo_t, status: libc::c_int, let next_addr = ll::get_next_addrinfo(curr_addr); if next_addr == ptr::null::() as *addrinfo { - log(debug, ~"null next_addr encountered. no mas"); + debug!("null next_addr encountered. no mas"); break; } else { curr_addr = next_addr; - log(debug, fmt!("next_addr addrinfo: %?", curr_addr)); + debug!("next_addr addrinfo: %?", curr_addr); } } - log(debug, fmt!("successful process addrinfo result, len: %?", - vec::len(out_vec))); + debug!("successful process addrinfo result, len: %?", + vec::len(out_vec)); output_ch.send(result::Ok(out_vec)); } else { - log(debug, ~"addrinfo pointer is NULL"); + debug!("addrinfo pointer is NULL"); output_ch.send( result::Err(GetAddrUnknownError)); } } else { - log(debug, ~"status != 0 error in get_addr_cb"); + debug!("status != 0 error in get_addr_cb"); output_ch.send( result::Err(GetAddrUnknownError)); } if res != (ptr::null::()) { uv_freeaddrinfo(res); } - log(debug, ~"leaving get_addr_cb"); + debug!("leaving get_addr_cb"); } } @@ -384,15 +384,15 @@ mod test { fn test_ip_ipv6_parse_and_format_ip() { let localhost_str = ~"::1"; let format_result = format_addr(&v6::parse_addr(localhost_str)); - log(debug, fmt!("results: expected: '%s' actual: '%s'", - localhost_str, format_result)); + debug!("results: expected: '%s' actual: '%s'", + localhost_str, format_result); fail_unless!(format_result == localhost_str); } #[test] fn test_ip_ipv4_bad_parse() { match v4::try_parse_addr(~"b4df00d") { result::Err(ref err_info) => { - log(debug, fmt!("got error as expected %?", err_info)); + debug!("got error as expected %?", err_info); fail_unless!(true); } result::Ok(ref addr) => { @@ -405,7 +405,7 @@ mod test { fn test_ip_ipv6_bad_parse() { match v6::try_parse_addr(~"::,~2234k;") { result::Err(ref err_info) => { - log(debug, fmt!("got error as expected %?", err_info)); + debug!("got error as expected %?", err_info); fail_unless!(true); } result::Ok(ref addr) => { @@ -425,15 +425,15 @@ mod test { // note really sure how to realiably test/assert // this.. mostly just wanting to see it work, atm. let results = result::unwrap(ga_result); - log(debug, fmt!("test_get_addr: Number of results for %s: %?", - localhost_name, vec::len(results))); + debug!("test_get_addr: Number of results for %s: %?", + localhost_name, vec::len(results)); for vec::each(results) |r| { let ipv_prefix = match *r { Ipv4(_) => ~"IPv4", Ipv6(_) => ~"IPv6" }; - log(debug, fmt!("test_get_addr: result %s: '%s'", - ipv_prefix, format_addr(r))); + debug!("test_get_addr: result %s: '%s'", + ipv_prefix, format_addr(r)); } // at least one result.. this is going to vary from system // to system, based on stuff like the contents of /etc/hosts diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index 5328975f82aba..0224927df57ae 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -559,14 +559,14 @@ pub fn accept(new_conn: TcpNewConnection) server_handle_ptr); match uv::ll::tcp_init(loop_ptr, client_stream_handle_ptr) { 0i32 => { - log(debug, ~"uv_tcp_init successful for \ + debug!("uv_tcp_init successful for \ client stream"); match uv::ll::accept( server_handle_ptr as *libc::c_void, client_stream_handle_ptr as *libc::c_void) { 0i32 => { - log(debug, - ~"successfully accepted client \ + debug!( + "successfully accepted client \ connection"); uv::ll::set_data_for_uv_handle( client_stream_handle_ptr, @@ -575,7 +575,7 @@ pub fn accept(new_conn: TcpNewConnection) result_ch.send(None); } _ => { - log(debug, ~"failed to accept client conn"); + debug!("failed to accept client conn"); result_ch.send(Some( uv::ll::get_last_err_data( loop_ptr).to_tcp_err())); @@ -583,7 +583,7 @@ pub fn accept(new_conn: TcpNewConnection) } } _ => { - log(debug, ~"failed to accept client stream"); + debug!("failed to accept client stream"); result_ch.send(Some( uv::ll::get_last_err_data( loop_ptr).to_tcp_err())); @@ -694,7 +694,7 @@ fn listen_common(host_ip: ip::IpAddr, let addr_str = ip::format_addr(&loc_ip); let bind_result = match loc_ip { ip::Ipv4(ref addr) => { - log(debug, fmt!("addr: %?", addr)); + debug!("addr: %?", addr); let in_addr = uv::ll::ip4_addr( addr_str, port as int); @@ -702,7 +702,7 @@ fn listen_common(host_ip: ip::IpAddr, ptr::addr_of(&in_addr)) } ip::Ipv6(ref addr) => { - log(debug, fmt!("addr: %?", addr)); + debug!("addr: %?", addr); let in_addr = uv::ll::ip6_addr( addr_str, port as int); @@ -718,8 +718,8 @@ fn listen_common(host_ip: ip::IpAddr, tcp_lfc_on_connection_cb) { 0i32 => setup_ch.send(None), _ => { - log(debug, - ~"failure to uv_tcp_init"); + debug!( + "failure to uv_tcp_init"); let err_data = uv::ll::get_last_err_data( loop_ptr); @@ -728,7 +728,7 @@ fn listen_common(host_ip: ip::IpAddr, } } _ => { - log(debug, ~"failure to uv_tcp_bind"); + debug!("failure to uv_tcp_bind"); let err_data = uv::ll::get_last_err_data( loop_ptr); setup_ch.send(Some(err_data)); @@ -736,7 +736,7 @@ fn listen_common(host_ip: ip::IpAddr, } } _ => { - log(debug, ~"failure to uv_tcp_bind"); + debug!("failure to uv_tcp_bind"); let err_data = uv::ll::get_last_err_data( loop_ptr); setup_ch.send(Some(err_data)); @@ -751,9 +751,9 @@ fn listen_common(host_ip: ip::IpAddr, Some(ref err_data) => { do iotask::interact(iotask) |loop_ptr| { unsafe { - log(debug, - fmt!("tcp::listen post-kill recv hl interact %?", - loop_ptr)); + debug!( + "tcp::listen post-kill recv hl interact %?", + loop_ptr); (*server_data_ptr).active = false; uv::ll::close(server_stream_ptr, tcp_lfc_close_cb); } @@ -761,16 +761,16 @@ fn listen_common(host_ip: ip::IpAddr, stream_closed_po.recv(); match err_data.err_name { ~"EACCES" => { - log(debug, ~"Got EACCES error"); + debug!("Got EACCES error"); result::Err(AccessDenied) } ~"EADDRINUSE" => { - log(debug, ~"Got EADDRINUSE error"); + debug!("Got EADDRINUSE error"); result::Err(AddressInUse) } _ => { - log(debug, fmt!("Got '%s' '%s' libuv error", - err_data.err_name, err_data.err_msg)); + debug!("Got '%s' '%s' libuv error", + err_data.err_name, err_data.err_msg); result::Err( GenericListenErr(err_data.err_name, err_data.err_msg)) @@ -782,9 +782,9 @@ fn listen_common(host_ip: ip::IpAddr, let kill_result = kill_po.recv(); do iotask::interact(iotask) |loop_ptr| { unsafe { - log(debug, - fmt!("tcp::listen post-kill recv hl interact %?", - loop_ptr)); + debug!( + "tcp::listen post-kill recv hl interact %?", + loop_ptr); (*server_data_ptr).active = false; uv::ll::close(server_stream_ptr, tcp_lfc_close_cb); } @@ -981,9 +981,9 @@ impl io::Writer for TcpSocketBuf { ).to_vec()); if w_result.is_err() { let err_data = w_result.get_err(); - log(debug, - fmt!("ERROR sock_buf as io::writer.writer err: %? %?", - err_data.err_name, err_data.err_msg)); + debug!( + "ERROR sock_buf as io::writer.writer err: %? %?", + err_data.err_name, err_data.err_msg); } } } @@ -1015,9 +1015,9 @@ fn tear_down_socket_data(socket_data: @TcpSocketData) { let stream_handle_ptr = (*socket_data).stream_handle_ptr; do iotask::interact(&(*socket_data).iotask) |loop_ptr| { unsafe { - log(debug, - fmt!("interact dtor for tcp_socket stream %? loop %?", - stream_handle_ptr, loop_ptr)); + debug!( + "interact dtor for tcp_socket stream %? loop %?", + stream_handle_ptr, loop_ptr); uv::ll::set_data_for_uv_handle(stream_handle_ptr, close_data_ptr); uv::ll::close(stream_handle_ptr, tcp_socket_dtor_close_cb); @@ -1028,7 +1028,7 @@ fn tear_down_socket_data(socket_data: @TcpSocketData) { //log(debug, fmt!("about to free socket_data at %?", socket_data)); rustrt::rust_uv_current_kernel_free(stream_handle_ptr as *libc::c_void); - log(debug, ~"exiting dtor for tcp_socket"); + debug!("exiting dtor for tcp_socket"); } } @@ -1038,7 +1038,7 @@ fn read_common_impl(socket_data: *TcpSocketData, timeout_msecs: uint) unsafe { use timer; - log(debug, ~"starting tcp::read"); + debug!("starting tcp::read"); let iotask = &(*socket_data).iotask; let rs_result = read_start_common_impl(socket_data); if result::is_err(&rs_result) { @@ -1046,17 +1046,17 @@ fn read_common_impl(socket_data: *TcpSocketData, timeout_msecs: uint) result::Err(err_data) } else { - log(debug, ~"tcp::read before recv_timeout"); + debug!("tcp::read before recv_timeout"); let read_result = if timeout_msecs > 0u { timer::recv_timeout( iotask, timeout_msecs, result::unwrap(rs_result)) } else { Some(result::get(&rs_result).recv()) }; - log(debug, ~"tcp::read after recv_timeout"); + debug!("tcp::read after recv_timeout"); match read_result { None => { - log(debug, ~"tcp::read: timed out.."); + debug!("tcp::read: timed out.."); let err_data = TcpErrData { err_name: ~"TIMEOUT", err_msg: ~"req timed out" @@ -1065,7 +1065,7 @@ fn read_common_impl(socket_data: *TcpSocketData, timeout_msecs: uint) result::Err(err_data) } Some(data_result) => { - log(debug, ~"tcp::read got data"); + debug!("tcp::read got data"); read_stop_common_impl(socket_data); data_result } @@ -1082,15 +1082,15 @@ fn read_stop_common_impl(socket_data: *TcpSocketData) -> let (stop_po, stop_ch) = stream::>(); do iotask::interact(&(*socket_data).iotask) |loop_ptr| { unsafe { - log(debug, ~"in interact cb for tcp::read_stop"); + debug!("in interact cb for tcp::read_stop"); match uv::ll::read_stop(stream_handle_ptr as *uv::ll::uv_stream_t) { 0i32 => { - log(debug, ~"successfully called uv_read_stop"); + debug!("successfully called uv_read_stop"); stop_ch.send(None); } _ => { - log(debug, ~"failure in calling uv_read_stop"); + debug!("failure in calling uv_read_stop"); let err_data = uv::ll::get_last_err_data(loop_ptr); stop_ch.send(Some(err_data.to_tcp_err())); } @@ -1111,21 +1111,21 @@ fn read_start_common_impl(socket_data: *TcpSocketData) unsafe { let stream_handle_ptr = (*socket_data).stream_handle_ptr; let (start_po, start_ch) = stream::>(); - log(debug, ~"in tcp::read_start before interact loop"); + debug!("in tcp::read_start before interact loop"); do iotask::interact(&(*socket_data).iotask) |loop_ptr| { unsafe { - log(debug, fmt!("in tcp::read_start interact cb %?", - loop_ptr)); + debug!("in tcp::read_start interact cb %?", + loop_ptr); match uv::ll::read_start(stream_handle_ptr as *uv::ll::uv_stream_t, on_alloc_cb, on_tcp_read_cb) { 0i32 => { - log(debug, ~"success doing uv_read_start"); + debug!("success doing uv_read_start"); start_ch.send(None); } _ => { - log(debug, ~"error attempting uv_read_start"); + debug!("error attempting uv_read_start"); let err_data = uv::ll::get_last_err_data(loop_ptr); start_ch.send(Some(err_data)); } @@ -1164,19 +1164,19 @@ fn write_common_impl(socket_data_ptr: *TcpSocketData, let write_data_ptr = ptr::addr_of(&write_data); do iotask::interact(&(*socket_data_ptr).iotask) |loop_ptr| { unsafe { - log(debug, fmt!("in interact cb for tcp::write %?", - loop_ptr)); + debug!("in interact cb for tcp::write %?", + loop_ptr); match uv::ll::write(write_req_ptr, stream_handle_ptr, write_buf_vec_ptr, tcp_write_complete_cb) { 0i32 => { - log(debug, ~"uv_write() invoked successfully"); + debug!("uv_write() invoked successfully"); uv::ll::set_data_for_req(write_req_ptr, write_data_ptr); } _ => { - log(debug, ~"error invoking uv_write()"); + debug!("error invoking uv_write()"); let err_data = uv::ll::get_last_err_data(loop_ptr); let result_ch = (*write_data_ptr).result_ch.clone(); result_ch.send(TcpWriteError(err_data.to_tcp_err())); @@ -1281,8 +1281,8 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t, nread: libc::ssize_t, ++buf: uv::ll::uv_buf_t) { unsafe { - log(debug, fmt!("entering on_tcp_read_cb stream: %? nread: %?", - stream, nread)); + debug!("entering on_tcp_read_cb stream: %? nread: %?", + stream, nread); let loop_ptr = uv::ll::get_loop_for_uv_handle(stream); let socket_data_ptr = uv::ll::get_data_for_uv_handle(stream) as *TcpSocketData; @@ -1290,8 +1290,8 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t, // incoming err.. probably eof -1 => { let err_data = uv::ll::get_last_err_data(loop_ptr).to_tcp_err(); - log(debug, fmt!("on_tcp_read_cb: incoming err.. name %? msg %?", - err_data.err_name, err_data.err_msg)); + debug!("on_tcp_read_cb: incoming err.. name %? msg %?", + err_data.err_name, err_data.err_msg); let reader_ch = &(*socket_data_ptr).reader_ch; reader_ch.send(result::Err(err_data)); } @@ -1300,7 +1300,7 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t, // have data _ => { // we have data - log(debug, fmt!("tcp on_read_cb nread: %d", nread as int)); + debug!("tcp on_read_cb nread: %d", nread as int); let reader_ch = &(*socket_data_ptr).reader_ch; let buf_base = uv::ll::get_base_from_buf(buf); let new_bytes = vec::from_buf(buf_base, nread as uint); @@ -1308,7 +1308,7 @@ extern fn on_tcp_read_cb(stream: *uv::ll::uv_stream_t, } } uv::ll::free_base_of_buf(buf); - log(debug, ~"exiting on_tcp_read_cb"); + debug!("exiting on_tcp_read_cb"); } } @@ -1316,12 +1316,12 @@ extern fn on_alloc_cb(handle: *libc::c_void, suggested_size: size_t) -> uv::ll::uv_buf_t { unsafe { - log(debug, ~"tcp read on_alloc_cb!"); + debug!("tcp read on_alloc_cb!"); let char_ptr = uv::ll::malloc_buf_base_of(suggested_size); - log(debug, fmt!("tcp read on_alloc_cb h: %? char_ptr: %u sugsize: %u", + debug!("tcp read on_alloc_cb h: %? char_ptr: %u sugsize: %u", handle, char_ptr as uint, - suggested_size as uint)); + suggested_size as uint); uv::ll::buf_init(char_ptr, suggested_size as uint) } } @@ -1336,7 +1336,7 @@ extern fn tcp_socket_dtor_close_cb(handle: *uv::ll::uv_tcp_t) { as *TcpSocketCloseData; let closed_ch = (*data).closed_ch.clone(); closed_ch.send(()); - log(debug, ~"tcp_socket_dtor_close_cb exiting.."); + debug!("tcp_socket_dtor_close_cb exiting.."); } } @@ -1346,7 +1346,7 @@ extern fn tcp_write_complete_cb(write_req: *uv::ll::uv_write_t, let write_data_ptr = uv::ll::get_data_for_req(write_req) as *WriteReqData; if status == 0i32 { - log(debug, ~"successful write complete"); + debug!("successful write complete"); let result_ch = (*write_data_ptr).result_ch.clone(); result_ch.send(TcpWriteSuccess); } else { @@ -1354,7 +1354,7 @@ extern fn tcp_write_complete_cb(write_req: *uv::ll::uv_write_t, write_req); let loop_ptr = uv::ll::get_loop_for_uv_handle(stream_handle_ptr); let err_data = uv::ll::get_last_err_data(loop_ptr); - log(debug, ~"failure to write"); + debug!("failure to write"); let result_ch = (*write_data_ptr).result_ch.clone(); result_ch.send(TcpWriteError(err_data.to_tcp_err())); } @@ -1376,13 +1376,13 @@ extern fn stream_error_close_cb(handle: *uv::ll::uv_tcp_t) { *ConnectReqData; let closed_signal_ch = (*data).closed_signal_ch.clone(); closed_signal_ch.send(()); - log(debug, fmt!("exiting steam_error_close_cb for %?", handle)); + debug!("exiting steam_error_close_cb for %?", handle); } } extern fn tcp_connect_close_cb(handle: *uv::ll::uv_tcp_t) { unsafe { - log(debug, fmt!("closed client tcp handle %?", handle)); + debug!("closed client tcp handle %?", handle); } } @@ -1392,27 +1392,27 @@ extern fn tcp_connect_on_connect_cb(connect_req_ptr: *uv::ll::uv_connect_t, let conn_data_ptr = (uv::ll::get_data_for_req(connect_req_ptr) as *ConnectReqData); let result_ch = (*conn_data_ptr).result_ch.clone(); - log(debug, fmt!("tcp_connect result_ch %?", result_ch)); + debug!("tcp_connect result_ch %?", result_ch); let tcp_stream_ptr = uv::ll::get_stream_handle_from_connect_req(connect_req_ptr); match status { 0i32 => { - log(debug, ~"successful tcp connection!"); + debug!("successful tcp connection!"); result_ch.send(ConnSuccess); } _ => { - log(debug, ~"error in tcp_connect_on_connect_cb"); + debug!("error in tcp_connect_on_connect_cb"); let loop_ptr = uv::ll::get_loop_for_uv_handle(tcp_stream_ptr); let err_data = uv::ll::get_last_err_data(loop_ptr); - log(debug, fmt!("err_data %? %?", err_data.err_name, - err_data.err_msg)); + debug!("err_data %? %?", err_data.err_name, + err_data.err_msg); result_ch.send(ConnFailure(err_data)); uv::ll::set_data_for_uv_handle(tcp_stream_ptr, conn_data_ptr); uv::ll::close(tcp_stream_ptr, stream_error_close_cb); } } - log(debug, ~"leaving tcp_connect_on_connect_cb"); + debug!("leaving tcp_connect_on_connect_cb"); } } @@ -1758,10 +1758,10 @@ pub mod test { }; let actual_req = server_result_po.recv(); - log(debug, fmt!("REQ: expected: '%s' actual: '%s'", - expected_req, actual_req)); - log(debug, fmt!("RESP: expected: '%s' actual: '%s'", - expected_resp, actual_resp)); + debug!("REQ: expected: '%s' actual: '%s'", + expected_req, actual_req); + debug!("RESP: expected: '%s' actual: '%s'", + expected_resp, actual_resp); fail_unless!(str::contains(actual_req, expected_req)); fail_unless!(str::contains(actual_resp, expected_resp)); } diff --git a/src/libstd/par.rs b/src/libstd/par.rs index a33effba8e0cf..17ae48e03b93f 100644 --- a/src/libstd/par.rs +++ b/src/libstd/par.rs @@ -41,7 +41,7 @@ fn map_slices( let len = xs.len(); if len < min_granularity { - log(info, ~"small slice"); + info!("small slice"); // This is a small vector, fall back on the normal map. ~[f()(0u, xs)] } @@ -52,7 +52,7 @@ fn map_slices( let mut futures = ~[]; let mut base = 0u; - log(info, ~"spawning tasks"); + info!("spawning tasks"); while base < len { let end = uint::min(len, base + items_per_task); do vec::as_imm_buf(xs) |p, _len| { @@ -63,11 +63,11 @@ fn map_slices( let len = end - base; let slice = (ptr::offset(p, base), len * sys::size_of::()); - log(info, fmt!("pre-slice: %?", (base, slice))); + info!("pre-slice: %?", (base, slice)); let slice : &[A] = cast::reinterpret_cast(&slice); - log(info, fmt!("slice: %?", - (base, vec::len(slice), end - base))); + info!("slice: %?", + (base, vec::len(slice), end - base)); fail_unless!((vec::len(slice) == end - base)); f(base, slice) } @@ -76,9 +76,9 @@ fn map_slices( }; base += items_per_task; } - log(info, ~"tasks spawned"); + info!("tasks spawned"); - log(info, fmt!("num_tasks: %?", (num_tasks, futures.len()))); + info!("num_tasks: %?", (num_tasks, futures.len())); fail_unless!((num_tasks == futures.len())); let r = do futures.map() |ys| { @@ -114,7 +114,7 @@ pub fn mapi( result }); let r = vec::concat(slices); - log(info, (r.len(), xs.len())); + info!("%?", (r.len(), xs.len())); fail_unless!((r.len() == xs.len())); r } diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index 50de528762f26..a13617a57ac93 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -721,7 +721,7 @@ mod test_qsort3 { quick_sort3::(v1); let mut i = 0; while i < len { - log(debug, v2[i]); + debug!(v2[i]); fail_unless!((v2[i] == v1[i])); i += 1; } @@ -768,7 +768,7 @@ mod test_qsort { quick_sort::(v1, leual); let mut i = 0u; while i < len { - log(debug, v2[i]); + debug!(v2[i]); fail_unless!((v2[i] == v1[i])); i += 1; } @@ -834,7 +834,7 @@ mod tests { let v3 = merge_sort::(v1, f); let mut i = 0u; while i < len { - log(debug, v3[i]); + debug!(v3[i]); fail_unless!((v3[i] == v2[i])); i += 1; } @@ -918,7 +918,7 @@ mod test_tim_sort { tim_sort::(v1); let mut i = 0u; while i < len { - log(debug, v2[i]); + debug!(v2[i]); fail_unless!((v2[i] == v1[i])); i += 1u; } diff --git a/src/libstd/timer.rs b/src/libstd/timer.rs index 60469d0b0f235..8ed541c7140a2 100644 --- a/src/libstd/timer.rs +++ b/src/libstd/timer.rs @@ -142,8 +142,8 @@ pub fn recv_timeout(iotask: &IoTask, extern fn delayed_send_cb(handle: *uv::ll::uv_timer_t, status: libc::c_int) { unsafe { - log(debug, - fmt!("delayed_send_cb handle %? status %?", handle, status)); + debug!( + "delayed_send_cb handle %? status %?", handle, status); // Faking a borrowed pointer to our ~SharedChan let timer_done_ch_ptr: &*c_void = &uv::ll::get_data_for_uv_handle( handle); @@ -163,7 +163,7 @@ extern fn delayed_send_cb(handle: *uv::ll::uv_timer_t, extern fn delayed_send_close_cb(handle: *uv::ll::uv_timer_t) { unsafe { - log(debug, fmt!("delayed_send_close_cb handle %?", handle)); + debug!("delayed_send_close_cb handle %?", handle); let timer_done_ch_ptr = uv::ll::get_data_for_uv_handle(handle); let timer_done_ch = transmute::<*c_void, ~SharedChan<()>>( timer_done_ch_ptr); diff --git a/src/libstd/uv_global_loop.rs b/src/libstd/uv_global_loop.rs index db3570941e8a3..1f3dc2f01de52 100644 --- a/src/libstd/uv_global_loop.rs +++ b/src/libstd/uv_global_loop.rs @@ -136,26 +136,25 @@ mod test { timer_ptr as *libc::c_void); let exit_ch = transmute::<*c_void, ~Chan>(exit_ch_ptr); exit_ch.send(true); - log(debug, - fmt!("EXIT_CH_PTR simple_timer_close_cb exit_ch_ptr: %?", - exit_ch_ptr)); + debug!("EXIT_CH_PTR simple_timer_close_cb exit_ch_ptr: %?", + exit_ch_ptr); } } extern fn simple_timer_cb(timer_ptr: *ll::uv_timer_t, _status: libc::c_int) { unsafe { - log(debug, ~"in simple timer cb"); + debug!(~"in simple timer cb"); ll::timer_stop(timer_ptr); let hl_loop = &get_gl(); do iotask::interact(hl_loop) |_loop_ptr| { - log(debug, ~"closing timer"); + debug!(~"closing timer"); unsafe { ll::close(timer_ptr, simple_timer_close_cb); } - log(debug, ~"about to deref exit_ch_ptr"); - log(debug, ~"after msg sent on deref'd exit_ch"); + debug!(~"about to deref exit_ch_ptr"); + debug!(~"after msg sent on deref'd exit_ch"); }; - log(debug, ~"exiting simple timer cb"); + debug!(~"exiting simple timer cb"); } } @@ -163,13 +162,13 @@ mod test { unsafe { let (exit_po, exit_ch) = stream::(); let exit_ch_ptr: *libc::c_void = transmute(~exit_ch); - log(debug, fmt!("EXIT_CH_PTR newly created exit_ch_ptr: %?", - exit_ch_ptr)); + debug!("EXIT_CH_PTR newly created exit_ch_ptr: %?", + exit_ch_ptr); let timer_handle = ll::timer_t(); let timer_ptr = ptr::addr_of(&timer_handle); do iotask::interact(iotask) |loop_ptr| { unsafe { - log(debug, ~"user code inside interact loop!!!"); + debug!(~"user code inside interact loop!!!"); let init_status = ll::timer_init(loop_ptr, timer_ptr); if(init_status == 0i32) { ll::set_data_for_uv_handle( @@ -188,7 +187,7 @@ mod test { } }; exit_po.recv(); - log(debug, + debug!( ~"global_loop timer test: msg recv on exit_po, done.."); } } @@ -225,7 +224,7 @@ mod test { for iter::repeat(cycles) { exit_po.recv(); }; - log(debug, ~"test_stress_gl_uv_global_loop_high_level_global_timer"+ + debug!(~"test_stress_gl_uv_global_loop_high_level_global_timer"+ ~" exiting sucessfully!"); } } diff --git a/src/libstd/uv_iotask.rs b/src/libstd/uv_iotask.rs index 522a613f02d4f..1c7a7c22a9d15 100644 --- a/src/libstd/uv_iotask.rs +++ b/src/libstd/uv_iotask.rs @@ -132,10 +132,10 @@ fn run_loop(iotask_ch: &Chan) { }; iotask_ch.send(iotask); - log(debug, ~"about to run uv loop"); + debug!("about to run uv loop"); // enter the loop... this blocks until the loop is done.. ll::run(loop_ptr); - log(debug, ~"uv loop ended"); + debug!("uv loop ended"); ll::loop_delete(loop_ptr); } } @@ -158,8 +158,8 @@ fn send_msg(iotask: &IoTask, extern fn wake_up_cb(async_handle: *ll::uv_async_t, status: int) { - log(debug, fmt!("wake_up_cb extern.. handle: %? status: %?", - async_handle, status)); + debug!("wake_up_cb extern.. handle: %? status: %?", + async_handle, status); unsafe { let loop_ptr = ll::get_loop_for_uv_handle(async_handle); @@ -178,13 +178,13 @@ extern fn wake_up_cb(async_handle: *ll::uv_async_t, fn begin_teardown(data: *IoTaskLoopData) { unsafe { - log(debug, ~"iotask begin_teardown() called, close async_handle"); + debug!("iotask begin_teardown() called, close async_handle"); let async_handle = (*data).async_handle; ll::close(async_handle as *c_void, tear_down_close_cb); } } extern fn tear_down_walk_cb(handle: *libc::c_void, arg: *libc::c_void) { - log(debug, ~"IN TEARDOWN WALK CB"); + debug!("IN TEARDOWN WALK CB"); // pretty much, if we still have an active handle and it is *not* // the async handle that facilities global loop communication, we // want to barf out and fail @@ -194,7 +194,7 @@ extern fn tear_down_walk_cb(handle: *libc::c_void, arg: *libc::c_void) { extern fn tear_down_close_cb(handle: *ll::uv_async_t) { unsafe { let loop_ptr = ll::get_loop_for_uv_handle(handle); - log(debug, ~"in tear_down_close_cb"); + debug!("in tear_down_close_cb"); ll::walk(loop_ptr, tear_down_walk_cb, handle as *libc::c_void); } } @@ -202,7 +202,7 @@ extern fn tear_down_close_cb(handle: *ll::uv_async_t) { #[cfg(test)] extern fn async_close_cb(handle: *ll::uv_async_t) { unsafe { - log(debug, fmt!("async_close_cb handle %?", handle)); + debug!("async_close_cb handle %?", handle); let exit_ch = &(*(ll::get_data_for_uv_handle(handle) as *AhData)).exit_ch; let exit_ch = exit_ch.clone(); @@ -213,8 +213,7 @@ extern fn async_close_cb(handle: *ll::uv_async_t) { #[cfg(test)] extern fn async_handle_cb(handle: *ll::uv_async_t, status: libc::c_int) { unsafe { - log(debug, - fmt!("async_handle_cb handle %? status %?",handle,status)); + debug!("async_handle_cb handle %? status %?",handle,status); ll::close(handle, async_close_cb); } } @@ -269,15 +268,15 @@ unsafe fn spawn_test_loop(exit_ch: ~Chan<()>) -> IoTask { #[cfg(test)] extern fn lifetime_handle_close(handle: *libc::c_void) { unsafe { - log(debug, fmt!("lifetime_handle_close ptr %?", handle)); + debug!("lifetime_handle_close ptr %?", handle); } } #[cfg(test)] extern fn lifetime_async_callback(handle: *libc::c_void, status: libc::c_int) { - log(debug, fmt!("lifetime_handle_close ptr %? status %?", - handle, status)); + debug!("lifetime_handle_close ptr %? status %?", + handle, status); } #[test] @@ -311,9 +310,9 @@ fn test_uv_iotask_async() { debug!("waiting"); work_exit_po.recv(); }; - log(debug, ~"sending teardown_loop msg.."); + debug!(~"sending teardown_loop msg.."); exit(iotask); exit_po.recv(); - log(debug, ~"after recv on exit_po.. exiting.."); + debug!(~"after recv on exit_po.. exiting.."); } } diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index e61e8a1a594ce..831d1140a531b 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -411,34 +411,34 @@ pub fn core_macros() -> ~str { macro_rules! error ( ($arg:expr) => ( - log(::core::error, fmt!( \"%?\", $arg )) + __log(1u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(::core::error, fmt!( $($arg),+ )) + __log(1u32, fmt!( $($arg),+ )) ) ) macro_rules! warn ( ($arg:expr) => ( - log(::core::warn, fmt!( \"%?\", $arg )) + __log(2u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(::core::warn, fmt!( $($arg),+ )) + __log(2u32, fmt!( $($arg),+ )) ) ) macro_rules! info ( ($arg:expr) => ( - log(::core::info, fmt!( \"%?\", $arg )) + __log(3u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(::core::info, fmt!( $($arg),+ )) + __log(3u32, fmt!( $($arg),+ )) ) ) macro_rules! debug ( ($arg:expr) => ( - log(::core::debug, fmt!( \"%?\", $arg )) + __log(4u32, fmt!( \"%?\", $arg )) ); ($( $arg:expr ),+) => ( - log(::core::debug, fmt!( $($arg),+ )) + __log(4u32, fmt!( $($arg),+ )) ) ) diff --git a/src/libsyntax/ext/fmt.rs b/src/libsyntax/ext/fmt.rs index af558e6b330d9..ee0de9e48dbc1 100644 --- a/src/libsyntax/ext/fmt.rs +++ b/src/libsyntax/ext/fmt.rs @@ -37,8 +37,7 @@ pub fn expand_syntax_ext(cx: ext_ctxt, sp: span, tts: &[ast::token_tree]) expr_to_str(cx, args[0], ~"first argument to fmt! must be a string literal."); let fmtspan = args[0].span; - debug!("Format string:"); - log(debug, fmt); + debug!("Format string: %s", fmt); fn parse_fmt_err_(cx: ext_ctxt, sp: span, msg: &str) -> ! { cx.span_fatal(sp, msg); } @@ -223,7 +222,7 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, } fn log_conv(c: Conv) { match c.param { - Some(p) => { log(debug, ~"param: " + p.to_str()); } + Some(p) => { debug!("param: %s", p.to_str()); } _ => debug!("param: none") } for c.flags.each |f| { @@ -236,18 +235,18 @@ fn pieces_to_expr(cx: ext_ctxt, sp: span, } } match c.width { - CountIs(i) => log( - debug, ~"width: count is " + i.to_str()), - CountIsParam(i) => log( - debug, ~"width: count is param " + i.to_str()), + CountIs(i) => + debug!("width: count is %s", i.to_str()), + CountIsParam(i) => + debug!("width: count is param %s", i.to_str()), CountIsNextParam => debug!("width: count is next param"), CountImplied => debug!("width: count is implied") } match c.precision { - CountIs(i) => log( - debug, ~"prec: count is " + i.to_str()), - CountIsParam(i) => log( - debug, ~"prec: count is param " + i.to_str()), + CountIs(i) => + debug!("prec: count is %s", i.to_str()), + CountIsParam(i) => + debug!("prec: count is param %s", i.to_str()), CountIsNextParam => debug!("prec: count is next param"), CountImplied => debug!("prec: count is implied") } diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 494ef3a81a0d2..360cdebc6702b 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -183,7 +183,7 @@ fn read_line_comments(rdr: @mut StringReader, code_to_the_left: bool, let mut lines: ~[~str] = ~[]; while rdr.curr == '/' && nextch(rdr) == '/' { let line = read_one_line_comment(rdr); - log(debug, line); + debug!("%s", line); if is_doc_comment(line) { // doc-comments are not put in comments break; } @@ -221,7 +221,7 @@ fn trim_whitespace_prefix_and_push_line(lines: &mut ~[~str], s1 = str::slice(s, col, len); } else { s1 = ~""; } } else { s1 = /*bad*/ copy s; } - log(debug, ~"pushing line: " + s1); + debug!("pushing line: %s", s1); lines.push(s1); } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 99c1c2cb1feec..7d3f5c126128d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1184,7 +1184,7 @@ pub impl Parser { } } hi = self.span.hi; - } else if self.eat_keyword(&~"log") { + } else if self.eat_keyword(&~"__log") { self.expect(&token::LPAREN); let lvl = self.parse_expr(); self.expect(&token::COMMA); diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 81aacbf173d5e..c41b3aec09bdc 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -495,7 +495,7 @@ pub fn strict_keyword_table() -> HashMap<~str, ()> { ~"else", ~"enum", ~"extern", ~"false", ~"fn", ~"for", ~"if", ~"impl", - ~"let", ~"log", ~"loop", + ~"let", ~"__log", ~"loop", ~"match", ~"mod", ~"mut", ~"once", ~"priv", ~"pub", ~"pure", diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 8557ef22fc612..7f46e45229998 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -472,7 +472,7 @@ pub impl Printer { fn print(&mut self, x: token, L: int) { debug!("print %s %d (remaining line space=%d)", tok_str(x), L, self.space); - log(debug, buf_str(copy self.token, + debug!("%s", buf_str(copy self.token, copy self.size, self.left, self.right, diff --git a/src/test/bench/core-uint-to-str.rs b/src/test/bench/core-uint-to-str.rs index 56f616c6f2815..c637fcbaf50f4 100644 --- a/src/test/bench/core-uint-to-str.rs +++ b/src/test/bench/core-uint-to-str.rs @@ -22,6 +22,6 @@ fn main() { for uint::range(0u, n) |i| { let x = uint::to_str(i); - log(debug, x); + debug!(x); } } diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index 9efcc05e9964f..133dd606b0e71 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -181,7 +181,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result { let mut i = 0; while vec::any(colors, is_gray) { // Do the BFS. - log(info, fmt!("PBFS iteration %?", i)); + info!("PBFS iteration %?", i); i += 1; colors = do colors.mapi() |i, c| { let c : color = *c; @@ -257,7 +257,7 @@ fn pbfs(&&graph: arc::ARC, key: node_id) -> bfs_result { let mut i = 0; while par::any(colors, is_gray_factory) { // Do the BFS. - log(info, fmt!("PBFS iteration %?", i)); + info!("PBFS iteration %?", i); i += 1; let old_len = colors.len(); @@ -320,7 +320,7 @@ fn validate(edges: ~[(node_id, node_id)], // parent chains back to the root. While we do this, we also // compute the levels for each node. - log(info, ~"Verifying tree structure..."); + info!(~"Verifying tree structure..."); let mut status = true; let level = do tree.map() |parent| { @@ -352,7 +352,7 @@ fn validate(edges: ~[(node_id, node_id)], // 2. Each tree edge connects vertices whose BFS levels differ by // exactly one. - log(info, ~"Verifying tree edges..."); + info!(~"Verifying tree edges..."); let status = do tree.alli() |k, parent| { if *parent != root && *parent != -1i64 { @@ -368,7 +368,7 @@ fn validate(edges: ~[(node_id, node_id)], // 3. Every edge in the input list has vertices with levels that // differ by at most one or that both are not in the BFS tree. - log(info, ~"Verifying graph edges..."); + info!(~"Verifying graph edges..."); let status = do edges.all() |e| { let (u, v) = *e; @@ -385,7 +385,7 @@ fn validate(edges: ~[(node_id, node_id)], // 5. A node and its parent are joined by an edge of the original // graph. - log(info, ~"Verifying tree and graph edges..."); + info!(~"Verifying tree and graph edges..."); let status = do par::alli(tree) { let edges = copy edges; diff --git a/src/test/compile-fail/alt-join.rs b/src/test/compile-fail/alt-join.rs index 94488fbb55213..73f2c81302c6f 100644 --- a/src/test/compile-fail/alt-join.rs +++ b/src/test/compile-fail/alt-join.rs @@ -16,6 +16,6 @@ fn my_fail() -> ! { fail!(); } fn main() { match true { false => { my_fail(); } true => { } } - log(debug, x); //~ ERROR unresolved name: `x`. + debug!(x); //~ ERROR unresolved name: `x`. let x: int; } diff --git a/src/test/compile-fail/attempted-access-non-fatal.rs b/src/test/compile-fail/attempted-access-non-fatal.rs index 06dd154c27905..ba15abc3f8965 100644 --- a/src/test/compile-fail/attempted-access-non-fatal.rs +++ b/src/test/compile-fail/attempted-access-non-fatal.rs @@ -11,6 +11,6 @@ // Check that bogus field access is non-fatal fn main() { let x = 0; - log(debug, x.foo); //~ ERROR attempted access of field - log(debug, x.bar); //~ ERROR attempted access of field + debug!(x.foo); //~ ERROR attempted access of field + debug!(x.bar); //~ ERROR attempted access of field } diff --git a/src/test/compile-fail/autoderef-full-lval.rs b/src/test/compile-fail/autoderef-full-lval.rs index 25ae03087321b..8178b46d1d3fc 100644 --- a/src/test/compile-fail/autoderef-full-lval.rs +++ b/src/test/compile-fail/autoderef-full-lval.rs @@ -22,11 +22,11 @@ fn main() { let a: clam = clam{x: @1, y: @2}; let b: clam = clam{x: @10, y: @20}; let z: int = a.x + b.y; - log(debug, z); + debug!(z); fail_unless!((z == 21)); let forty: fish = fish{a: @40}; let two: fish = fish{a: @2}; let answer: int = forty.a + two.a; - log(debug, answer); + debug!(answer); fail_unless!((answer == 42)); } diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/compile-fail/bad-const-type.rs index 3c28472ce79b8..e35d5e79bde65 100644 --- a/src/test/compile-fail/bad-const-type.rs +++ b/src/test/compile-fail/bad-const-type.rs @@ -11,4 +11,4 @@ // error-pattern:expected `~str` but found `int` const i: str = 10i; -fn main() { log(debug, i); } +fn main() { debug!(i); } diff --git a/src/test/compile-fail/block-arg-as-stmt-with-value.rs b/src/test/compile-fail/block-arg-as-stmt-with-value.rs index 1ef5ae1607957..b4b10db939847 100644 --- a/src/test/compile-fail/block-arg-as-stmt-with-value.rs +++ b/src/test/compile-fail/block-arg-as-stmt-with-value.rs @@ -18,6 +18,6 @@ fn compute1() -> float { fn main() { let x = compute1(); - log(debug, x); + debug!(x); fail_unless!((x == -4f)); } diff --git a/src/test/compile-fail/block-coerce-no.rs b/src/test/compile-fail/block-coerce-no.rs index 980dc66b4af59..bdde5144b04d1 100644 --- a/src/test/compile-fail/block-coerce-no.rs +++ b/src/test/compile-fail/block-coerce-no.rs @@ -21,6 +21,6 @@ fn coerce(b: &fn()) -> extern fn() { fn main() { let i = 8; - let f = coerce(|| log(error, i) ); + let f = coerce(|| error!(i) ); f(); } diff --git a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs index 4e176e9fbae4a..d0b0f51d0cf77 100644 --- a/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs +++ b/src/test/compile-fail/borrowck-mut-addr-of-imm-var.rs @@ -12,5 +12,5 @@ fn main() { let x: int = 3; let y: &mut int = &mut x; //~ ERROR illegal borrow *y = 5; - log (debug, *y); + debug!(*y); } diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/compile-fail/copy-a-resource.rs index f1b31d66b3f68..2767447d8193c 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/compile-fail/copy-a-resource.rs @@ -26,5 +26,5 @@ fn main() { let x = foo(10); let _y = copy x; //~^ ERROR copying a value of non-copyable type `foo` - log(error, x); + error!(x); } diff --git a/src/test/compile-fail/dead-code-ret.rs b/src/test/compile-fail/dead-code-ret.rs index f564f582182be..182a41c1b1735 100644 --- a/src/test/compile-fail/dead-code-ret.rs +++ b/src/test/compile-fail/dead-code-ret.rs @@ -12,7 +12,7 @@ // error-pattern: dead -fn f(caller: str) { log(debug, caller); } +fn f(caller: str) { debug!(caller); } fn main() { return f("main"); debug!("Paul is dead"); } diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/compile-fail/if-without-else-result.rs index 58e78953d5a78..e822be759458f 100644 --- a/src/test/compile-fail/if-without-else-result.rs +++ b/src/test/compile-fail/if-without-else-result.rs @@ -12,5 +12,5 @@ fn main() { let a = if true { true }; - log(debug, a); + debug!(a); } diff --git a/src/test/compile-fail/index_message.rs b/src/test/compile-fail/index_message.rs index 1c5b1a117e005..3611dbb6866cb 100644 --- a/src/test/compile-fail/index_message.rs +++ b/src/test/compile-fail/index_message.rs @@ -10,5 +10,5 @@ fn main() { let z = (); - log(debug, z[0]); //~ ERROR cannot index a value of type `()` + debug!(z[0]); //~ ERROR cannot index a value of type `()` } diff --git a/src/test/compile-fail/issue-1476.rs b/src/test/compile-fail/issue-1476.rs index 7a45ecc83b0c2..1d58a4229d3eb 100644 --- a/src/test/compile-fail/issue-1476.rs +++ b/src/test/compile-fail/issue-1476.rs @@ -9,5 +9,5 @@ // except according to those terms. fn main() { - log(error, x); //~ ERROR unresolved name: `x`. + error!(x); //~ ERROR unresolved name: `x`. } diff --git a/src/test/compile-fail/issue-2151.rs b/src/test/compile-fail/issue-2151.rs index a9f0ddbe74316..e2bbda7d65a99 100644 --- a/src/test/compile-fail/issue-2151.rs +++ b/src/test/compile-fail/issue-2151.rs @@ -10,7 +10,7 @@ fn main() { for vec::each(fail!()) |i| { - log (debug, i * 2); + debug!(i * 2); //~^ ERROR the type of this value must be known }; } diff --git a/src/test/compile-fail/issue-2370-2.rs b/src/test/compile-fail/issue-2370-2.rs index a1126f305e722..540089bd59dc3 100644 --- a/src/test/compile-fail/issue-2370-2.rs +++ b/src/test/compile-fail/issue-2370-2.rs @@ -15,5 +15,5 @@ struct cat { fn main() { let kitty : cat = cat { x: () }; - log (error, *kitty); + error!(*kitty); } diff --git a/src/test/compile-fail/issue-2370.rs b/src/test/compile-fail/issue-2370.rs index 1d9d3de16d01c..cd17cc2afaa0d 100644 --- a/src/test/compile-fail/issue-2370.rs +++ b/src/test/compile-fail/issue-2370.rs @@ -15,5 +15,5 @@ struct cat { fn main() { let nyan = cat { foo: () }; - log (error, *nyan); + error!(*nyan); } diff --git a/src/test/compile-fail/issue-2467.rs b/src/test/compile-fail/issue-2467.rs index 6d31deea3ff35..aec14e7b71919 100644 --- a/src/test/compile-fail/issue-2467.rs +++ b/src/test/compile-fail/issue-2467.rs @@ -11,6 +11,6 @@ enum test { thing = 3u } //~ ERROR mismatched types //~^ ERROR expected signed integer constant fn main() { - log(error, thing as int); + error!(thing as int); fail_unless!((thing as int == 3)); } diff --git a/src/test/compile-fail/issue-3038.rs b/src/test/compile-fail/issue-3038.rs index 7a20b83c0342e..4ed21bc30e1ce 100644 --- a/src/test/compile-fail/issue-3038.rs +++ b/src/test/compile-fail/issue-3038.rs @@ -19,13 +19,13 @@ fn main() { let _z = match g(1, 2) { - g(x, x) => { log(debug, x + x); } + g(x, x) => { debug!(x + x); } //~^ ERROR Identifier x is bound more than once in the same pattern }; let _z = match i(l(1, 2), m(3, 4)) { i(l(x, _), m(_, x)) //~ ERROR Identifier x is bound more than once in the same pattern - => { log(error, x + x); } + => { error!(x + x); } }; let _z = match (1, 2) { diff --git a/src/test/compile-fail/issue-3521-2.rs b/src/test/compile-fail/issue-3521-2.rs index d8f689be4322c..39c14b4d316b0 100644 --- a/src/test/compile-fail/issue-3521-2.rs +++ b/src/test/compile-fail/issue-3521-2.rs @@ -13,5 +13,5 @@ fn main() { const y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant - log(error, y); + error!(y); } diff --git a/src/test/compile-fail/issue-3521.rs b/src/test/compile-fail/issue-3521.rs index e8e63e0700be5..d070a9735e48b 100644 --- a/src/test/compile-fail/issue-3521.rs +++ b/src/test/compile-fail/issue-3521.rs @@ -15,5 +15,5 @@ fn main() { Bar = foo //~ ERROR attempt to use a non-constant value in a constant } - log(error, Bar); + error!(Bar); } diff --git a/src/test/compile-fail/lambda-mutate-nested.rs b/src/test/compile-fail/lambda-mutate-nested.rs index 1ed18a0297a9a..8b009b91af96c 100644 --- a/src/test/compile-fail/lambda-mutate-nested.rs +++ b/src/test/compile-fail/lambda-mutate-nested.rs @@ -16,10 +16,10 @@ fn f2(x: &fn()) { x(); } fn main() { let i = 0; let ctr: @fn() -> int = || { f2(|| i = i + 1 ); i }; - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, i); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(i); } diff --git a/src/test/compile-fail/lambda-mutate.rs b/src/test/compile-fail/lambda-mutate.rs index eaa51a8c3dd56..ee5b3d8968418 100644 --- a/src/test/compile-fail/lambda-mutate.rs +++ b/src/test/compile-fail/lambda-mutate.rs @@ -13,10 +13,10 @@ fn main() { let i = 0; let ctr: @fn() -> int = || { i = i + 1; i }; - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, ctr()); - log(error, i); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(ctr()); + error!(i); } diff --git a/src/test/compile-fail/liveness-and-init.rs b/src/test/compile-fail/liveness-and-init.rs index 24fb1db33878d..4fd2427799f76 100644 --- a/src/test/compile-fail/liveness-and-init.rs +++ b/src/test/compile-fail/liveness-and-init.rs @@ -11,6 +11,6 @@ fn main() { let i: int; - log(debug, false && { i = 5; true }); - log(debug, i); //~ ERROR use of possibly uninitialized variable: `i` + debug!(false && { i = 5; true }); + debug!(i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-bad-bang-2.rs b/src/test/compile-fail/liveness-bad-bang-2.rs index 6ef45a6818fbe..496b0f7042f31 100644 --- a/src/test/compile-fail/liveness-bad-bang-2.rs +++ b/src/test/compile-fail/liveness-bad-bang-2.rs @@ -12,6 +12,6 @@ // Tests that a function with a ! annotation always actually fails // error-pattern: some control paths may return -fn bad_bang(i: uint) -> ! { log(debug, 3); } +fn bad_bang(i: uint) -> ! { debug!(3); } fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/liveness-block-unint.rs b/src/test/compile-fail/liveness-block-unint.rs index 75815d2643cbb..61610ca0ad102 100644 --- a/src/test/compile-fail/liveness-block-unint.rs +++ b/src/test/compile-fail/liveness-block-unint.rs @@ -12,6 +12,6 @@ fn force(f: &fn()) { f(); } fn main() { let x: int; force(|| { - log(debug, x); //~ ERROR capture of possibly uninitialized variable: `x` + debug!(x); //~ ERROR capture of possibly uninitialized variable: `x` }); } diff --git a/src/test/compile-fail/liveness-break-uninit-2.rs b/src/test/compile-fail/liveness-break-uninit-2.rs index 7e54585093725..c87439db6173a 100644 --- a/src/test/compile-fail/liveness-break-uninit-2.rs +++ b/src/test/compile-fail/liveness-break-uninit-2.rs @@ -16,9 +16,9 @@ fn foo() -> int { x = 0; //~ WARNING unreachable statement } - log(debug, x); //~ ERROR use of possibly uninitialized variable: `x` + debug!(x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { log(debug, foo()); } +fn main() { debug!(foo()); } diff --git a/src/test/compile-fail/liveness-break-uninit.rs b/src/test/compile-fail/liveness-break-uninit.rs index 553e45357960a..07075e4ef6398 100644 --- a/src/test/compile-fail/liveness-break-uninit.rs +++ b/src/test/compile-fail/liveness-break-uninit.rs @@ -16,9 +16,9 @@ fn foo() -> int { x = 0; //~ WARNING unreachable statement } - log(debug, x); //~ ERROR use of possibly uninitialized variable: `x` + debug!(x); //~ ERROR use of possibly uninitialized variable: `x` return 17; } -fn main() { log(debug, foo()); } +fn main() { debug!(foo()); } diff --git a/src/test/compile-fail/liveness-closure-require-ret.rs b/src/test/compile-fail/liveness-closure-require-ret.rs index b1fc6a870d086..22d321ffc0918 100644 --- a/src/test/compile-fail/liveness-closure-require-ret.rs +++ b/src/test/compile-fail/liveness-closure-require-ret.rs @@ -9,4 +9,4 @@ // except according to those terms. fn force(f: &fn() -> int) -> int { f() } -fn main() { log(debug, force(|| {})); } //~ ERROR mismatched types +fn main() { debug!(force(|| {})); } //~ ERROR mismatched types diff --git a/src/test/compile-fail/liveness-if-no-else.rs b/src/test/compile-fail/liveness-if-no-else.rs index 5082151ce0406..e37ee5bd4d4f2 100644 --- a/src/test/compile-fail/liveness-if-no-else.rs +++ b/src/test/compile-fail/liveness-if-no-else.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { log(debug, x); } +fn foo(x: int) { debug!(x); } fn main() { let x: int; if 1 > 2 { x = 10; } diff --git a/src/test/compile-fail/liveness-if-with-else.rs b/src/test/compile-fail/liveness-if-with-else.rs index f7bf5d8122152..6a436df6728e4 100644 --- a/src/test/compile-fail/liveness-if-with-else.rs +++ b/src/test/compile-fail/liveness-if-with-else.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { log(debug, x); } +fn foo(x: int) { debug!(x); } fn main() { let x: int; diff --git a/src/test/compile-fail/liveness-init-in-fn-expr.rs b/src/test/compile-fail/liveness-init-in-fn-expr.rs index 13b8fb04a426a..b7a715d29583a 100644 --- a/src/test/compile-fail/liveness-init-in-fn-expr.rs +++ b/src/test/compile-fail/liveness-init-in-fn-expr.rs @@ -13,5 +13,5 @@ fn main() { let i: int; i //~ ERROR use of possibly uninitialized variable: `i` }; - log(error, f()); + error!(f()); } diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index cb9d028809e7d..d1663bc356b18 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/compile-fail/liveness-move-in-loop.rs @@ -12,7 +12,7 @@ fn main() { let y: ~int = ~42; let mut x: ~int; loop { - log(debug, y); + debug!(y); loop { loop { loop { diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/compile-fail/liveness-move-in-while.rs index fa8ce00fb0825..6b4147242d19b 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/compile-fail/liveness-move-in-while.rs @@ -13,7 +13,7 @@ fn main() { let y: ~int = ~42; let mut x: ~int; loop { - log(debug, y); + debug!(y); // tjc: not sure why it prints the same error twice while true { while true { while true { x = y; copy x; } } } //~^ ERROR use of moved value: `y` diff --git a/src/test/compile-fail/liveness-or-init.rs b/src/test/compile-fail/liveness-or-init.rs index fb2bdb66aceab..2c1aadc8bbf16 100644 --- a/src/test/compile-fail/liveness-or-init.rs +++ b/src/test/compile-fail/liveness-or-init.rs @@ -11,6 +11,6 @@ fn main() { let i: int; - log(debug, false || { i = 5; true }); - log(debug, i); //~ ERROR use of possibly uninitialized variable: `i` + debug!(false || { i = 5; true }); + debug!(i); //~ ERROR use of possibly uninitialized variable: `i` } diff --git a/src/test/compile-fail/liveness-uninit.rs b/src/test/compile-fail/liveness-uninit.rs index 4ac500da69967..8797132fd5083 100644 --- a/src/test/compile-fail/liveness-uninit.rs +++ b/src/test/compile-fail/liveness-uninit.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn foo(x: int) { log(debug, x); } +fn foo(x: int) { debug!(x); } fn main() { let x: int; diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/compile-fail/liveness-use-after-move.rs index 16518261009ff..b7401db2a551b 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/compile-fail/liveness-use-after-move.rs @@ -11,6 +11,6 @@ fn main() { let x = ~5; let y = x; - log(debug, *x); //~ ERROR use of moved value: `x` + debug!(*x); //~ ERROR use of moved value: `x` copy y; } diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/compile-fail/liveness-use-after-send.rs index c0de60fa58e3f..ab24b63af100a 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/compile-fail/liveness-use-after-send.rs @@ -9,8 +9,8 @@ // except according to those terms. fn send(ch: _chan, -data: T) { - log(debug, ch); - log(debug, data); + debug!(ch); + debug!(data); fail!(); } @@ -20,7 +20,7 @@ struct _chan(int); // message after the send deinitializes it fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) { send(ch, message); - log(debug, message); //~ ERROR use of moved value: `message` + debug!(message); //~ ERROR use of moved value: `message` } fn main() { fail!(); } diff --git a/src/test/compile-fail/no-capture-arc.rs b/src/test/compile-fail/no-capture-arc.rs index a0c1bf040e317..5e17b168d5555 100644 --- a/src/test/compile-fail/no-capture-arc.rs +++ b/src/test/compile-fail/no-capture-arc.rs @@ -24,5 +24,5 @@ fn main() { fail_unless!((*arc::get(&arc_v))[2] == 3); - log(info, arc_v); + info!(arc_v); } diff --git a/src/test/compile-fail/no-reuse-move-arc.rs b/src/test/compile-fail/no-reuse-move-arc.rs index 4cb78e7032bcb..90faec802a421 100644 --- a/src/test/compile-fail/no-reuse-move-arc.rs +++ b/src/test/compile-fail/no-reuse-move-arc.rs @@ -22,5 +22,5 @@ fn main() { fail_unless!((*arc::get(&arc_v))[2] == 3); //~ ERROR use of moved value: `arc_v` - log(info, arc_v); + info!(arc_v); } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 0d7e2d2377c20..192cde21bf169 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -31,6 +31,6 @@ fn main() { do task::spawn { let y = x.take(); //~ ERROR value has non-owned type - log(error, y); + error!(y); } } diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs index 42bad88633cff..77e62497d078b 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/compile-fail/noncopyable-class.rs @@ -39,5 +39,5 @@ fn foo(i:int) -> foo { fn main() { let x = foo(10); let _y = copy x; //~ ERROR copying a value of non-copyable type - log(error, x); + error!(x); } diff --git a/src/test/compile-fail/nonscalar-cast.rs b/src/test/compile-fail/nonscalar-cast.rs index d84775d02ac64..999d96669ea5a 100644 --- a/src/test/compile-fail/nonscalar-cast.rs +++ b/src/test/compile-fail/nonscalar-cast.rs @@ -15,5 +15,5 @@ struct foo { } fn main() { - log(debug, foo{ x: 1 } as int); + debug!(foo{ x: 1 } as int); } diff --git a/src/test/compile-fail/oversized-literal.rs b/src/test/compile-fail/oversized-literal.rs index f2f021f998597..ce7b505cf09df 100644 --- a/src/test/compile-fail/oversized-literal.rs +++ b/src/test/compile-fail/oversized-literal.rs @@ -10,4 +10,4 @@ // error-pattern:literal out of range -fn main() { log(debug, 300u8); } +fn main() { debug!(300u8); } diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/compile-fail/pattern-tyvar.rs index 6b3b6f1463f58..506c71f493ae3 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/compile-fail/pattern-tyvar.rs @@ -18,7 +18,7 @@ enum bar { t1((), Option<~[int]>), t2, } fn foo(t: bar) { match t { t1(_, Some::(x)) => { - log(debug, x); + debug!(x); } _ => { fail!(); } } diff --git a/src/test/compile-fail/pinned-deep-copy.rs b/src/test/compile-fail/pinned-deep-copy.rs index 03ba317e7318b..5df65832099f5 100644 --- a/src/test/compile-fail/pinned-deep-copy.rs +++ b/src/test/compile-fail/pinned-deep-copy.rs @@ -31,7 +31,7 @@ fn main() { // Can't do this copy let x = ~~~A {y: r(i)}; let _z = copy x; //~ ERROR copying a value of non-copyable type - log(debug, x); + debug!(x); } - log(error, *i); + error!(*i); } diff --git a/src/test/compile-fail/sendfn-is-not-a-lambda.rs b/src/test/compile-fail/sendfn-is-not-a-lambda.rs index 33bb06e4f2643..847f85feb72f3 100644 --- a/src/test/compile-fail/sendfn-is-not-a-lambda.rs +++ b/src/test/compile-fail/sendfn-is-not-a-lambda.rs @@ -14,5 +14,5 @@ fn test(f: @fn(uint) -> uint) -> uint { fn main() { let f: ~fn(x: uint) -> uint = |x| 4u; - log(debug, test(f)); //~ ERROR expected @ closure, found ~ closure + debug!(test(f)); //~ ERROR expected @ closure, found ~ closure } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 12eef71f38bb3..a08f03d5628ca 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -19,5 +19,5 @@ impl Drop for r { fn main() { let i = ~r { b: true }; let _j = copy i; //~ ERROR copying a value of non-copyable type - log(debug, i); + debug!(i); } diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index 4ff9dd6f9914e..3f4636328b661 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -29,6 +29,6 @@ fn main() { f(copy r1, copy r2); //~^ ERROR copying a value of non-copyable type //~^^ ERROR copying a value of non-copyable type - log(debug, (r2, *i1)); - log(debug, (r1, *i2)); + debug!((r2, *i1)); + debug!((r1, *i2)); } diff --git a/src/test/compile-fail/unreachable-code.rs b/src/test/compile-fail/unreachable-code.rs index 8ddd934f5804d..f1fbc5b009e0a 100644 --- a/src/test/compile-fail/unreachable-code.rs +++ b/src/test/compile-fail/unreachable-code.rs @@ -12,5 +12,5 @@ fn main() { loop{} // red herring to make sure compilation fails - log(error, 42 == 'c'); + error!(42 == 'c'); } diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/compile-fail/unsupported-cast.rs index b2f97aa63d284..3af012a6c3fcf 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/compile-fail/unsupported-cast.rs @@ -11,5 +11,5 @@ // error-pattern:unsupported cast fn main() { - log(debug, 1.0 as *libc::FILE); // Can't cast float to foreign. + debug!(1.0 as *libc::FILE); // Can't cast float to foreign. } diff --git a/src/test/compile-fail/vec-field.rs b/src/test/compile-fail/vec-field.rs index ca1da5a2ccdc7..b6d478aa3ec20 100644 --- a/src/test/compile-fail/vec-field.rs +++ b/src/test/compile-fail/vec-field.rs @@ -13,7 +13,7 @@ fn f() { let v = ~[1i]; - log(debug, v.some_field_name); //type error + debug!(v.some_field_name); //type error } fn main() { } diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs index b06f91d50f25c..938e8c41e793f 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/compile-fail/vec-res-add.rs @@ -25,5 +25,5 @@ fn main() { let i = ~[r(0)]; let j = ~[r(1)]; let k = i + j; - log(debug, j); + debug!(j); } diff --git a/src/test/run-fail/alt-wildcards.rs b/src/test/run-fail/alt-wildcards.rs index 4730f1bc5602d..8aead798d5d6a 100644 --- a/src/test/run-fail/alt-wildcards.rs +++ b/src/test/run-fail/alt-wildcards.rs @@ -17,4 +17,4 @@ fn cmp() -> int { } } -fn main() { log(error, cmp()); } +fn main() { error!(cmp()); } diff --git a/src/test/run-fail/binop-fail-2.rs b/src/test/run-fail/binop-fail-2.rs index 2f1eb65a43ac6..2668570e6fb5d 100644 --- a/src/test/run-fail/binop-fail-2.rs +++ b/src/test/run-fail/binop-fail-2.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } +fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/binop-fail.rs b/src/test/run-fail/binop-fail.rs index 2f1eb65a43ac6..2668570e6fb5d 100644 --- a/src/test/run-fail/binop-fail.rs +++ b/src/test/run-fail/binop-fail.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } +fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); } fn main() { 3u == my_err(~"bye"); } diff --git a/src/test/run-fail/fail-arg.rs b/src/test/run-fail/fail-arg.rs index fc365613cf16c..f1a26df924b8b 100644 --- a/src/test/run-fail/fail-arg.rs +++ b/src/test/run-fail/fail-arg.rs @@ -9,6 +9,6 @@ // except according to those terms. // error-pattern:woe -fn f(a: int) { log(debug, a); } +fn f(a: int) { debug!(a); } fn main() { f(fail!(~"woe")); } diff --git a/src/test/run-fail/if-check-fail.rs b/src/test/run-fail/if-check-fail.rs index 5f9da798ffab2..a3831a10874c3 100644 --- a/src/test/run-fail/if-check-fail.rs +++ b/src/test/run-fail/if-check-fail.rs @@ -17,7 +17,7 @@ pure fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - log(debug, x); + debug!(x); } else { fail!(~"Number is odd"); } diff --git a/src/test/run-fail/if-cond-bot.rs b/src/test/run-fail/if-cond-bot.rs index d558ff1e3b84b..92063e76c3471 100644 --- a/src/test/run-fail/if-cond-bot.rs +++ b/src/test/run-fail/if-cond-bot.rs @@ -9,5 +9,5 @@ // except according to those terms. // error-pattern:quux -fn my_err(s: ~str) -> ! { log(error, s); fail!(~"quux"); } +fn my_err(s: ~str) -> ! { error!(s); fail!(~"quux"); } fn main() { if my_err(~"bye") { } } diff --git a/src/test/run-fail/issue-1459.rs b/src/test/run-fail/issue-1459.rs deleted file mode 100644 index 7f8cc7459de44..0000000000000 --- a/src/test/run-fail/issue-1459.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// error-pattern:roflcopter -fn main() { - log (fail!(~"roflcopter"), 2); -} diff --git a/src/test/run-fail/result-get-fail.rs b/src/test/run-fail/result-get-fail.rs index d9c17211cefdd..1e4e7685e270c 100644 --- a/src/test/run-fail/result-get-fail.rs +++ b/src/test/run-fail/result-get-fail.rs @@ -10,5 +10,5 @@ // error-pattern:get called on error result: ~"kitty" fn main() { - log(error, result::get(&result::Err::(~"kitty"))); + error!(result::get(&result::Err::(~"kitty"))); } diff --git a/src/test/run-fail/rt-set-exit-status-fail.rs b/src/test/run-fail/rt-set-exit-status-fail.rs index ed08022f44908..f6e9602470f33 100644 --- a/src/test/run-fail/rt-set-exit-status-fail.rs +++ b/src/test/run-fail/rt-set-exit-status-fail.rs @@ -11,7 +11,7 @@ // error-pattern:whatever fn main() { - log(error, ~"whatever"); + error!(~"whatever"); // Setting the exit status only works when the scheduler terminates // normally. In this case we're going to fail, so instead of of // returning 50 the process will return the typical rt failure code. diff --git a/src/test/run-fail/rt-set-exit-status-fail2.rs b/src/test/run-fail/rt-set-exit-status-fail2.rs index 78de5c3b847d7..bf33b10cc6108 100644 --- a/src/test/run-fail/rt-set-exit-status-fail2.rs +++ b/src/test/run-fail/rt-set-exit-status-fail2.rs @@ -30,7 +30,7 @@ fn r(x:int) -> r { } fn main() { - log(error, ~"whatever"); + error!(~"whatever"); do task::spawn { let i = r(5); }; diff --git a/src/test/run-fail/rt-set-exit-status.rs b/src/test/run-fail/rt-set-exit-status.rs index b20eb222025aa..2cff4ff09dfb8 100644 --- a/src/test/run-fail/rt-set-exit-status.rs +++ b/src/test/run-fail/rt-set-exit-status.rs @@ -11,7 +11,7 @@ // error-pattern:whatever fn main() { - log(error, ~"whatever"); + error!(~"whatever"); // 101 is the code the runtime uses on task failure and the value // compiletest expects run-fail tests to return. os::set_exit_status(101); diff --git a/src/test/run-fail/small-negative-indexing.rs b/src/test/run-fail/small-negative-indexing.rs index fe3fb448f6ffc..87df00fcce587 100644 --- a/src/test/run-fail/small-negative-indexing.rs +++ b/src/test/run-fail/small-negative-indexing.rs @@ -12,5 +12,5 @@ fn main() { let v = vec::from_fn(1024u, {|n| n}); // this should trip a bounds check - log(error, v[-1i8]); + error!(v[-1i8]); } diff --git a/src/test/run-fail/too-much-recursion.rs b/src/test/run-fail/too-much-recursion.rs index 009dee8cb7c67..04514b13455fb 100644 --- a/src/test/run-fail/too-much-recursion.rs +++ b/src/test/run-fail/too-much-recursion.rs @@ -13,6 +13,6 @@ // Test that the task fails after hiting the recursion limit fn main() { - log(debug, ~"don't optimize me out"); + debug!(~"don't optimize me out"); main(); } diff --git a/src/test/run-fail/unwind-box-fn-unique.rs b/src/test/run-fail/unwind-box-fn-unique.rs index 326c304ef3b75..4ab74b485ab74 100644 --- a/src/test/run-fail/unwind-box-fn-unique.rs +++ b/src/test/run-fail/unwind-box-fn-unique.rs @@ -17,8 +17,8 @@ fn failfn() { fn main() { let y = ~0; let x: @~fn() = @(|| { - log(error, copy y); + error!(copy y); }); failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-fn.rs b/src/test/run-fail/unwind-box-fn.rs index a2227e6c94ac2..c62e13e77d7b2 100644 --- a/src/test/run-fail/unwind-box-fn.rs +++ b/src/test/run-fail/unwind-box-fn.rs @@ -17,8 +17,8 @@ fn failfn() { fn main() { let y = ~0; let x: @@fn() = @|| { - log(error, copy y); + error!(copy y); }; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index ba8f2fa37cb3b..e576faa16ea81 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -39,6 +39,6 @@ fn main() { cast::forget(i1); let x = @r(i1p); failfn(); - log(error, x); + error!(x); } } diff --git a/src/test/run-fail/unwind-box-str.rs b/src/test/run-fail/unwind-box-str.rs index aaf714fff9c4c..213220164f102 100644 --- a/src/test/run-fail/unwind-box-str.rs +++ b/src/test/run-fail/unwind-box-str.rs @@ -17,5 +17,5 @@ fn failfn() { fn main() { let x = @~"hi"; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-trait.rs b/src/test/run-fail/unwind-box-trait.rs index 905670f8fb7b6..5c8edb910089b 100644 --- a/src/test/run-fail/unwind-box-trait.rs +++ b/src/test/run-fail/unwind-box-trait.rs @@ -25,5 +25,5 @@ impl i for ~int { fn main() { let x = @~0 as @i; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-unique-unique.rs b/src/test/run-fail/unwind-box-unique-unique.rs index 22a5c72b68cf2..12b00f0c14b9f 100644 --- a/src/test/run-fail/unwind-box-unique-unique.rs +++ b/src/test/run-fail/unwind-box-unique-unique.rs @@ -17,5 +17,5 @@ fn failfn() { fn main() { let x = @~~0; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-unique.rs b/src/test/run-fail/unwind-box-unique.rs index 3ae4000c2b1bd..edc6ab9d984c7 100644 --- a/src/test/run-fail/unwind-box-unique.rs +++ b/src/test/run-fail/unwind-box-unique.rs @@ -17,5 +17,5 @@ fn failfn() { fn main() { let x = @~0; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-fail/unwind-box-vec.rs b/src/test/run-fail/unwind-box-vec.rs index d8afdd5a6614d..0a579a8dbbfb2 100644 --- a/src/test/run-fail/unwind-box-vec.rs +++ b/src/test/run-fail/unwind-box-vec.rs @@ -17,5 +17,5 @@ fn failfn() { fn main() { let x = @~[0, 1, 2, 3, 4, 5]; failfn(); - log(error, x); + error!(x); } diff --git a/src/test/run-pass/alt-bot.rs b/src/test/run-pass/alt-bot.rs index d4887c4415e63..78892a1e4b849 100644 --- a/src/test/run-pass/alt-bot.rs +++ b/src/test/run-pass/alt-bot.rs @@ -12,5 +12,5 @@ pub fn main() { let i: int = match Some::(3) { None:: => { fail!() } Some::(_) => { 5 } }; - log(debug, i); + debug!("%?", i); } diff --git a/src/test/run-pass/alt-pattern-drop.rs b/src/test/run-pass/alt-pattern-drop.rs index 97b835f55be5e..131869a0c4ef4 100644 --- a/src/test/run-pass/alt-pattern-drop.rs +++ b/src/test/run-pass/alt-pattern-drop.rs @@ -19,12 +19,12 @@ fn foo(s: @int) { match x { make_t(y) => { - log(debug, y); // ref up then down + debug!("%?", y); // ref up then down } _ => { debug!("?"); fail!(); } } - log(debug, ::core::sys::refcount(s)); + debug!(::core::sys::refcount(s)); fail_unless!((::core::sys::refcount(s) == count + 1u)); let _ = ::core::sys::refcount(s); // don't get bitten by last-use. } @@ -36,7 +36,7 @@ pub fn main() { foo(s); // ref up then down - log(debug, ::core::sys::refcount(s)); + debug!("%u", ::core::sys::refcount(s)); let count2 = ::core::sys::refcount(s); let _ = ::core::sys::refcount(s); // don't get bitten by last-use. fail_unless!(count == count2); diff --git a/src/test/run-pass/alt-tag.rs b/src/test/run-pass/alt-tag.rs index aff2d9ad56483..8051a14dac875 100644 --- a/src/test/run-pass/alt-tag.rs +++ b/src/test/run-pass/alt-tag.rs @@ -21,9 +21,9 @@ enum color { fn process(c: color) -> int { let mut x: int; match c { - rgb(r, _, _) => { debug!("rgb"); log(debug, r); x = r; } - rgba(_, _, _, a) => { debug!("rgba"); log(debug, a); x = a; } - hsl(_, s, _) => { debug!("hsl"); log(debug, s); x = s; } + rgb(r, _, _) => { x = r; } + rgba(_, _, _, a) => { x = a; } + hsl(_, s, _) => { x = s; } } return x; } diff --git a/src/test/run-pass/alt-with-ret-arm.rs b/src/test/run-pass/alt-with-ret-arm.rs index ccdbc744ca33f..ad4d87fb87c80 100644 --- a/src/test/run-pass/alt-with-ret-arm.rs +++ b/src/test/run-pass/alt-with-ret-arm.rs @@ -17,5 +17,5 @@ pub fn main() { Some(num) => num as u32 }; fail_unless!(f == 1234u32); - log(error, f) + error!(f) } diff --git a/src/test/run-pass/arith-0.rs b/src/test/run-pass/arith-0.rs index 0725ac2e174ef..adfc1033d972b 100644 --- a/src/test/run-pass/arith-0.rs +++ b/src/test/run-pass/arith-0.rs @@ -12,6 +12,6 @@ pub fn main() { let a: int = 10; - log(debug, a); + debug!(a); fail_unless!((a * (a - 1) == 90)); } diff --git a/src/test/run-pass/arith-1.rs b/src/test/run-pass/arith-1.rs index 3dc60d63bbe9e..1b98cf4dc5c39 100644 --- a/src/test/run-pass/arith-1.rs +++ b/src/test/run-pass/arith-1.rs @@ -28,6 +28,6 @@ pub fn main() { fail_unless!((i32_b << 1 == i32_b << 1)); fail_unless!((i32_b >> 1 == i32_b >> 1)); fail_unless!((i32_b & i32_b << 1 == 0)); - log(debug, i32_b | i32_b << 1); + debug!(i32_b | i32_b << 1); fail_unless!((i32_b | i32_b << 1 == 0x30303030)); } diff --git a/src/test/run-pass/auto-instantiate.rs b/src/test/run-pass/auto-instantiate.rs index 4075ec5603813..973f1dedea22a 100644 --- a/src/test/run-pass/auto-instantiate.rs +++ b/src/test/run-pass/auto-instantiate.rs @@ -19,6 +19,6 @@ struct Triple { x: int, y: int, z: int } fn f(x: T, y: U) -> Pair { return Pair {a: x, b: y}; } pub fn main() { - log(debug, f(Triple {x: 3, y: 4, z: 5}, 4).a.x); - log(debug, f(5, 6).a); + debug!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x); + debug!("%?", f(5, 6).a); } diff --git a/src/test/run-pass/bitwise.rs b/src/test/run-pass/bitwise.rs index a2caf5e97f57b..ec324bcf33bcc 100644 --- a/src/test/run-pass/bitwise.rs +++ b/src/test/run-pass/bitwise.rs @@ -26,8 +26,8 @@ fn general() { a ^= b; b ^= a; a = a ^ b; - log(debug, a); - log(debug, b); + debug!(a); + debug!(b); fail_unless!((b == 1)); fail_unless!((a == 2)); fail_unless!((!0xf0 & 0xff == 0xf)); diff --git a/src/test/run-pass/block-arg.rs b/src/test/run-pass/block-arg.rs index fa4a61549dc67..fa8687e839ca2 100644 --- a/src/test/run-pass/block-arg.rs +++ b/src/test/run-pass/block-arg.rs @@ -14,7 +14,7 @@ pub fn main() { // Statement form does not require parentheses: for vec::each(v) |i| { - log(info, *i); + info!("%?", *i); } // Usable at all: diff --git a/src/test/run-pass/block-explicit-types.rs b/src/test/run-pass/block-explicit-types.rs index b24a655667a6b..ff65d963000fd 100644 --- a/src/test/run-pass/block-explicit-types.rs +++ b/src/test/run-pass/block-explicit-types.rs @@ -10,5 +10,5 @@ pub fn main() { fn as_buf(s: ~str, f: &fn(~str) -> T) -> T { f(s) } - as_buf(~"foo", |foo: ~str| -> () log(error, foo) ); + as_buf(~"foo", |foo: ~str| -> () error!(foo) ); } diff --git a/src/test/run-pass/block-iter-1.rs b/src/test/run-pass/block-iter-1.rs index d0a24f80c0b90..e60563827795b 100644 --- a/src/test/run-pass/block-iter-1.rs +++ b/src/test/run-pass/block-iter-1.rs @@ -16,12 +16,10 @@ pub fn main() { let v = ~[1, 2, 3, 4, 5, 6, 7]; let mut odds = 0; iter_vec(v, |i| { - log(error, i); if *i % 2 == 1 { odds += 1; } - log(error, odds); }); - log(error, odds); + error!(odds); fail_unless!((odds == 4)); } diff --git a/src/test/run-pass/block-iter-2.rs b/src/test/run-pass/block-iter-2.rs index acffb6830dede..9e9eef6499289 100644 --- a/src/test/run-pass/block-iter-2.rs +++ b/src/test/run-pass/block-iter-2.rs @@ -17,10 +17,9 @@ pub fn main() { let mut sum = 0; iter_vec(copy v, |i| { iter_vec(copy v, |j| { - log(error, *i * *j); sum += *i * *j; }); }); - log(error, sum); + error!(sum); fail_unless!((sum == 225)); } diff --git a/src/test/run-pass/block-vec-map2.rs b/src/test/run-pass/block-vec-map2.rs index 24f990ef7cdcc..58e09409fc545 100644 --- a/src/test/run-pass/block-vec-map2.rs +++ b/src/test/run-pass/block-vec-map2.rs @@ -15,6 +15,6 @@ pub fn main() { vec::map2(~[1, 2, 3, 4, 5], ~[true, false, false, true, true], |i, b| if *b { -(*i) } else { *i } ); - log(error, copy v); + error!(copy v); fail_unless!((v == ~[-1, 2, 3, -4, -5])); } diff --git a/src/test/run-pass/comm.rs b/src/test/run-pass/comm.rs index c9c0456220103..601bae85d4fc2 100644 --- a/src/test/run-pass/comm.rs +++ b/src/test/run-pass/comm.rs @@ -16,7 +16,7 @@ pub fn main() { let t = task::spawn(|| child(&ch) ); let y = p.recv(); error!("received"); - log(error, y); + error!(y); fail_unless!((y == 10)); } diff --git a/src/test/run-pass/complex.rs b/src/test/run-pass/complex.rs index de60a56ba4aee..733e8466154fa 100644 --- a/src/test/run-pass/complex.rs +++ b/src/test/run-pass/complex.rs @@ -37,7 +37,7 @@ fn foo(x: int) -> int { pub fn main() { let x: int = 2 + 2; - log(debug, x); + debug!("%?", x); debug!("hello, world"); - log(debug, 10); + debug!("%?", 10); } diff --git a/src/test/run-pass/const.rs b/src/test/run-pass/const.rs index 28cca2f413b7b..e935a2cd434d9 100644 --- a/src/test/run-pass/const.rs +++ b/src/test/run-pass/const.rs @@ -12,4 +12,4 @@ const i: int = 10; -pub fn main() { log(debug, i); } +pub fn main() { debug!("%i", i); } diff --git a/src/test/run-pass/deref-lval.rs b/src/test/run-pass/deref-lval.rs index ec5cc6293e43e..6841c4d7f631b 100644 --- a/src/test/run-pass/deref-lval.rs +++ b/src/test/run-pass/deref-lval.rs @@ -10,4 +10,4 @@ -pub fn main() { let x = @mut 5; *x = 1000; log(debug, *x); } +pub fn main() { let x = @mut 5; *x = 1000; debug!("%?", *x); } diff --git a/src/test/run-pass/estr-slice.rs b/src/test/run-pass/estr-slice.rs index 3e6b5fca0d26b..869ea6007c2a1 100644 --- a/src/test/run-pass/estr-slice.rs +++ b/src/test/run-pass/estr-slice.rs @@ -14,8 +14,8 @@ pub fn main() { let v = &"hello"; let mut y : &str = &"there"; - log(debug, x); - log(debug, y); + debug!(x); + debug!(y); fail_unless!(x[0] == 'h' as u8); fail_unless!(x[4] == 'o' as u8); @@ -30,7 +30,7 @@ pub fn main() { let c = &"cccc"; let cc = &"ccccc"; - log(debug, a); + debug!(a); fail_unless!(a < b); fail_unless!(a <= b); @@ -38,7 +38,7 @@ pub fn main() { fail_unless!(b >= a); fail_unless!(b > a); - log(debug, b); + debug!(b); fail_unless!(a < c); fail_unless!(a <= c); @@ -46,7 +46,7 @@ pub fn main() { fail_unless!(c >= a); fail_unless!(c > a); - log(debug, c); + debug!(c); fail_unless!(c < cc); fail_unless!(c <= cc); @@ -54,5 +54,5 @@ pub fn main() { fail_unless!(cc >= c); fail_unless!(cc > c); - log(debug, cc); + debug!(cc); } diff --git a/src/test/run-pass/evec-slice.rs b/src/test/run-pass/evec-slice.rs index 0ca9af6c03abf..0d14670a6db11 100644 --- a/src/test/run-pass/evec-slice.rs +++ b/src/test/run-pass/evec-slice.rs @@ -20,7 +20,7 @@ pub fn main() { let c : &[int] = &[2,2,2,2,3]; let cc : &[int] = &[2,2,2,2,2,2]; - log(debug, a); + debug!(a); fail_unless!(a < b); fail_unless!(a <= b); @@ -28,7 +28,7 @@ pub fn main() { fail_unless!(b >= a); fail_unless!(b > a); - log(debug, b); + debug!(b); fail_unless!(b < c); fail_unless!(b <= c); @@ -42,7 +42,7 @@ pub fn main() { fail_unless!(c >= a); fail_unless!(c > a); - log(debug, c); + debug!(c); fail_unless!(a < cc); fail_unless!(a <= cc); @@ -50,5 +50,5 @@ pub fn main() { fail_unless!(cc >= a); fail_unless!(cc > a); - log(debug, cc); + debug!(cc); } diff --git a/src/test/run-pass/expr-block-generic-box1.rs b/src/test/run-pass/expr-block-generic-box1.rs index 925c1b2cc4d73..6aca1b994d940 100644 --- a/src/test/run-pass/expr-block-generic-box1.rs +++ b/src/test/run-pass/expr-block-generic-box1.rs @@ -21,8 +21,8 @@ fn test_generic(expected: @T, eq: compare) { fn test_box() { fn compare_box(b1: @bool, b2: @bool) -> bool { - log(debug, *b1); - log(debug, *b2); + debug!(*b1); + debug!(*b2); return *b1 == *b2; } test_generic::(@true, compare_box); diff --git a/src/test/run-pass/expr-block-generic-unique1.rs b/src/test/run-pass/expr-block-generic-unique1.rs index 9600d36bbbb2b..b186d99a6dfe4 100644 --- a/src/test/run-pass/expr-block-generic-unique1.rs +++ b/src/test/run-pass/expr-block-generic-unique1.rs @@ -20,8 +20,8 @@ fn test_generic(expected: ~T, eq: compare) { fn test_box() { fn compare_box(b1: ~bool, b2: ~bool) -> bool { - log(debug, *b1); - log(debug, *b2); + debug!(*b1); + debug!(*b2); return *b1 == *b2; } test_generic::(~true, compare_box); diff --git a/src/test/run-pass/fact.rs b/src/test/run-pass/fact.rs index 21ac3fcdf5f93..958e2e1e79e8a 100644 --- a/src/test/run-pass/fact.rs +++ b/src/test/run-pass/fact.rs @@ -15,7 +15,7 @@ fn f(x: int) -> int { // debug!("in f:"); - log(debug, x); + debug!(x); if x == 1 { // debug!("bottoming out"); @@ -26,7 +26,7 @@ fn f(x: int) -> int { let y: int = x * f(x - 1); // debug!("returned"); - log(debug, y); + debug!(y); return y; } } diff --git a/src/test/run-pass/fat-arrow-alt.rs b/src/test/run-pass/fat-arrow-alt.rs index 0c19655c9f521..4b8b552bfaed3 100644 --- a/src/test/run-pass/fat-arrow-alt.rs +++ b/src/test/run-pass/fat-arrow-alt.rs @@ -17,7 +17,7 @@ enum color { } pub fn main() { - log(error, match red { + error!(match red { red => { 1 } green => { 2 } blue => { 3 } diff --git a/src/test/run-pass/float-signature.rs b/src/test/run-pass/float-signature.rs index aeb94760e6380..7d4c3db242da7 100644 --- a/src/test/run-pass/float-signature.rs +++ b/src/test/run-pass/float-signature.rs @@ -14,5 +14,5 @@ pub fn main() { fn foo(n: float) -> float { return n + 0.12345; } let n: float = 0.1; let m: float = foo(n); - log(debug, m); + debug!(m); } diff --git a/src/test/run-pass/float.rs b/src/test/run-pass/float.rs index 53e19b62a28f5..1c2d7f42264a5 100644 --- a/src/test/run-pass/float.rs +++ b/src/test/run-pass/float.rs @@ -12,7 +12,7 @@ pub fn main() { let pi = 3.1415927; - log(debug, -pi * (pi + 2.0 / pi) - pi * 5.0); + debug!(-pi * (pi + 2.0 / pi) - pi * 5.0); if pi == 5.0 || pi < 10.0 || pi <= 2.0 || pi != 22.0 / 7.0 || pi >= 10.0 || pi > 1.0 { debug!("yes"); diff --git a/src/test/run-pass/foreach-put-structured.rs b/src/test/run-pass/foreach-put-structured.rs index 1a71cf52de259..dfee55571243d 100644 --- a/src/test/run-pass/foreach-put-structured.rs +++ b/src/test/run-pass/foreach-put-structured.rs @@ -21,8 +21,8 @@ pub fn main() { let mut j: int = 0; do pairs() |p| { let (_0, _1) = p; - log(debug, _0); - log(debug, _1); + debug!(_0); + debug!(_1); fail_unless!((_0 + 10 == i)); i += 1; j = _1; diff --git a/src/test/run-pass/foreach-simple-outer-slot.rs b/src/test/run-pass/foreach-simple-outer-slot.rs index 1c0b28982dbe1..7e07232c32f25 100644 --- a/src/test/run-pass/foreach-simple-outer-slot.rs +++ b/src/test/run-pass/foreach-simple-outer-slot.rs @@ -14,9 +14,9 @@ // -*- rust -*- pub fn main() { let mut sum: int = 0; - do first_ten |i| { debug!("main"); log(debug, i); sum = sum + i; } + do first_ten |i| { debug!("main"); debug!(i); sum = sum + i; } debug!("sum"); - log(debug, sum); + debug!(sum); fail_unless!((sum == 45)); } diff --git a/src/test/run-pass/generic-alias-box.rs b/src/test/run-pass/generic-alias-box.rs index 1d791471f8f33..3da699640aca4 100644 --- a/src/test/run-pass/generic-alias-box.rs +++ b/src/test/run-pass/generic-alias-box.rs @@ -15,6 +15,6 @@ fn id(t: T) -> T { return t; } pub fn main() { let expected = @100; let actual = id::<@int>(expected); - log(debug, *actual); + debug!(*actual); fail_unless!((*expected == *actual)); } diff --git a/src/test/run-pass/generic-alias-unique.rs b/src/test/run-pass/generic-alias-unique.rs index f09780706b907..7e0b32d8e8f65 100644 --- a/src/test/run-pass/generic-alias-unique.rs +++ b/src/test/run-pass/generic-alias-unique.rs @@ -15,6 +15,6 @@ fn id(t: T) -> T { return t; } pub fn main() { let expected = ~100; let actual = id::<~int>(copy expected); - log(debug, *actual); + debug!(*actual); fail_unless!((*expected == *actual)); } diff --git a/src/test/run-pass/generic-derived-type.rs b/src/test/run-pass/generic-derived-type.rs index 003b760465d16..e58fd884da6c0 100644 --- a/src/test/run-pass/generic-derived-type.rs +++ b/src/test/run-pass/generic-derived-type.rs @@ -22,8 +22,8 @@ fn f(t: T) -> Pair { pub fn main() { let b = f::(10); - log(debug, b.a); - log(debug, b.b); + debug!(b.a); + debug!(b.b); fail_unless!((b.a == 10)); fail_unless!((b.b == 10)); } diff --git a/src/test/run-pass/generic-fn-box.rs b/src/test/run-pass/generic-fn-box.rs index 0a496b2bcf5ec..85d8198049f1d 100644 --- a/src/test/run-pass/generic-fn-box.rs +++ b/src/test/run-pass/generic-fn-box.rs @@ -12,4 +12,4 @@ fn f(x: @T) -> @T { return x; } -pub fn main() { let x = f(@3); log(debug, *x); } +pub fn main() { let x = f(@3); debug!(*x); } diff --git a/src/test/run-pass/generic-fn-unique.rs b/src/test/run-pass/generic-fn-unique.rs index d41cd86bcc147..9892c935658e2 100644 --- a/src/test/run-pass/generic-fn-unique.rs +++ b/src/test/run-pass/generic-fn-unique.rs @@ -11,4 +11,4 @@ fn f(x: ~T) -> ~T { return x; } -pub fn main() { let x = f(~3); log(debug, *x); } +pub fn main() { let x = f(~3); debug!(*x); } diff --git a/src/test/run-pass/generic-fn.rs b/src/test/run-pass/generic-fn.rs index 8f0158df642af..4c0248c488f9e 100644 --- a/src/test/run-pass/generic-fn.rs +++ b/src/test/run-pass/generic-fn.rs @@ -24,14 +24,14 @@ pub fn main() { let p: Triple = Triple {x: 65, y: 66, z: 67}; let mut q: Triple = Triple {x: 68, y: 69, z: 70}; y = id::(x); - log(debug, y); + debug!(y); fail_unless!((x == y)); b = id::(a); - log(debug, b); + debug!(b); fail_unless!((a == b)); q = id::(p); x = p.z; y = q.z; - log(debug, y); + debug!(y); fail_unless!((x == y)); } diff --git a/src/test/run-pass/generic-tag-values.rs b/src/test/run-pass/generic-tag-values.rs index 56395bf8cb093..30738ee33fdfb 100644 --- a/src/test/run-pass/generic-tag-values.rs +++ b/src/test/run-pass/generic-tag-values.rs @@ -18,12 +18,12 @@ struct Pair { x: int, y: int } pub fn main() { let nop: noption = some::(5); - match nop { some::(n) => { log(debug, n); fail_unless!((n == 5)); } } + match nop { some::(n) => { debug!(n); fail_unless!((n == 5)); } } let nop2: noption = some(Pair{x: 17, y: 42}); match nop2 { some(t) => { - log(debug, t.x); - log(debug, t.y); + debug!(t.x); + debug!(t.y); fail_unless!((t.x == 17)); fail_unless!((t.y == 42)); } diff --git a/src/test/run-pass/generic-temporary.rs b/src/test/run-pass/generic-temporary.rs index 5c9d63610a819..ce419ff002f9c 100644 --- a/src/test/run-pass/generic-temporary.rs +++ b/src/test/run-pass/generic-temporary.rs @@ -12,7 +12,7 @@ fn mk() -> int { return 1; } -fn chk(a: int) { log(debug, a); fail_unless!((a == 1)); } +fn chk(a: int) { debug!(a); fail_unless!((a == 1)); } fn apply(produce: extern fn() -> T, consume: extern fn(T)) { diff --git a/src/test/run-pass/generic-tup.rs b/src/test/run-pass/generic-tup.rs index bb4e5ea14adb6..e80bc8da7174f 100644 --- a/src/test/run-pass/generic-tup.rs +++ b/src/test/run-pass/generic-tup.rs @@ -11,7 +11,7 @@ fn get_third(t: (T, T, T)) -> T { let (_, _, x) = t; return x; } pub fn main() { - log(debug, get_third((1, 2, 3))); + debug!(get_third((1, 2, 3))); fail_unless!((get_third((1, 2, 3)) == 3)); fail_unless!((get_third((5u8, 6u8, 7u8)) == 7u8)); } diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index 72d4ab7aeabc9..9254641212073 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -57,7 +57,7 @@ mod map_reduce { ctrl.send(find_reducer(str::to_bytes(key), cc)); error!("receiving"); c = pp.recv(); - log(error, c); + error!(c); im.insert(key, c); } } diff --git a/src/test/run-pass/if-bot.rs b/src/test/run-pass/if-bot.rs index 8c6a82b41441b..8f00b16ccd9f5 100644 --- a/src/test/run-pass/if-bot.rs +++ b/src/test/run-pass/if-bot.rs @@ -12,5 +12,5 @@ pub fn main() { let i: int = if false { fail!() } else { 5 }; - log(debug, i); + debug!(i); } diff --git a/src/test/run-pass/if-check.rs b/src/test/run-pass/if-check.rs index 5a516ba98619e..3ee0808fa95a4 100644 --- a/src/test/run-pass/if-check.rs +++ b/src/test/run-pass/if-check.rs @@ -16,7 +16,7 @@ pure fn even(x: uint) -> bool { fn foo(x: uint) { if even(x) { - log(debug, x); + debug!(x); } else { fail!(); } diff --git a/src/test/run-pass/import-in-block.rs b/src/test/run-pass/import-in-block.rs index a6d8eac3bd163..659b7b5be6f65 100644 --- a/src/test/run-pass/import-in-block.rs +++ b/src/test/run-pass/import-in-block.rs @@ -10,9 +10,9 @@ pub fn main() { use core::vec::from_fn; - log(debug, ::core::vec::len(from_fn(2, |i| i))); + debug!(::core::vec::len(from_fn(2, |i| i))); { use core::vec::*; - log(debug, len(~[2])); + debug!(len(~[2])); } } diff --git a/src/test/run-pass/import.rs b/src/test/run-pass/import.rs index be515172de128..317082b1d820d 100644 --- a/src/test/run-pass/import.rs +++ b/src/test/run-pass/import.rs @@ -11,7 +11,7 @@ // except according to those terms. mod foo { - pub fn x(y: int) { log(debug, y); } + pub fn x(y: int) { debug!(y); } } mod bar { diff --git a/src/test/run-pass/import8.rs b/src/test/run-pass/import8.rs index 229374c861e14..869e61d0d4cd0 100644 --- a/src/test/run-pass/import8.rs +++ b/src/test/run-pass/import8.rs @@ -15,7 +15,7 @@ use foo::x; use z = foo::x; mod foo { - pub fn x(y: int) { log(debug, y); } + pub fn x(y: int) { debug!(y); } } pub fn main() { x(10); z(10); } diff --git a/src/test/run-pass/integral-indexing.rs b/src/test/run-pass/integral-indexing.rs index e4b195a0204d6..711e4e9cdf41f 100644 --- a/src/test/run-pass/integral-indexing.rs +++ b/src/test/run-pass/integral-indexing.rs @@ -20,11 +20,11 @@ pub fn main() { fail_unless!((v[3i8] == 3)); fail_unless!((v[3u32] == 3)); fail_unless!((v[3i32] == 3)); - log(debug, v[3u8]); + debug!(v[3u8]); fail_unless!((s[3u] == 'd' as u8)); fail_unless!((s[3u8] == 'd' as u8)); fail_unless!((s[3i8] == 'd' as u8)); fail_unless!((s[3u32] == 'd' as u8)); fail_unless!((s[3i32] == 'd' as u8)); - log(debug, s[3u8]); + debug!(s[3u8]); } diff --git a/src/test/run-pass/issue-1696.rs b/src/test/run-pass/issue-1696.rs index fb61e34f351e6..8697e5c8c3cf6 100644 --- a/src/test/run-pass/issue-1696.rs +++ b/src/test/run-pass/issue-1696.rs @@ -16,5 +16,5 @@ use std::oldmap::HashMap; pub fn main() { let m = HashMap(); m.insert(str::to_bytes(~"foo"), str::to_bytes(~"bar")); - log(error, m); + error!(m); } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 1376f20571be6..acd30de9e8786 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -301,16 +301,16 @@ pub mod pingpong { fn client(-chan: pingpong::client::ping) { let chan = pingpong::client::do_ping(chan); - log(error, ~"Sent ping"); + error!(~"Sent ping"); let (_chan, _data) = pingpong::client::do_pong(chan); - log(error, ~"Received pong"); + error!(~"Received pong"); } fn server(-chan: pingpong::server::ping) { let (chan, _data) = pingpong::server::do_ping(chan); - log(error, ~"Received ping"); + error!(~"Received ping"); let _chan = pingpong::server::do_pong(chan); - log(error, ~"Sent pong"); + error!(~"Sent pong"); } pub fn main() { diff --git a/src/test/run-pass/issue-3109.rs b/src/test/run-pass/issue-3109.rs index be38e9080e583..6af1075544ecc 100644 --- a/src/test/run-pass/issue-3109.rs +++ b/src/test/run-pass/issue-3109.rs @@ -9,5 +9,5 @@ // except according to those terms. pub fn main() { - log(error, ("hi there!", "you")); + error!(("hi there!", "you")); } diff --git a/src/test/run-pass/istr.rs b/src/test/run-pass/istr.rs index 55ffd15259d39..35c46609f8fd3 100644 --- a/src/test/run-pass/istr.rs +++ b/src/test/run-pass/istr.rs @@ -10,7 +10,7 @@ fn test_stack_assign() { let s: ~str = ~"a"; - log(debug, copy s); + debug!(copy s); let t: ~str = ~"a"; fail_unless!((s == t)); let u: ~str = ~"b"; @@ -27,7 +27,7 @@ fn test_heap_assign() { fail_unless!((s != u)); } -fn test_heap_log() { let s = ~"a big ol' string"; log(debug, s); } +fn test_heap_log() { let s = ~"a big ol' string"; debug!(s); } fn test_stack_add() { fail_unless!((~"a" + ~"b" == ~"ab")); @@ -49,7 +49,7 @@ fn test_append() { let mut s = ~"a"; s += ~"b"; - log(debug, copy s); + debug!(copy s); fail_unless!((s == ~"ab")); let mut s = ~"c"; diff --git a/src/test/run-pass/iter-range.rs b/src/test/run-pass/iter-range.rs index 0ec8eea52365f..983f47e8ab7ec 100644 --- a/src/test/run-pass/iter-range.rs +++ b/src/test/run-pass/iter-range.rs @@ -19,5 +19,5 @@ fn range(a: int, b: int, it: &fn(int)) { pub fn main() { let mut sum: int = 0; range(0, 100, |x| sum += x ); - log(debug, sum); + debug!(sum); } diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs index a1f57b380c17d..3f94600ea17d3 100644 --- a/src/test/run-pass/lambda-infer-unresolved.rs +++ b/src/test/run-pass/lambda-infer-unresolved.rs @@ -16,6 +16,6 @@ struct Refs { refs: ~[int], n: int } pub fn main() { let e = @mut Refs{refs: ~[], n: 0}; - let f: @fn() = || log(error, e.n); + let f: @fn() = || error!(e.n); e.refs += ~[1]; } diff --git a/src/test/run-pass/lambda-no-leak.rs b/src/test/run-pass/lambda-no-leak.rs index 2dc7079af5327..e19503240f024 100644 --- a/src/test/run-pass/lambda-no-leak.rs +++ b/src/test/run-pass/lambda-no-leak.rs @@ -12,6 +12,6 @@ fn force(f: @fn()) { f() } pub fn main() { let x = 7; - let _f: @fn() = || log(error, x); - force(|| log(error, x)); + let _f: @fn() = || error!(x); + force(|| error!(x)); } diff --git a/src/test/run-pass/last-use-is-capture.rs b/src/test/run-pass/last-use-is-capture.rs index 0535e63fcb494..e05d483f48640 100644 --- a/src/test/run-pass/last-use-is-capture.rs +++ b/src/test/run-pass/last-use-is-capture.rs @@ -16,5 +16,5 @@ pub fn main() { fn invoke(f: @fn()) { f(); } let k = ~22; let _u = A {a: copy k}; - invoke(|| log(error, copy k) ) + invoke(|| error!(copy k) ) } diff --git a/src/test/run-pass/lazy-and-or.rs b/src/test/run-pass/lazy-and-or.rs index b86f7974bc394..e16229eec53d4 100644 --- a/src/test/run-pass/lazy-and-or.rs +++ b/src/test/run-pass/lazy-and-or.rs @@ -16,7 +16,7 @@ pub fn main() { let x = 1 == 2 || 3 == 3; fail_unless!((x)); let mut y: int = 10; - log(debug, x || incr(&mut y)); + debug!(x || incr(&mut y)); fail_unless!((y == 10)); if true && x { fail_unless!((true)); } else { fail_unless!((false)); } } diff --git a/src/test/run-pass/lazy-init.rs b/src/test/run-pass/lazy-init.rs index 0ccecba58c022..37208bf145ba0 100644 --- a/src/test/run-pass/lazy-init.rs +++ b/src/test/run-pass/lazy-init.rs @@ -10,6 +10,6 @@ -fn foo(x: int) { log(debug, x); } +fn foo(x: int) { debug!(x); } pub fn main() { let mut x: int; if 1 > 2 { x = 12; } else { x = 10; } foo(x); } diff --git a/src/test/run-pass/linear-for-loop.rs b/src/test/run-pass/linear-for-loop.rs index c232ab42dfc70..1d8662de7c2a7 100644 --- a/src/test/run-pass/linear-for-loop.rs +++ b/src/test/run-pass/linear-for-loop.rs @@ -13,8 +13,8 @@ pub fn main() { let x = ~[1, 2, 3]; let mut y = 0; - for x.each |i| { log(debug, *i); y += *i; } - log(debug, y); + for x.each |i| { debug!(*i); y += *i; } + debug!(y); fail_unless!((y == 6)); let s = ~"hello there"; let mut i: int = 0; @@ -27,8 +27,8 @@ pub fn main() { // ... i += 1; - log(debug, i); - log(debug, c); + debug!(i); + debug!(c); } fail_unless!((i == 11)); } diff --git a/src/test/run-pass/log-err-phi.rs b/src/test/run-pass/log-err-phi.rs index df4f754ae7ed5..31c0c98fa962d 100644 --- a/src/test/run-pass/log-err-phi.rs +++ b/src/test/run-pass/log-err-phi.rs @@ -10,4 +10,4 @@ -pub fn main() { if false { log(error, ~"foo" + ~"bar"); } } +pub fn main() { if false { error!(~"foo" + ~"bar"); } } diff --git a/src/test/run-pass/log-linearized.rs b/src/test/run-pass/log-linearized.rs index 465e5b63d6bdc..919c53e033066 100644 --- a/src/test/run-pass/log-linearized.rs +++ b/src/test/run-pass/log-linearized.rs @@ -26,7 +26,7 @@ fn mk() -> @mut Smallintmap { fn f() { let mut sim = mk::(); - log(error, sim); + error!(sim); } pub fn main() { diff --git a/src/test/run-pass/loop-break-cont.rs b/src/test/run-pass/loop-break-cont.rs index 753c7c019b598..b0ea375228f4b 100644 --- a/src/test/run-pass/loop-break-cont.rs +++ b/src/test/run-pass/loop-break-cont.rs @@ -11,7 +11,7 @@ pub fn main() { let mut i = 0u; loop { - log(error, ~"a"); + error!(~"a"); i += 1u; if i == 10u { break; @@ -23,7 +23,7 @@ pub fn main() { if i == 21u { break; } - log(error, ~"b"); + error!(~"b"); is_even = false; i += 1u; if i % 2u != 0u { @@ -33,7 +33,7 @@ pub fn main() { } fail_unless!(!is_even); loop { - log(error, ~"c"); + error!(~"c"); if i == 22u { break; } diff --git a/src/test/run-pass/maybe-mutable.rs b/src/test/run-pass/maybe-mutable.rs index c2532369942aa..155046bccccc6 100644 --- a/src/test/run-pass/maybe-mutable.rs +++ b/src/test/run-pass/maybe-mutable.rs @@ -20,7 +20,7 @@ fn len(v: ~[const int]) -> uint { pub fn main() { let v0 = ~[1, 2, 3, 4, 5]; - log(debug, len(v0)); + debug!(len(v0)); let mut v1 = ~[1, 2, 3, 4, 5]; - log(debug, len(v1)); + debug!(len(v1)); } diff --git a/src/test/run-pass/mutable-alias-vec.rs b/src/test/run-pass/mutable-alias-vec.rs index 36f8b4367535b..e08bd5f85a965 100644 --- a/src/test/run-pass/mutable-alias-vec.rs +++ b/src/test/run-pass/mutable-alias-vec.rs @@ -21,6 +21,6 @@ pub fn main() { grow(&mut v); grow(&mut v); let len = vec::len::(v); - log(debug, len); + debug!(len); fail_unless!((len == 3 as uint)); } diff --git a/src/test/run-pass/nested-alts.rs b/src/test/run-pass/nested-alts.rs index 5ba4e1208c85e..dfbd583f16e06 100644 --- a/src/test/run-pass/nested-alts.rs +++ b/src/test/run-pass/nested-alts.rs @@ -16,7 +16,7 @@ fn foo() { Some::(x) => { let mut bar; match None:: { None:: => { bar = 5; } _ => { baz(); } } - log(debug, bar); + debug!(bar); } None:: => { debug!("hello"); } } diff --git a/src/test/run-pass/opeq.rs b/src/test/run-pass/opeq.rs index 3a0d0c2944105..98bec28e398a2 100644 --- a/src/test/run-pass/opeq.rs +++ b/src/test/run-pass/opeq.rs @@ -15,15 +15,15 @@ pub fn main() { let mut x: int = 1; x *= 2; - log(debug, x); + debug!(x); fail_unless!((x == 2)); x += 3; - log(debug, x); + debug!(x); fail_unless!((x == 5)); x *= x; - log(debug, x); + debug!(x); fail_unless!((x == 25)); x /= 5; - log(debug, x); + debug!(x); fail_unless!((x == 5)); } diff --git a/src/test/run-pass/over-constrained-vregs.rs b/src/test/run-pass/over-constrained-vregs.rs index 147569046932d..5f7ae2f755c63 100644 --- a/src/test/run-pass/over-constrained-vregs.rs +++ b/src/test/run-pass/over-constrained-vregs.rs @@ -17,6 +17,6 @@ pub fn main() { while b <= 32u { 0u << b; b <<= 1u; - log(debug, b); + debug!(b); } } diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs index 087926e8da512..0ac899d5e3158 100644 --- a/src/test/run-pass/parse-fail.rs +++ b/src/test/run-pass/parse-fail.rs @@ -12,6 +12,6 @@ // -*- rust -*- -fn dont_call_me() { fail!(); log(debug, 1); } +fn dont_call_me() { fail!(); debug!(1); } pub fn main() { } diff --git a/src/test/run-pass/pass-by-copy.rs b/src/test/run-pass/pass-by-copy.rs index 44ec68dd3468c..c3ab589b66cf7 100644 --- a/src/test/run-pass/pass-by-copy.rs +++ b/src/test/run-pass/pass-by-copy.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -fn magic(+x: A) { log(debug, x); } -fn magic2(+x: @int) { log(debug, x); } +fn magic(+x: A) { debug!(x); } +fn magic2(+x: @int) { debug!(x); } struct A { a: @int } diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index f1686080f4661..266f657de96e4 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -95,18 +95,18 @@ mod test { use pingpong::client; let chan = client::ping(chan); return; - log(error, "Sent ping"); + error!("Sent ping"); let pong(_chan) = recv(chan); - log(error, "Received pong"); + error!("Received pong"); } pub fn server(-chan: ::pingpong::server::ping) { use pingpong::server; let ping(chan) = recv(chan); return; - log(error, "Received ping"); + error!("Received ping"); let _chan = server::pong(chan); - log(error, "Sent pong"); + error!("Sent pong"); } } diff --git a/src/test/run-pass/pipe-pingpong-proto.rs b/src/test/run-pass/pipe-pingpong-proto.rs index c51c073362278..98af23738b7d7 100644 --- a/src/test/run-pass/pipe-pingpong-proto.rs +++ b/src/test/run-pass/pipe-pingpong-proto.rs @@ -33,18 +33,18 @@ mod test { use pingpong::client; let chan = client::ping(chan); - log(error, ~"Sent ping"); + error!(~"Sent ping"); let pong(_chan) = recv(chan); - log(error, ~"Received pong"); + error!(~"Received pong"); } pub fn server(-chan: ::pingpong::server::ping) { use pingpong::server; let ping(chan) = recv(chan); - log(error, ~"Received ping"); + error!(~"Received ping"); let _chan = server::pong(chan); - log(error, ~"Sent pong"); + error!(~"Sent pong"); } } diff --git a/src/test/run-pass/platform_thread.rs b/src/test/run-pass/platform_thread.rs index 40b9a7b92c098..5e4830b0bbdc3 100644 --- a/src/test/run-pass/platform_thread.rs +++ b/src/test/run-pass/platform_thread.rs @@ -18,7 +18,7 @@ pub fn main() { fn run(i: int) { - log(debug, i); + debug!(i); if i == 0 { return; diff --git a/src/test/run-pass/purity-infer.rs b/src/test/run-pass/purity-infer.rs index d546909de8e1e..ce9b3b78a9cda 100644 --- a/src/test/run-pass/purity-infer.rs +++ b/src/test/run-pass/purity-infer.rs @@ -11,5 +11,5 @@ fn something(f: &pure fn()) { f(); } pub fn main() { - something(|| log(error, "hi!") ); + something(|| error!("hi!") ); } diff --git a/src/test/run-pass/rec-auto.rs b/src/test/run-pass/rec-auto.rs index 7dd13001de4eb..fbbec638dd4dc 100644 --- a/src/test/run-pass/rec-auto.rs +++ b/src/test/run-pass/rec-auto.rs @@ -19,6 +19,6 @@ struct X { foo: ~str, bar: ~str } pub fn main() { let x = X {foo: ~"hello", bar: ~"world"}; - log(debug, copy x.foo); - log(debug, copy x.bar); + debug!(copy x.foo); + debug!(copy x.bar); } diff --git a/src/test/run-pass/regions-addr-of-ret.rs b/src/test/run-pass/regions-addr-of-ret.rs index 88a378e7b491c..38e0ac021391c 100644 --- a/src/test/run-pass/regions-addr-of-ret.rs +++ b/src/test/run-pass/regions-addr-of-ret.rs @@ -14,6 +14,6 @@ fn f(x : &a/int) -> &a/int { pub fn main() { let three = &3; - log(error, fmt!("%d", *f(three))); + error!(fmt!("%d", *f(three))); } diff --git a/src/test/run-pass/regions-self-impls.rs b/src/test/run-pass/regions-self-impls.rs index 22eec65b02a07..6b5634fbd5000 100644 --- a/src/test/run-pass/regions-self-impls.rs +++ b/src/test/run-pass/regions-self-impls.rs @@ -22,7 +22,7 @@ impl<'self> get_chowder<'self> for Clam<'self> { pub fn main() { let clam = Clam { chowder: &3 }; - log(debug, *clam.get_chowder()); + debug!(*clam.get_chowder()); clam.get_chowder(); } diff --git a/src/test/run-pass/regions-self-in-enums.rs b/src/test/run-pass/regions-self-in-enums.rs index 6f1044e305407..e71dbb0054bcc 100644 --- a/src/test/run-pass/regions-self-in-enums.rs +++ b/src/test/run-pass/regions-self-in-enums.rs @@ -19,6 +19,6 @@ pub fn main() { match y { int_wrapper_ctor(zz) => { z = zz; } } - log(debug, *z); + debug!(*z); } diff --git a/src/test/run-pass/regions-simple.rs b/src/test/run-pass/regions-simple.rs index c32e08fc76bf4..f7a50e6b114a3 100644 --- a/src/test/run-pass/regions-simple.rs +++ b/src/test/run-pass/regions-simple.rs @@ -12,7 +12,7 @@ pub fn main() { let mut x: int = 3; let y: &mut int = &mut x; *y = 5; - log (debug, *y); + debug!(*y); } diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index f4ba34807d355..df084c134277f 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -31,7 +31,7 @@ pub fn main() { let a = r(i); let b = (a, 10); let (c, _d) = b; - log(debug, c); + debug!(c); } fail_unless!(*i == 1); } diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 9894d2382ddc4..074415375dc12 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -14,7 +14,7 @@ struct shrinky_pointer { impl Drop for shrinky_pointer { fn finalize(&self) { - log(error, ~"Hello!"); **(self.i) -= 1; + error!(~"Hello!"); **(self.i) -= 1; } } @@ -31,6 +31,6 @@ fn shrinky_pointer(i: @@mut int) -> shrinky_pointer { pub fn main() { let my_total = @@mut 10; { let pt = shrinky_pointer(my_total); fail_unless!((pt.look_at() == 10)); } - log(error, fmt!("my_total = %d", **my_total)); + error!("my_total = %d", **my_total); fail_unless!((**my_total == 9)); } diff --git a/src/test/run-pass/ret-bang.rs b/src/test/run-pass/ret-bang.rs index 167c4c14a1e51..881294c4f3342 100644 --- a/src/test/run-pass/ret-bang.rs +++ b/src/test/run-pass/ret-bang.rs @@ -12,7 +12,7 @@ // -*- rust -*- -fn my_err(s: ~str) -> ! { log(error, s); fail!(); } +fn my_err(s: ~str) -> ! { error!(s); fail!(); } fn okay(i: uint) -> int { if i == 3u { my_err(~"I don't like three"); } else { return 42; } diff --git a/src/test/run-pass/sendfn-generic-fn.rs b/src/test/run-pass/sendfn-generic-fn.rs index 08434011a1c2a..6322d24ffd913 100644 --- a/src/test/run-pass/sendfn-generic-fn.rs +++ b/src/test/run-pass/sendfn-generic-fn.rs @@ -20,12 +20,12 @@ fn make_generic_record(a: A, b: B) -> Pair { fn test05_start(f: &~fn(v: float, v: ~str) -> Pair) { let p = (*f)(22.22f, ~"Hi"); - log(debug, copy p); + debug!(copy p); fail_unless!(p.a == 22.22f); fail_unless!(p.b == ~"Hi"); let q = (*f)(44.44f, ~"Ho"); - log(debug, copy q); + debug!(copy q); fail_unless!(q.a == 44.44f); fail_unless!(q.b == ~"Ho"); } diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs index 726efd2946dea..a4d88e7f25b34 100644 --- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs +++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs @@ -17,7 +17,7 @@ fn test05_start(&&f: ~fn(int)) { fn test05() { let three = ~3; let fn_to_send: ~fn(int) = |n| { - log(error, *three + n); // will copy x into the closure + error!(*three + n); // will copy x into the closure fail_unless!((*three == 3)); }; task::spawn(|| { diff --git a/src/test/run-pass/shadow.rs b/src/test/run-pass/shadow.rs index 0c6ab3c65b186..716138a30ed36 100644 --- a/src/test/run-pass/shadow.rs +++ b/src/test/run-pass/shadow.rs @@ -17,7 +17,7 @@ fn foo(c: ~[int]) { match none:: { some::(_) => { for c.each |i| { - log(debug, a); + debug!(a); let a = 17; b += ~[a]; } diff --git a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs index 578e8d9318f43..25ac00d174f34 100644 --- a/src/test/run-pass/shape_intrinsic_tag_then_rec.rs +++ b/src/test/run-pass/shape_intrinsic_tag_then_rec.rs @@ -39,6 +39,6 @@ pub fn main() { let p_: Path_ = Path_ { global: true, idents: ~[~"hi"], types: ~[t] }; let p: path = Spanned { data: p_, span: sp }; let x = X { sp: sp, path: p }; - log(error, copy x.path); - log(error, copy x); + error!(copy x.path); + error!(copy x); } diff --git a/src/test/run-pass/simple-infer.rs b/src/test/run-pass/simple-infer.rs index 137c973d590a1..e7115a41179ee 100644 --- a/src/test/run-pass/simple-infer.rs +++ b/src/test/run-pass/simple-infer.rs @@ -10,4 +10,4 @@ -pub fn main() { let mut n; n = 1; log(debug, n); } +pub fn main() { let mut n; n = 1; debug!(n); } diff --git a/src/test/run-pass/size-and-align.rs b/src/test/run-pass/size-and-align.rs index 89ba351e6e41c..5bc7e18bdd844 100644 --- a/src/test/run-pass/size-and-align.rs +++ b/src/test/run-pass/size-and-align.rs @@ -16,7 +16,7 @@ enum clam { a(T, int), b, } fn uhoh(v: ~[clam]) { match v[1] { - a::(ref t, ref u) => { debug!("incorrect"); log(debug, u); fail!(); } + a::(ref t, ref u) => { debug!("incorrect"); debug!(u); fail!(); } b:: => { debug!("correct"); } } } diff --git a/src/test/run-pass/spawn-fn.rs b/src/test/run-pass/spawn-fn.rs index c2a0015f6e6a9..37501a61066d3 100644 --- a/src/test/run-pass/spawn-fn.rs +++ b/src/test/run-pass/spawn-fn.rs @@ -11,8 +11,8 @@ fn x(s: ~str, n: int) { - log(debug, s); - log(debug, n); + debug!(s); + debug!(n); } pub fn main() { diff --git a/src/test/run-pass/spawn.rs b/src/test/run-pass/spawn.rs index 3128135525802..4da560b8b92ed 100644 --- a/src/test/run-pass/spawn.rs +++ b/src/test/run-pass/spawn.rs @@ -17,7 +17,7 @@ pub fn main() { task::spawn(|| child(10) ); } -fn child(&&i: int) { log(error, i); fail_unless!((i == 10)); } +fn child(&&i: int) { error!(i); fail_unless!((i == 10)); } // Local Variables: // mode: rust; diff --git a/src/test/run-pass/spawn2.rs b/src/test/run-pass/spawn2.rs index 7327c3b84ade8..6bd3af73dd0cd 100644 --- a/src/test/run-pass/spawn2.rs +++ b/src/test/run-pass/spawn2.rs @@ -13,15 +13,15 @@ pub fn main() { task::spawn(|| child((10, 20, 30, 40, 50, 60, 70, 80, 90)) ); } fn child(&&args: (int, int, int, int, int, int, int, int, int)) { let (i1, i2, i3, i4, i5, i6, i7, i8, i9) = args; - log(error, i1); - log(error, i2); - log(error, i3); - log(error, i4); - log(error, i5); - log(error, i6); - log(error, i7); - log(error, i8); - log(error, i9); + error!(i1); + error!(i2); + error!(i3); + error!(i4); + error!(i5); + error!(i6); + error!(i7); + error!(i8); + error!(i9); fail_unless!((i1 == 10)); fail_unless!((i2 == 20)); fail_unless!((i3 == 30)); diff --git a/src/test/run-pass/str-append.rs b/src/test/run-pass/str-append.rs index 085b9c5d34944..230af83d1e156 100644 --- a/src/test/run-pass/str-append.rs +++ b/src/test/run-pass/str-append.rs @@ -16,7 +16,7 @@ extern mod std; fn test1() { let mut s: ~str = ~"hello"; s += ~"world"; - log(debug, copy s); + debug!(copy s); fail_unless!((s[9] == 'd' as u8)); } @@ -26,8 +26,8 @@ fn test2() { let ff: ~str = ~"abc"; let a: ~str = ff + ~"ABC" + ff; let b: ~str = ~"ABC" + ff + ~"ABC"; - log(debug, copy a); - log(debug, copy b); + debug!(copy a); + debug!(copy b); fail_unless!((a == ~"abcABCabc")); fail_unless!((b == ~"ABCabcABC")); } diff --git a/src/test/run-pass/str-concat.rs b/src/test/run-pass/str-concat.rs index 10bec14c285f4..a91f5034f6be6 100644 --- a/src/test/run-pass/str-concat.rs +++ b/src/test/run-pass/str-concat.rs @@ -16,6 +16,6 @@ pub fn main() { let a: ~str = ~"hello"; let b: ~str = ~"world"; let s: ~str = a + b; - log(debug, copy s); + debug!(copy s); fail_unless!((s[9] == 'd' as u8)); } diff --git a/src/test/run-pass/str-idx.rs b/src/test/run-pass/str-idx.rs index a61a7818ca36a..a2146d8770a34 100644 --- a/src/test/run-pass/str-idx.rs +++ b/src/test/run-pass/str-idx.rs @@ -13,6 +13,6 @@ pub fn main() { let s = ~"hello"; let c: u8 = s[4]; - log(debug, c); + debug!(c); fail_unless!((c == 0x6f as u8)); } diff --git a/src/test/run-pass/string-self-append.rs b/src/test/run-pass/string-self-append.rs index f9f700a6ec88b..a1243d33062d4 100644 --- a/src/test/run-pass/string-self-append.rs +++ b/src/test/run-pass/string-self-append.rs @@ -16,7 +16,7 @@ pub fn main() { let mut i = 20; let mut expected_len = 1u; while i > 0 { - log(error, str::len(a)); + error!(str::len(a)); fail_unless!((str::len(a) == expected_len)); a = a + a; // FIXME(#3387)---can't write a += a i -= 1; diff --git a/src/test/run-pass/supported-cast.rs b/src/test/run-pass/supported-cast.rs index cc9214121e90b..791f493b5ccc9 100644 --- a/src/test/run-pass/supported-cast.rs +++ b/src/test/run-pass/supported-cast.rs @@ -10,251 +10,251 @@ pub fn main() { let f = 1 as *libc::FILE; - log(debug, f as int); - log(debug, f as uint); - log(debug, f as i8); - log(debug, f as i16); - log(debug, f as i32); - log(debug, f as i64); - log(debug, f as u8); - log(debug, f as u16); - log(debug, f as u32); - log(debug, f as u64); + debug!(f as int); + debug!(f as uint); + debug!(f as i8); + debug!(f as i16); + debug!(f as i32); + debug!(f as i64); + debug!(f as u8); + debug!(f as u16); + debug!(f as u32); + debug!(f as u64); - log(debug, 1 as int); - log(debug, 1 as uint); - log(debug, 1 as float); - log(debug, 1 as bool); - log(debug, 1 as *libc::FILE); - log(debug, 1 as i8); - log(debug, 1 as i16); - log(debug, 1 as i32); - log(debug, 1 as i64); - log(debug, 1 as u8); - log(debug, 1 as u16); - log(debug, 1 as u32); - log(debug, 1 as u64); - log(debug, 1 as f32); - log(debug, 1 as f64); + debug!(1 as int); + debug!(1 as uint); + debug!(1 as float); + debug!(1 as bool); + debug!(1 as *libc::FILE); + debug!(1 as i8); + debug!(1 as i16); + debug!(1 as i32); + debug!(1 as i64); + debug!(1 as u8); + debug!(1 as u16); + debug!(1 as u32); + debug!(1 as u64); + debug!(1 as f32); + debug!(1 as f64); - log(debug, 1u as int); - log(debug, 1u as uint); - log(debug, 1u as float); - log(debug, 1u as bool); - log(debug, 1u as *libc::FILE); - log(debug, 1u as i8); - log(debug, 1u as i16); - log(debug, 1u as i32); - log(debug, 1u as i64); - log(debug, 1u as u8); - log(debug, 1u as u16); - log(debug, 1u as u32); - log(debug, 1u as u64); - log(debug, 1u as f32); - log(debug, 1u as f64); + debug!(1u as int); + debug!(1u as uint); + debug!(1u as float); + debug!(1u as bool); + debug!(1u as *libc::FILE); + debug!(1u as i8); + debug!(1u as i16); + debug!(1u as i32); + debug!(1u as i64); + debug!(1u as u8); + debug!(1u as u16); + debug!(1u as u32); + debug!(1u as u64); + debug!(1u as f32); + debug!(1u as f64); - log(debug, 1i8 as int); - log(debug, 1i8 as uint); - log(debug, 1i8 as float); - log(debug, 1i8 as bool); - log(debug, 1i8 as *libc::FILE); - log(debug, 1i8 as i8); - log(debug, 1i8 as i16); - log(debug, 1i8 as i32); - log(debug, 1i8 as i64); - log(debug, 1i8 as u8); - log(debug, 1i8 as u16); - log(debug, 1i8 as u32); - log(debug, 1i8 as u64); - log(debug, 1i8 as f32); - log(debug, 1i8 as f64); + debug!(1i8 as int); + debug!(1i8 as uint); + debug!(1i8 as float); + debug!(1i8 as bool); + debug!(1i8 as *libc::FILE); + debug!(1i8 as i8); + debug!(1i8 as i16); + debug!(1i8 as i32); + debug!(1i8 as i64); + debug!(1i8 as u8); + debug!(1i8 as u16); + debug!(1i8 as u32); + debug!(1i8 as u64); + debug!(1i8 as f32); + debug!(1i8 as f64); - log(debug, 1u8 as int); - log(debug, 1u8 as uint); - log(debug, 1u8 as float); - log(debug, 1u8 as bool); - log(debug, 1u8 as *libc::FILE); - log(debug, 1u8 as i8); - log(debug, 1u8 as i16); - log(debug, 1u8 as i32); - log(debug, 1u8 as i64); - log(debug, 1u8 as u8); - log(debug, 1u8 as u16); - log(debug, 1u8 as u32); - log(debug, 1u8 as u64); - log(debug, 1u8 as f32); - log(debug, 1u8 as f64); + debug!(1u8 as int); + debug!(1u8 as uint); + debug!(1u8 as float); + debug!(1u8 as bool); + debug!(1u8 as *libc::FILE); + debug!(1u8 as i8); + debug!(1u8 as i16); + debug!(1u8 as i32); + debug!(1u8 as i64); + debug!(1u8 as u8); + debug!(1u8 as u16); + debug!(1u8 as u32); + debug!(1u8 as u64); + debug!(1u8 as f32); + debug!(1u8 as f64); - log(debug, 1i16 as int); - log(debug, 1i16 as uint); - log(debug, 1i16 as float); - log(debug, 1i16 as bool); - log(debug, 1i16 as *libc::FILE); - log(debug, 1i16 as i8); - log(debug, 1i16 as i16); - log(debug, 1i16 as i32); - log(debug, 1i16 as i64); - log(debug, 1i16 as u8); - log(debug, 1i16 as u16); - log(debug, 1i16 as u32); - log(debug, 1i16 as u64); - log(debug, 1i16 as f32); - log(debug, 1i16 as f64); + debug!(1i16 as int); + debug!(1i16 as uint); + debug!(1i16 as float); + debug!(1i16 as bool); + debug!(1i16 as *libc::FILE); + debug!(1i16 as i8); + debug!(1i16 as i16); + debug!(1i16 as i32); + debug!(1i16 as i64); + debug!(1i16 as u8); + debug!(1i16 as u16); + debug!(1i16 as u32); + debug!(1i16 as u64); + debug!(1i16 as f32); + debug!(1i16 as f64); - log(debug, 1u16 as int); - log(debug, 1u16 as uint); - log(debug, 1u16 as float); - log(debug, 1u16 as bool); - log(debug, 1u16 as *libc::FILE); - log(debug, 1u16 as i8); - log(debug, 1u16 as i16); - log(debug, 1u16 as i32); - log(debug, 1u16 as i64); - log(debug, 1u16 as u8); - log(debug, 1u16 as u16); - log(debug, 1u16 as u32); - log(debug, 1u16 as u64); - log(debug, 1u16 as f32); - log(debug, 1u16 as f64); + debug!(1u16 as int); + debug!(1u16 as uint); + debug!(1u16 as float); + debug!(1u16 as bool); + debug!(1u16 as *libc::FILE); + debug!(1u16 as i8); + debug!(1u16 as i16); + debug!(1u16 as i32); + debug!(1u16 as i64); + debug!(1u16 as u8); + debug!(1u16 as u16); + debug!(1u16 as u32); + debug!(1u16 as u64); + debug!(1u16 as f32); + debug!(1u16 as f64); - log(debug, 1i32 as int); - log(debug, 1i32 as uint); - log(debug, 1i32 as float); - log(debug, 1i32 as bool); - log(debug, 1i32 as *libc::FILE); - log(debug, 1i32 as i8); - log(debug, 1i32 as i16); - log(debug, 1i32 as i32); - log(debug, 1i32 as i64); - log(debug, 1i32 as u8); - log(debug, 1i32 as u16); - log(debug, 1i32 as u32); - log(debug, 1i32 as u64); - log(debug, 1i32 as f32); - log(debug, 1i32 as f64); + debug!(1i32 as int); + debug!(1i32 as uint); + debug!(1i32 as float); + debug!(1i32 as bool); + debug!(1i32 as *libc::FILE); + debug!(1i32 as i8); + debug!(1i32 as i16); + debug!(1i32 as i32); + debug!(1i32 as i64); + debug!(1i32 as u8); + debug!(1i32 as u16); + debug!(1i32 as u32); + debug!(1i32 as u64); + debug!(1i32 as f32); + debug!(1i32 as f64); - log(debug, 1u32 as int); - log(debug, 1u32 as uint); - log(debug, 1u32 as float); - log(debug, 1u32 as bool); - log(debug, 1u32 as *libc::FILE); - log(debug, 1u32 as i8); - log(debug, 1u32 as i16); - log(debug, 1u32 as i32); - log(debug, 1u32 as i64); - log(debug, 1u32 as u8); - log(debug, 1u32 as u16); - log(debug, 1u32 as u32); - log(debug, 1u32 as u64); - log(debug, 1u32 as f32); - log(debug, 1u32 as f64); + debug!(1u32 as int); + debug!(1u32 as uint); + debug!(1u32 as float); + debug!(1u32 as bool); + debug!(1u32 as *libc::FILE); + debug!(1u32 as i8); + debug!(1u32 as i16); + debug!(1u32 as i32); + debug!(1u32 as i64); + debug!(1u32 as u8); + debug!(1u32 as u16); + debug!(1u32 as u32); + debug!(1u32 as u64); + debug!(1u32 as f32); + debug!(1u32 as f64); - log(debug, 1i64 as int); - log(debug, 1i64 as uint); - log(debug, 1i64 as float); - log(debug, 1i64 as bool); - log(debug, 1i64 as *libc::FILE); - log(debug, 1i64 as i8); - log(debug, 1i64 as i16); - log(debug, 1i64 as i32); - log(debug, 1i64 as i64); - log(debug, 1i64 as u8); - log(debug, 1i64 as u16); - log(debug, 1i64 as u32); - log(debug, 1i64 as u64); - log(debug, 1i64 as f32); - log(debug, 1i64 as f64); + debug!(1i64 as int); + debug!(1i64 as uint); + debug!(1i64 as float); + debug!(1i64 as bool); + debug!(1i64 as *libc::FILE); + debug!(1i64 as i8); + debug!(1i64 as i16); + debug!(1i64 as i32); + debug!(1i64 as i64); + debug!(1i64 as u8); + debug!(1i64 as u16); + debug!(1i64 as u32); + debug!(1i64 as u64); + debug!(1i64 as f32); + debug!(1i64 as f64); - log(debug, 1u64 as int); - log(debug, 1u64 as uint); - log(debug, 1u64 as float); - log(debug, 1u64 as bool); - log(debug, 1u64 as *libc::FILE); - log(debug, 1u64 as i8); - log(debug, 1u64 as i16); - log(debug, 1u64 as i32); - log(debug, 1u64 as i64); - log(debug, 1u64 as u8); - log(debug, 1u64 as u16); - log(debug, 1u64 as u32); - log(debug, 1u64 as u64); - log(debug, 1u64 as f32); - log(debug, 1u64 as f64); + debug!(1u64 as int); + debug!(1u64 as uint); + debug!(1u64 as float); + debug!(1u64 as bool); + debug!(1u64 as *libc::FILE); + debug!(1u64 as i8); + debug!(1u64 as i16); + debug!(1u64 as i32); + debug!(1u64 as i64); + debug!(1u64 as u8); + debug!(1u64 as u16); + debug!(1u64 as u32); + debug!(1u64 as u64); + debug!(1u64 as f32); + debug!(1u64 as f64); - log(debug, 1u64 as int); - log(debug, 1u64 as uint); - log(debug, 1u64 as float); - log(debug, 1u64 as bool); - log(debug, 1u64 as *libc::FILE); - log(debug, 1u64 as i8); - log(debug, 1u64 as i16); - log(debug, 1u64 as i32); - log(debug, 1u64 as i64); - log(debug, 1u64 as u8); - log(debug, 1u64 as u16); - log(debug, 1u64 as u32); - log(debug, 1u64 as u64); - log(debug, 1u64 as f32); - log(debug, 1u64 as f64); + debug!(1u64 as int); + debug!(1u64 as uint); + debug!(1u64 as float); + debug!(1u64 as bool); + debug!(1u64 as *libc::FILE); + debug!(1u64 as i8); + debug!(1u64 as i16); + debug!(1u64 as i32); + debug!(1u64 as i64); + debug!(1u64 as u8); + debug!(1u64 as u16); + debug!(1u64 as u32); + debug!(1u64 as u64); + debug!(1u64 as f32); + debug!(1u64 as f64); - log(debug, true as int); - log(debug, true as uint); - log(debug, true as float); - log(debug, true as bool); - log(debug, true as *libc::FILE); - log(debug, true as i8); - log(debug, true as i16); - log(debug, true as i32); - log(debug, true as i64); - log(debug, true as u8); - log(debug, true as u16); - log(debug, true as u32); - log(debug, true as u64); - log(debug, true as f32); - log(debug, true as f64); + debug!(true as int); + debug!(true as uint); + debug!(true as float); + debug!(true as bool); + debug!(true as *libc::FILE); + debug!(true as i8); + debug!(true as i16); + debug!(true as i32); + debug!(true as i64); + debug!(true as u8); + debug!(true as u16); + debug!(true as u32); + debug!(true as u64); + debug!(true as f32); + debug!(true as f64); - log(debug, 1. as int); - log(debug, 1. as uint); - log(debug, 1. as float); - log(debug, 1. as bool); - log(debug, 1. as i8); - log(debug, 1. as i16); - log(debug, 1. as i32); - log(debug, 1. as i64); - log(debug, 1. as u8); - log(debug, 1. as u16); - log(debug, 1. as u32); - log(debug, 1. as u64); - log(debug, 1. as f32); - log(debug, 1. as f64); + debug!(1. as int); + debug!(1. as uint); + debug!(1. as float); + debug!(1. as bool); + debug!(1. as i8); + debug!(1. as i16); + debug!(1. as i32); + debug!(1. as i64); + debug!(1. as u8); + debug!(1. as u16); + debug!(1. as u32); + debug!(1. as u64); + debug!(1. as f32); + debug!(1. as f64); - log(debug, 1f32 as int); - log(debug, 1f32 as uint); - log(debug, 1f32 as float); - log(debug, 1f32 as bool); - log(debug, 1f32 as i8); - log(debug, 1f32 as i16); - log(debug, 1f32 as i32); - log(debug, 1f32 as i64); - log(debug, 1f32 as u8); - log(debug, 1f32 as u16); - log(debug, 1f32 as u32); - log(debug, 1f32 as u64); - log(debug, 1f32 as f32); - log(debug, 1f32 as f64); + debug!(1f32 as int); + debug!(1f32 as uint); + debug!(1f32 as float); + debug!(1f32 as bool); + debug!(1f32 as i8); + debug!(1f32 as i16); + debug!(1f32 as i32); + debug!(1f32 as i64); + debug!(1f32 as u8); + debug!(1f32 as u16); + debug!(1f32 as u32); + debug!(1f32 as u64); + debug!(1f32 as f32); + debug!(1f32 as f64); - log(debug, 1f64 as int); - log(debug, 1f64 as uint); - log(debug, 1f64 as float); - log(debug, 1f64 as bool); - log(debug, 1f64 as i8); - log(debug, 1f64 as i16); - log(debug, 1f64 as i32); - log(debug, 1f64 as i64); - log(debug, 1f64 as u8); - log(debug, 1f64 as u16); - log(debug, 1f64 as u32); - log(debug, 1f64 as u64); - log(debug, 1f64 as f32); - log(debug, 1f64 as f64); + debug!(1f64 as int); + debug!(1f64 as uint); + debug!(1f64 as float); + debug!(1f64 as bool); + debug!(1f64 as i8); + debug!(1f64 as i16); + debug!(1f64 as i32); + debug!(1f64 as i64); + debug!(1f64 as u8); + debug!(1f64 as u16); + debug!(1f64 as u32); + debug!(1f64 as u64); + debug!(1f64 as f32); + debug!(1f64 as f64); } diff --git a/src/test/run-pass/syntax-extension-fmt.rs b/src/test/run-pass/syntax-extension-fmt.rs index 1c0f31165d39d..1336009eca876 100644 --- a/src/test/run-pass/syntax-extension-fmt.rs +++ b/src/test/run-pass/syntax-extension-fmt.rs @@ -11,8 +11,8 @@ extern mod std; fn test(actual: ~str, expected: ~str) { - log(debug, copy actual); - log(debug, copy expected); + debug!(copy actual); + debug!(copy expected); fail_unless!((actual == expected)); } diff --git a/src/test/run-pass/tail-cps.rs b/src/test/run-pass/tail-cps.rs index 8a413b53c2dee..0f3131e39679d 100644 --- a/src/test/run-pass/tail-cps.rs +++ b/src/test/run-pass/tail-cps.rs @@ -18,12 +18,12 @@ pub fn main() { let k = checktrue; evenk(42, k); oddk(45, k); } fn evenk(n: int, k: extern fn(bool) -> bool) -> bool { debug!("evenk"); - log(debug, n); + debug!(n); if n == 0 { return k(true); } else { return oddk(n - 1, k); } } fn oddk(n: int, k: extern fn(bool) -> bool) -> bool { debug!("oddk"); - log(debug, n); + debug!(n); if n == 0 { return k(false); } else { return evenk(n - 1, k); } } diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index b163703ca4833..6a93df0139537 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -31,10 +31,10 @@ fn test05() { let (po, ch) = comm::stream(); task::spawn(|| test05_start(ch) ); let mut value = po.recv(); - log(error, value); + error!(value); value = po.recv(); - log(error, value); + error!(value); value = po.recv(); - log(error, value); + error!(value); fail_unless!((value == 30)); } diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index 2e5da9a1a2354..3fd55a7310edc 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -20,10 +20,10 @@ fn start(c: &comm::Chan>) { let mut b; a = p.recv(); fail_unless!(a == ~"A"); - log(error, a); + error!(a); b = p.recv(); fail_unless!(b == ~"B"); - log(error, b); + error!(b); } pub fn main() { diff --git a/src/test/run-pass/task-comm-14.rs b/src/test/run-pass/task-comm-14.rs index 053499ee5ed1f..4f0eb7c101f55 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -16,7 +16,7 @@ pub fn main() { // Spawn 10 tasks each sending us back one int. let mut i = 10; while (i > 0) { - log(debug, i); + debug!(i); let (p, ch) = comm::stream(); po.add(p); task::spawn({let i = i; || child(i, &ch)}); @@ -28,7 +28,7 @@ pub fn main() { i = 10; while (i > 0) { - log(debug, i); + debug!(i); po.recv(); i = i - 1; } @@ -37,6 +37,6 @@ pub fn main() { } fn child(x: int, ch: &comm::Chan) { - log(debug, x); + debug!(x); ch.send(x); } diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index 9772c0d181d89..8c8f38f5e12e7 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -64,7 +64,7 @@ fn test00() { for results.each |r| { r.recv(); } debug!("Completed: Final number is: "); - log(error, sum); + error!(sum); // assert (sum == (((number_of_tasks * (number_of_tasks - 1)) / 2) * // number_of_messages)); fail_unless!((sum == 480)); diff --git a/src/test/run-pass/task-comm-4.rs b/src/test/run-pass/task-comm-4.rs index 5e43ea1f4932d..11191ba965824 100644 --- a/src/test/run-pass/task-comm-4.rs +++ b/src/test/run-pass/task-comm-4.rs @@ -20,31 +20,31 @@ fn test00() { c.send(4); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); c.send(5); c.send(6); c.send(7); c.send(8); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); r = p.recv(); sum += r; - log(debug, r); + debug!(r); fail_unless!((sum == 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8)); } diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index 95fe7867d0c5a..57e07221c3df5 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -35,7 +35,7 @@ fn test00() { let mut i: int = 0; while i < number_of_messages { sum += p.recv(); - log(debug, r); + debug!(r); i += 1; } diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs index bd7bab60cb3a6..f736ded3db2a5 100644 --- a/src/test/run-pass/threads.rs +++ b/src/test/run-pass/threads.rs @@ -18,5 +18,5 @@ pub fn main() { debug!("main thread exiting"); } -fn child(&&x: int) { log(debug, x); } +fn child(&&x: int) { debug!(x); } diff --git a/src/test/run-pass/trivial-message.rs b/src/test/run-pass/trivial-message.rs index 7800ebd7310ca..059d7ea5f70c0 100644 --- a/src/test/run-pass/trivial-message.rs +++ b/src/test/run-pass/trivial-message.rs @@ -16,5 +16,5 @@ pub fn main() { let (po, ch) = comm::stream(); ch.send(42); let r = po.recv(); - log(error, r); + error!(r); } diff --git a/src/test/run-pass/typeclasses-eq-example-static.rs b/src/test/run-pass/typeclasses-eq-example-static.rs index 1a2250b7691d4..cd914aaa3185b 100644 --- a/src/test/run-pass/typeclasses-eq-example-static.rs +++ b/src/test/run-pass/typeclasses-eq-example-static.rs @@ -61,5 +61,5 @@ pub fn main() { fail_unless!(!Equal::isEq(branch(@leaf(magenta), @leaf(cyan)), branch(@leaf(magenta), @leaf(magenta)))); - log(error, "Assertions all succeeded!"); + error!("Assertions all succeeded!"); } diff --git a/src/test/run-pass/unary-minus-suffix-inference.rs b/src/test/run-pass/unary-minus-suffix-inference.rs index d48b8bd7b4ef8..3277b878a414c 100644 --- a/src/test/run-pass/unary-minus-suffix-inference.rs +++ b/src/test/run-pass/unary-minus-suffix-inference.rs @@ -11,43 +11,43 @@ pub fn main() { let a = 1; let a_neg: i8 = -a; - log(error, a_neg); + error!(a_neg); let b = 1; let b_neg: i16 = -b; - log(error, b_neg); + error!(b_neg); let c = 1; let c_neg: i32 = -c; - log(error, b_neg); + error!(b_neg); let d = 1; let d_neg: i64 = -d; - log(error, b_neg); + error!(b_neg); let e = 1; let e_neg: int = -e; - log(error, b_neg); + error!(b_neg); // intentional overflows let f = 1; let f_neg: u8 = -f; - log(error, f_neg); + error!(f_neg); let g = 1; let g_neg: u16 = -g; - log(error, g_neg); + error!(g_neg); let h = 1; let h_neg: u32 = -h; - log(error, h_neg); + error!(h_neg); let i = 1; let i_neg: u64 = -i; - log(error, i_neg); + error!(i_neg); let j = 1; let j_neg: uint = -j; - log(error, j_neg); + error!(j_neg); } diff --git a/src/test/run-pass/unique-in-tag.rs b/src/test/run-pass/unique-in-tag.rs index f6f1c3814c660..e46a79d364fe2 100644 --- a/src/test/run-pass/unique-in-tag.rs +++ b/src/test/run-pass/unique-in-tag.rs @@ -14,7 +14,7 @@ fn test1() { let x = u(~10); fail_unless!(match x { u(a) => { - log(error, a); + error!(a); *a } _ => { 66 } diff --git a/src/test/run-pass/unique-log.rs b/src/test/run-pass/unique-log.rs index b619140d50985..37cf6a262356e 100644 --- a/src/test/run-pass/unique-log.rs +++ b/src/test/run-pass/unique-log.rs @@ -10,5 +10,5 @@ pub fn main() { let i = ~100; - log(error, i); + error!(i); } diff --git a/src/test/run-pass/unique-pat-3.rs b/src/test/run-pass/unique-pat-3.rs index 61d37842e15bf..14fc1cca4e5d4 100644 --- a/src/test/run-pass/unique-pat-3.rs +++ b/src/test/run-pass/unique-pat-3.rs @@ -14,7 +14,7 @@ enum bar { u(~int), w(int), } pub fn main() { fail_unless!(match u(~10) { u(a) => { - log(error, a); + error!(a); *a } _ => { 66 } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index fa93dfd0fe135..153df44e2ef31 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -20,14 +20,6 @@ fn call_id_2() { id(true) && id(return); } fn call_id_3() { id(return) && id(return); } -fn log_fail() { log(error, fail!()); } - -fn log_ret() { log(error, return); } - -fn log_break() { loop { log(error, break); } } - -fn log_again() { loop { log(error, loop); } } - fn ret_ret() -> int { return (return 2) + 3; } fn ret_guard() { diff --git a/src/test/run-pass/use-uninit-alt.rs b/src/test/run-pass/use-uninit-alt.rs index 17600f5f51475..f4943ed09bd85 100644 --- a/src/test/run-pass/use-uninit-alt.rs +++ b/src/test/run-pass/use-uninit-alt.rs @@ -18,4 +18,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { log(debug, 5); } +pub fn main() { debug!(5); } diff --git a/src/test/run-pass/use-uninit-alt2.rs b/src/test/run-pass/use-uninit-alt2.rs index 37ba2260a08ac..802c861f88bc2 100644 --- a/src/test/run-pass/use-uninit-alt2.rs +++ b/src/test/run-pass/use-uninit-alt2.rs @@ -18,4 +18,4 @@ fn foo(o: myoption) -> int { enum myoption { none, some(T), } -pub fn main() { log(debug, 5); } +pub fn main() { debug!(5); } diff --git a/src/test/run-pass/utf8.rs b/src/test/run-pass/utf8.rs index c2b4049c3061a..a78461ff4eee8 100644 --- a/src/test/run-pass/utf8.rs +++ b/src/test/run-pass/utf8.rs @@ -42,10 +42,10 @@ pub fn main() { fn check_str_eq(a: ~str, b: ~str) { let mut i: int = 0; for str::each(a) |ab| { - log(debug, i); - log(debug, ab); + debug!(i); + debug!(ab); let bb: u8 = b[i]; - log(debug, bb); + debug!(bb); fail_unless!((ab == bb)); i += 1; } diff --git a/src/test/run-pass/vec-concat.rs b/src/test/run-pass/vec-concat.rs index a7371f5fcf3dc..7023c50d0bd7e 100644 --- a/src/test/run-pass/vec-concat.rs +++ b/src/test/run-pass/vec-concat.rs @@ -13,7 +13,7 @@ pub fn main() { let a: ~[int] = ~[1, 2, 3, 4, 5]; let b: ~[int] = ~[6, 7, 8, 9, 0]; let v: ~[int] = a + b; - log(debug, v[9]); + debug!(v[9]); fail_unless!((v[0] == 1)); fail_unless!((v[7] == 8)); fail_unless!((v[9] == 0)); diff --git a/src/test/run-pass/vec-late-init.rs b/src/test/run-pass/vec-late-init.rs index 918f7e70f4e49..3f7501f34dad5 100644 --- a/src/test/run-pass/vec-late-init.rs +++ b/src/test/run-pass/vec-late-init.rs @@ -13,5 +13,5 @@ pub fn main() { let mut later: ~[int]; if true { later = ~[1]; } else { later = ~[2]; } - log(debug, later[0]); + debug!(later[0]); } diff --git a/src/test/run-pass/vec-self-append.rs b/src/test/run-pass/vec-self-append.rs index 614a884c08c01..00b55aa9a01f6 100644 --- a/src/test/run-pass/vec-self-append.rs +++ b/src/test/run-pass/vec-self-append.rs @@ -47,7 +47,7 @@ fn test_loop() { let mut i = 20; let mut expected_len = 1u; while i > 0 { - log(error, vec::len(a)); + error!(vec::len(a)); fail_unless!((vec::len(a) == expected_len)); a = a + a; // FIXME(#3387)---can't write a += a i -= 1; diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index a652ed64945d0..a7ac8554b3d4a 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -55,10 +55,6 @@ fn notsure() { let _b = (_y <-> _z) == (_y <-> _z); } -fn hammertime() -> int { - let _x = log(debug, true == (return 0)); -} - fn canttouchthis() -> uint { pure fn p() -> bool { true } let _a = (fail_unless!((true)) == (fail_unless!(p()))); @@ -81,7 +77,6 @@ pub fn main() { what(); zombiejesus(); notsure(); - hammertime(); canttouchthis(); angrydome(); evil_lincoln(); diff --git a/src/test/run-pass/while-cont.rs b/src/test/run-pass/while-cont.rs index 9181f721305db..5a67f98423d9c 100644 --- a/src/test/run-pass/while-cont.rs +++ b/src/test/run-pass/while-cont.rs @@ -13,7 +13,7 @@ pub fn main() { let mut i = 1; while i > 0 { fail_unless!((i > 0)); - log(debug, i); + debug!(i); i -= 1; loop; } diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index 39d3e2d974700..13376eddc41e8 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -16,7 +16,7 @@ pub fn main() { while z < 50 { z += 1; while false { x = y; y = z; } - log(debug, y); + debug!(y); } fail_unless!((y == 42 && z == 50)); } diff --git a/src/test/run-pass/while-with-break.rs b/src/test/run-pass/while-with-break.rs index dafae6b77c780..0644c55f8c803 100644 --- a/src/test/run-pass/while-with-break.rs +++ b/src/test/run-pass/while-with-break.rs @@ -5,7 +5,7 @@ pub fn main() { let mut i: int = 90; while i < 100 { - log(debug, i); + debug!(i); i = i + 1; if i == 95 { let v: ~[int] = diff --git a/src/test/run-pass/while.rs b/src/test/run-pass/while.rs index 64de4963b8ab7..70a88a025de62 100644 --- a/src/test/run-pass/while.rs +++ b/src/test/run-pass/while.rs @@ -13,10 +13,10 @@ pub fn main() { let mut x: int = 10; let mut y: int = 0; - while y < x { log(debug, y); debug!("hello"); y = y + 1; } + while y < x { debug!(y); debug!("hello"); y = y + 1; } while x > 0 { debug!("goodbye"); x = x - 1; - log(debug, x); + debug!(x); } } diff --git a/src/test/run-pass/yield2.rs b/src/test/run-pass/yield2.rs index eaaa226c28637..83b60d1863e8a 100644 --- a/src/test/run-pass/yield2.rs +++ b/src/test/run-pass/yield2.rs @@ -11,5 +11,5 @@ pub fn main() { let mut i: int = 0; - while i < 100 { i = i + 1; log(error, i); task::yield(); } + while i < 100 { i = i + 1; error!(i); task::yield(); } }