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

feat: quite flag implemented #1609

wants to merge 1 commit into from

Conversation

dhruvdabhi101
Copy link
Contributor

@dhruvdabhi101 dhruvdabhi101 commented Feb 2, 2024

Description of change

Implemented --quite flag for cargo-shuttle run command.
I added extra flag in RunArgs struct, then in spin_local_run function I checked if flag is true or not and accordingly I let print statement do the work

Closes #1602

How has this been tested? (if applicable)

Tested Via running locally.
used this command cargo run -p cargo-shuttle -- run --wd ../temp-project --quite

and output is something like this
Screenshot 2024-02-02 at 21 59 28

Screenshot 2024-02-02 at 22 02 25

This is very first implementation that came to my mind, but if it needs to be improved please suggest : )

Copy link
Member

@jonaro00 jonaro00 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

  1. It is spelled quiet.
  2. The printing of resource lists should not happen. The Starting on ... is probably the only line from cargo-shuttle that should stay.
  3. Read the issue description carefully. The flag also needs to be passed to the runtime to ignore prints on that side too.

Comment on lines +1084 to +1090
if !quite_mode {
println!("{log_item}");
} else {
if log_item.line.contains("ERROR") {
println!("{log_item}");
}
}
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.

@dhruvdabhi101 dhruvdabhi101 changed the title feat: quite flag implemented (very basic impl feat: quite flag implemented Feb 2, 2024
@dhruvdabhi101 dhruvdabhi101 closed this by deleting the head repository May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement]: --quiet flag for local runs
2 participants