Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: quite flag implemented #1609

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cargo-shuttle/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ pub struct RunArgs {
/// Use release mode for building the project
#[arg(long, short = 'r')]
pub release: bool,
/// Use quite mode for running the project
#[arg(long, short = 'q')]
pub quite: bool,
}

#[derive(Parser, Clone, Debug, Default)]
Expand Down
10 changes: 9 additions & 1 deletion cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,8 @@ impl Shuttle {
let service_name = service.service_name()?;
let deployment_id: Uuid = Default::default();

let quite_mode = run_args.quite;

// Clones to send to spawn
let service_name_clone = service_name.clone().to_string();

Expand All @@ -1079,7 +1081,13 @@ impl Shuttle {
shuttle_common::log::Backend::Runtime(service_name_clone.clone()),
line,
);
println!("{log_item}");
if !quite_mode {
println!("{log_item}");
} else {
if log_item.line.contains("ERROR") {
println!("{log_item}");
}
}
Comment on lines +1084 to +1090
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't filter the runtime's lines like this. The goal is to supress shuttle's prints in cargo-shuttle and runtime. No lines from the user's program should be silenced.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay.. Thanks : ), will try to do that.

}
});

Expand Down