feat: rename --log-to-stdout to --console (#1163)

Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
Gaius 2025-05-27 15:31:14 +08:00 committed by GitHub
parent 7b1cdbe1f1
commit 3959bb9330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 18 additions and 18 deletions

View File

@ -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/Cargo.toml ./dragonfly-client-init/Cargo.toml
COPY dragonfly-client-init/src ./dragonfly-client-init/src 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 FROM public.ecr.aws/docker/library/alpine:3.20 AS health

View File

@ -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/Cargo.toml ./dragonfly-client-init/Cargo.toml
COPY dragonfly-client-init/src ./dragonfly-client-init/src 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 flamegraph --root /usr/local
RUN cargo install bottom --locked --root /usr/local RUN cargo install bottom --locked --root /usr/local

View File

@ -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/Cargo.toml ./dragonfly-client-init/Cargo.toml
COPY dragonfly-client-init/src ./dragonfly-client-init/src 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 FROM public.ecr.aws/debian/debian:bookworm-slim

View File

@ -5,7 +5,7 @@ After=network-online.target
After=network.target After=network.target
[Service] [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 Type=simple
Environment=HOME=/root Environment=HOME=/root

View File

@ -69,7 +69,7 @@ cargo build --release --bin dfdaemon
```bash ```bash
# prepare client.yaml by yourself. # 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 ## FlameGraph

View File

@ -14,7 +14,7 @@ cargo build --all && mv target/debug/libhdfs.so {plugin_dir}/backend/libhdfs.so
## Run Client with Plugin ## Run Client with Plugin
```shell ```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 [http] builtin backend
INFO load [https] builtin backend INFO load [https] builtin backend
INFO load [hdfs] plugin backend INFO load [hdfs] plugin backend

View File

@ -116,7 +116,7 @@ pub struct ExportCommand {
log_max_files: usize, log_max_files: usize,
#[arg(long, default_value_t = false, help = "Specify whether to print log")] #[arg(long, default_value_t = false, help = "Specify whether to print log")]
log_to_stdout: bool, console: bool,
} }
/// Implement the execute for ExportCommand. /// Implement the execute for ExportCommand.
@ -134,7 +134,7 @@ impl ExportCommand {
self.log_max_files, self.log_max_files,
None, None,
None, None,
self.log_to_stdout, self.console,
); );
// Validate the command line arguments. // Validate the command line arguments.

View File

@ -122,7 +122,7 @@ pub struct ImportCommand {
log_max_files: usize, log_max_files: usize,
#[arg(long, default_value_t = false, help = "Specify whether to print log")] #[arg(long, default_value_t = false, help = "Specify whether to print log")]
log_to_stdout: bool, console: bool,
} }
/// Implement the execute for ImportCommand. /// Implement the execute for ImportCommand.
@ -140,7 +140,7 @@ impl ImportCommand {
self.log_max_files, self.log_max_files,
None, None,
None, None,
self.log_to_stdout, self.console,
); );
// Validate the command line arguments. // Validate the command line arguments.

View File

@ -68,7 +68,7 @@ pub struct StatCommand {
log_max_files: usize, log_max_files: usize,
#[arg(long, default_value_t = false, help = "Specify whether to print log")] #[arg(long, default_value_t = false, help = "Specify whether to print log")]
log_to_stdout: bool, console: bool,
} }
/// Implement the execute for StatCommand. /// Implement the execute for StatCommand.
@ -86,7 +86,7 @@ impl StatCommand {
self.log_max_files, self.log_max_files,
None, None,
None, None,
self.log_to_stdout, self.console,
); );
// Get dfdaemon download client. // Get dfdaemon download client.

View File

@ -92,7 +92,7 @@ struct Args {
log_max_files: usize, log_max_files: usize,
#[arg(long, default_value_t = true, help = "Specify whether to print log")] #[arg(long, default_value_t = true, help = "Specify whether to print log")]
log_to_stdout: bool, console: bool,
#[arg( #[arg(
short = 'V', short = 'V',
@ -147,7 +147,7 @@ async fn main() -> Result<(), anyhow::Error> {
args.log_max_files, args.log_max_files,
config.tracing.addr.to_owned(), config.tracing.addr.to_owned(),
Some(config.host.clone()), Some(config.host.clone()),
args.log_to_stdout, args.console,
); );
// Initialize storage. // Initialize storage.

View File

@ -279,7 +279,7 @@ struct Args {
log_max_files: usize, log_max_files: usize,
#[arg(long, default_value_t = false, help = "Specify whether to print log")] #[arg(long, default_value_t = false, help = "Specify whether to print log")]
log_to_stdout: bool, console: bool,
#[arg( #[arg(
short = 'V', short = 'V',
@ -305,7 +305,7 @@ async fn main() -> anyhow::Result<()> {
args.log_max_files, args.log_max_files,
None, None,
None, None,
args.log_to_stdout, args.console,
); );
// Validate command line arguments. // Validate command line arguments.

View File

@ -44,7 +44,7 @@ pub fn init_tracing(
log_max_files: usize, log_max_files: usize,
jaeger_addr: Option<String>, jaeger_addr: Option<String>,
host: Option<Host>, host: Option<Host>,
log_to_stdout: bool, console: bool,
) -> Vec<WorkerGuard> { ) -> Vec<WorkerGuard> {
let mut guards = vec![]; let mut guards = vec![];
@ -53,7 +53,7 @@ pub fn init_tracing(
guards.push(stdout_guard); guards.push(stdout_guard);
// Initialize stdout layer. // Initialize stdout layer.
let stdout_filter = if log_to_stdout { let stdout_filter = if console {
LevelFilter::DEBUG LevelFilter::DEBUG
} else { } else {
LevelFilter::OFF LevelFilter::OFF