diff options
| author | bors <bors@rust-lang.org> | 2014-03-15 23:01:24 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-15 23:01:24 -0700 |
| commit | f6fcdbb68718380beca798d087c46152cad0949c (patch) | |
| tree | c6b7fd10bb869fba19561852cf4eb286b0f96a4f /src/libnative | |
| parent | abd844e4df068196d1150ac39d596f73e210d95d (diff) | |
| parent | 0015cab1fd7b4b47030c808a825bb5594cc1d4ac (diff) | |
| download | rust-f6fcdbb68718380beca798d087c46152cad0949c.tar.gz rust-f6fcdbb68718380beca798d087c46152cad0949c.zip | |
auto merge of #12791 : alexcrichton/rust/liblog, r=brson
The rationale and modifications can be found in the first commit message. This does make logging a bit more painful to use initially because it involves a feature gate and some `phase` attributes, but I think it may be reasonable to not require the `phase` attribute for loading `macro_rules!` macros because defining them will still be gated.
Diffstat (limited to 'src/libnative')
| -rw-r--r-- | src/libnative/io/file_unix.rs | 6 | ||||
| -rw-r--r-- | src/libnative/io/file_win32.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/mod.rs | 10 | ||||
| -rw-r--r-- | src/libnative/io/timer_timerfd.rs | 2 | ||||
| -rw-r--r-- | src/libnative/task.rs | 3 |
5 files changed, 6 insertions, 17 deletions
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs index ff1ff9a569d..1d7938be226 100644 --- a/src/libnative/io/file_unix.rs +++ b/src/libnative/io/file_unix.rs @@ -209,7 +209,8 @@ impl Drop for Inner { if self.close_on_drop && self.fd > libc::STDERR_FILENO { let n = unsafe { libc::close(self.fd) }; if n != 0 { - warn!("error {} when closing file descriptor {}", n, self.fd); + println!("error {} when closing file descriptor {}", n, + self.fd); } } } @@ -362,13 +363,10 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> { let mut buf = Vec::<u8>::with_capacity(size as uint); let ptr = buf.as_mut_slice().as_mut_ptr() as *mut dirent_t; - debug!("os::list_dir -- BEFORE OPENDIR"); - let dir_ptr = p.with_ref(|buf| unsafe { opendir(buf) }); if dir_ptr as uint != 0 { let mut paths = ~[]; - debug!("os::list_dir -- opendir() SUCCESS"); let mut entry_ptr = 0 as *mut dirent_t; while unsafe { readdir_r(dir_ptr, ptr, &mut entry_ptr) == 0 } { if entry_ptr.is_null() { break } diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs index 8f4f9259ab7..c5ae4f00017 100644 --- a/src/libnative/io/file_win32.rs +++ b/src/libnative/io/file_win32.rs @@ -238,7 +238,7 @@ impl Drop for Inner { if self.close_on_drop && self.fd > libc::STDERR_FILENO { let n = unsafe { libc::close(self.fd) }; if n != 0 { - warn!("error {} when closing file descriptor {}", n, self.fd); + println!("error {} when closing file descriptor {}", n, self.fd); } } } diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index a054ee66391..615ed80a648 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -112,10 +112,7 @@ fn translate_error(errno: i32, detail: bool) -> IoError { libc::ERROR_INVALID_FUNCTION => (io::InvalidInput, "illegal operation on a directory"), - x => { - debug!("ignoring {}: {}", x, os::last_os_error()); - (io::OtherIoError, "unknown error") - } + _ => (io::OtherIoError, "unknown error") } } @@ -141,10 +138,7 @@ fn translate_error(errno: i32, detail: bool) -> IoError { x if x == libc::EAGAIN || x == libc::EWOULDBLOCK => (io::ResourceUnavailable, "resource temporarily unavailable"), - x => { - debug!("ignoring {}: {}", x, os::last_os_error()); - (io::OtherIoError, "unknown error") - } + _ => (io::OtherIoError, "unknown error") } } diff --git a/src/libnative/io/timer_timerfd.rs b/src/libnative/io/timer_timerfd.rs index 1b0e08ca6fb..a8018bec0a6 100644 --- a/src/libnative/io/timer_timerfd.rs +++ b/src/libnative/io/timer_timerfd.rs @@ -89,10 +89,8 @@ fn helper(input: libc::c_int, messages: Receiver<Req>) { }; let mut incoming = false; - debug!("{} events to process", n); for event in events.slice_to(n as uint).iter() { let fd = event.data as libc::c_int; - debug!("data on fd {} (input = {})", fd, input); if fd == input { let mut buf = [0, ..1]; // drain the input file descriptor of its input diff --git a/src/libnative/task.rs b/src/libnative/task.rs index 8510b50777a..7a42d1bfee3 100644 --- a/src/libnative/task.rs +++ b/src/libnative/task.rs @@ -59,12 +59,11 @@ pub fn spawn(f: proc()) { pub fn spawn_opts(opts: TaskOpts, f: proc()) { let TaskOpts { notify_chan, name, stack_size, - logger, stderr, stdout, + stderr, stdout, } = opts; let mut task = ~Task::new(); task.name = name; - task.logger = logger; task.stderr = stderr; task.stdout = stdout; match notify_chan { |
