From 78e4e31b1faeaa9b2fa2a3cb227453e54aef36fd Mon Sep 17 00:00:00 2001 From: Gaius Date: Tue, 27 May 2025 15:26:25 +0800 Subject: [PATCH] feat: rename --log-to-stdout to --console Signed-off-by: Gaius --- ci/Dockerfile | 2 +- ci/Dockerfile.debug | 2 +- ci/Dockerfile.dfinit | 2 +- ci/dfdaemon.service | 2 +- docs/performance-optimization.md | 2 +- dragonfly-client-backend/examples/plugin/README.md | 2 +- dragonfly-client/src/bin/dfcache/export.rs | 4 ++-- dragonfly-client/src/bin/dfcache/import.rs | 4 ++-- dragonfly-client/src/bin/dfcache/stat.rs | 4 ++-- dragonfly-client/src/bin/dfdaemon/main.rs | 4 ++-- dragonfly-client/src/bin/dfget/main.rs | 4 ++-- dragonfly-client/src/tracing/mod.rs | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 36379ced..162d77f4 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -34,7 +34,7 @@ COPY dragonfly-client-util/src ./dragonfly-client-util/src COPY dragonfly-client-init/Cargo.toml ./dragonfly-client-init/Cargo.toml COPY dragonfly-client-init/src ./dragonfly-client-init/src -RUN cargo build --release --log-to-stdout --bin dfget --bin dfdaemon --bin dfcache +RUN cargo build --release --verbose --bin dfget --bin dfdaemon --bin dfcache FROM public.ecr.aws/docker/library/alpine:3.20 AS health diff --git a/ci/Dockerfile.debug b/ci/Dockerfile.debug index f65506df..af868004 100644 --- a/ci/Dockerfile.debug +++ b/ci/Dockerfile.debug @@ -34,7 +34,7 @@ COPY dragonfly-client-util/src ./dragonfly-client-util/src COPY dragonfly-client-init/Cargo.toml ./dragonfly-client-init/Cargo.toml COPY dragonfly-client-init/src ./dragonfly-client-init/src -RUN cargo build --log-to-stdout --bin dfget --bin dfdaemon --bin dfcache +RUN cargo build --verbose --bin dfget --bin dfdaemon --bin dfcache RUN cargo install flamegraph --root /usr/local RUN cargo install bottom --locked --root /usr/local diff --git a/ci/Dockerfile.dfinit b/ci/Dockerfile.dfinit index 65575636..c84c793a 100644 --- a/ci/Dockerfile.dfinit +++ b/ci/Dockerfile.dfinit @@ -34,7 +34,7 @@ COPY dragonfly-client-util/src ./dragonfly-client-util/src COPY dragonfly-client-init/Cargo.toml ./dragonfly-client-init/Cargo.toml COPY dragonfly-client-init/src ./dragonfly-client-init/src -RUN cargo build --release --log-to-stdout --bin dfinit +RUN cargo build --release --verbose --bin dfinit FROM public.ecr.aws/debian/debian:bookworm-slim diff --git a/ci/dfdaemon.service b/ci/dfdaemon.service index acd14eea..f8d1fbba 100644 --- a/ci/dfdaemon.service +++ b/ci/dfdaemon.service @@ -5,7 +5,7 @@ After=network-online.target After=network.target [Service] -ExecStart=/usr/bin/dfdaemon --config /etc/dragonfly/dfdaemon.yaml --log-to-stdout +ExecStart=/usr/bin/dfdaemon --config /etc/dragonfly/dfdaemon.yaml --console Type=simple Environment=HOME=/root diff --git a/docs/performance-optimization.md b/docs/performance-optimization.md index 66797d81..596d6b7e 100644 --- a/docs/performance-optimization.md +++ b/docs/performance-optimization.md @@ -69,7 +69,7 @@ cargo build --release --bin dfdaemon ```bash # prepare client.yaml by yourself. -./target/release/dfdaemon --config client.yaml -l info --log-to-stdout +./target/release/dfdaemon --config client.yaml -l info --console ``` ## FlameGraph diff --git a/dragonfly-client-backend/examples/plugin/README.md b/dragonfly-client-backend/examples/plugin/README.md index 35e10408..de7eb884 100644 --- a/dragonfly-client-backend/examples/plugin/README.md +++ b/dragonfly-client-backend/examples/plugin/README.md @@ -14,7 +14,7 @@ cargo build --all && mv target/debug/libhdfs.so {plugin_dir}/backend/libhdfs.so ## Run Client with Plugin ```shell -$ cargo run --bin dfdaemon -- --config {config_dir}/config.yaml -l info --log-to-stdout +$ cargo run --bin dfdaemon -- --config {config_dir}/config.yaml -l info --console INFO load [http] builtin backend INFO load [https] builtin backend INFO load [hdfs] plugin backend diff --git a/dragonfly-client/src/bin/dfcache/export.rs b/dragonfly-client/src/bin/dfcache/export.rs index b65e5e6c..e69e3dfd 100644 --- a/dragonfly-client/src/bin/dfcache/export.rs +++ b/dragonfly-client/src/bin/dfcache/export.rs @@ -116,7 +116,7 @@ pub struct ExportCommand { log_max_files: usize, #[arg(long, default_value_t = false, help = "Specify whether to print log")] - log_to_stdout: bool, + console: bool, } /// Implement the execute for ExportCommand. @@ -134,7 +134,7 @@ impl ExportCommand { self.log_max_files, None, None, - self.log_to_stdout, + self.console, ); // Validate the command line arguments. diff --git a/dragonfly-client/src/bin/dfcache/import.rs b/dragonfly-client/src/bin/dfcache/import.rs index 13a51b9a..d8af6536 100644 --- a/dragonfly-client/src/bin/dfcache/import.rs +++ b/dragonfly-client/src/bin/dfcache/import.rs @@ -122,7 +122,7 @@ pub struct ImportCommand { log_max_files: usize, #[arg(long, default_value_t = false, help = "Specify whether to print log")] - log_to_stdout: bool, + console: bool, } /// Implement the execute for ImportCommand. @@ -140,7 +140,7 @@ impl ImportCommand { self.log_max_files, None, None, - self.log_to_stdout, + self.console, ); // Validate the command line arguments. diff --git a/dragonfly-client/src/bin/dfcache/stat.rs b/dragonfly-client/src/bin/dfcache/stat.rs index 058d5c42..f52f9065 100644 --- a/dragonfly-client/src/bin/dfcache/stat.rs +++ b/dragonfly-client/src/bin/dfcache/stat.rs @@ -68,7 +68,7 @@ pub struct StatCommand { log_max_files: usize, #[arg(long, default_value_t = false, help = "Specify whether to print log")] - log_to_stdout: bool, + console: bool, } /// Implement the execute for StatCommand. @@ -86,7 +86,7 @@ impl StatCommand { self.log_max_files, None, None, - self.log_to_stdout, + self.console, ); // Get dfdaemon download client. diff --git a/dragonfly-client/src/bin/dfdaemon/main.rs b/dragonfly-client/src/bin/dfdaemon/main.rs index 15a84125..56933f1c 100644 --- a/dragonfly-client/src/bin/dfdaemon/main.rs +++ b/dragonfly-client/src/bin/dfdaemon/main.rs @@ -92,7 +92,7 @@ struct Args { log_max_files: usize, #[arg(long, default_value_t = true, help = "Specify whether to print log")] - log_to_stdout: bool, + console: bool, #[arg( short = 'V', @@ -147,7 +147,7 @@ async fn main() -> Result<(), anyhow::Error> { args.log_max_files, config.tracing.addr.to_owned(), Some(config.host.clone()), - args.log_to_stdout, + args.console, ); // Initialize storage. diff --git a/dragonfly-client/src/bin/dfget/main.rs b/dragonfly-client/src/bin/dfget/main.rs index ab037ef0..c1a6413e 100644 --- a/dragonfly-client/src/bin/dfget/main.rs +++ b/dragonfly-client/src/bin/dfget/main.rs @@ -279,7 +279,7 @@ struct Args { log_max_files: usize, #[arg(long, default_value_t = false, help = "Specify whether to print log")] - log_to_stdout: bool, + console: bool, #[arg( short = 'V', @@ -305,7 +305,7 @@ async fn main() -> anyhow::Result<()> { args.log_max_files, None, None, - args.log_to_stdout, + args.console, ); // Validate command line arguments. diff --git a/dragonfly-client/src/tracing/mod.rs b/dragonfly-client/src/tracing/mod.rs index 7e64665e..b4401516 100644 --- a/dragonfly-client/src/tracing/mod.rs +++ b/dragonfly-client/src/tracing/mod.rs @@ -44,7 +44,7 @@ pub fn init_tracing( log_max_files: usize, jaeger_addr: Option, host: Option, - log_to_stdout: bool, + console: bool, ) -> Vec { let mut guards = vec![]; @@ -53,7 +53,7 @@ pub fn init_tracing( guards.push(stdout_guard); // Initialize stdout layer. - let stdout_filter = if log_to_stdout { + let stdout_filter = if console { LevelFilter::DEBUG } else { LevelFilter::OFF