summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-05-08 22:45:06 -0400
committerGitHub <noreply@github.com>2024-05-08 22:45:06 -0400
commit47f7bed677a6b72e873712de8f3988ea891710e4 (patch)
tree096549459b479cf1383e65c87b77e9f9482df258 /ext
parente6dc4dfbff25e77d2127591802229b4a74037d24 (diff)
chore: enable clippy::print_stdout and clippy::print_stderr (#23732)
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
Diffstat (limited to 'ext')
-rw-r--r--ext/ffi/Cargo.toml1
-rw-r--r--ext/ffi/callback.rs2
-rw-r--r--ext/http/response_body.rs1
-rw-r--r--ext/io/Cargo.toml1
-rw-r--r--ext/io/winpipe.rs4
5 files changed, 6 insertions, 3 deletions
diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml
index 9e6ade702..8af1b2016 100644
--- a/ext/ffi/Cargo.toml
+++ b/ext/ffi/Cargo.toml
@@ -19,6 +19,7 @@ dlopen2.workspace = true
dynasmrt = "1.2.3"
libffi = "=3.2.0"
libffi-sys = "=2.3.0"
+log.workspace = true
serde.workspace = true
serde-value = "0.7"
serde_json = "1.0"
diff --git a/ext/ffi/callback.rs b/ext/ffi/callback.rs
index eeea49c23..55f38c602 100644
--- a/ext/ffi/callback.rs
+++ b/ext/ffi/callback.rs
@@ -176,7 +176,7 @@ unsafe extern "C" fn deno_ffi_callback(
let tc_scope = &mut TryCatch::new(scope);
args.run(tc_scope);
if tc_scope.exception().is_some() {
- eprintln!("Illegal unhandled exception in nonblocking callback.");
+ log::error!("Illegal unhandled exception in nonblocking callback.");
}
});
}
diff --git a/ext/http/response_body.rs b/ext/http/response_body.rs
index 6b033ffe0..fd1203f53 100644
--- a/ext/http/response_body.rs
+++ b/ext/http/response_body.rs
@@ -625,6 +625,7 @@ impl PollFrame for BrotliResponseStream {
}
}
+#[allow(clippy::print_stderr)]
#[cfg(test)]
mod tests {
use super::*;
diff --git a/ext/io/Cargo.toml b/ext/io/Cargo.toml
index 17a967834..70b5c63f8 100644
--- a/ext/io/Cargo.toml
+++ b/ext/io/Cargo.toml
@@ -18,6 +18,7 @@ async-trait.workspace = true
deno_core.workspace = true
filetime.workspace = true
fs3.workspace = true
+log.workspace = true
once_cell.workspace = true
tokio.workspace = true
diff --git a/ext/io/winpipe.rs b/ext/io/winpipe.rs
index f66dec6b6..01d018008 100644
--- a/ext/io/winpipe.rs
+++ b/ext/io/winpipe.rs
@@ -74,7 +74,7 @@ fn create_named_pipe_inner() -> io::Result<(RawHandle, RawHandle)> {
// This should not happen, so we would like to get some better diagnostics here.
// SAFETY: Printing last error for diagnostics
unsafe {
- eprintln!(
+ log::error!(
"*** Unexpected server pipe failure '{pipe_name:?}': {:x}",
GetLastError()
);
@@ -99,7 +99,7 @@ fn create_named_pipe_inner() -> io::Result<(RawHandle, RawHandle)> {
// SAFETY: Getting last error for diagnostics
let error = unsafe { GetLastError() };
// This should not happen, so we would like to get some better diagnostics here.
- eprintln!(
+ log::error!(
"*** Unexpected client pipe failure '{pipe_name:?}': {:x}",
error
);