Skip to content

Commit 9ce4632

Browse files
authored
feat: remove redirect stderr to file (#938)
Signed-off-by: Gaius <[email protected]>
1 parent 7e9ccae commit 9ce4632

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dragonfly-client/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ indicatif = "0.17.9"
8383
dashmap = "6.1.0"
8484
fs2 = "0.4.3"
8585
hashring = "0.3.6"
86-
libc = "0.2"
8786
fslock = "0.2.1"
8887
leaky-bucket = "1.1.2"
8988
http-body-util = "0.1.2"

dragonfly-client/src/tracing/mod.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
use opentelemetry::sdk::propagation::TraceContextPropagator;
1818
use rolling_file::*;
1919
use std::fs;
20-
use std::fs::OpenOptions;
21-
use std::os::unix::io::AsRawFd;
2220
use std::path::PathBuf;
2321
use tracing::{info, Level};
2422
use tracing_appender::non_blocking::WorkerGuard;
@@ -133,24 +131,5 @@ pub fn init_tracing(
133131
log_level
134132
);
135133

136-
// Redirect stderr to file.
137-
if !verbose {
138-
redirect_stderr_to_file(log_dir);
139-
}
140-
141134
guards
142135
}
143-
144-
/// redirect_stderr_to_file redirects stderr to a file.
145-
fn redirect_stderr_to_file(log_dir: PathBuf) {
146-
let log_path = log_dir.join("stderr.log");
147-
let file = OpenOptions::new()
148-
.create(true)
149-
.append(true)
150-
.open(log_path)
151-
.unwrap();
152-
153-
unsafe {
154-
libc::dup2(file.as_raw_fd(), libc::STDERR_FILENO);
155-
}
156-
}

0 commit comments

Comments
 (0)