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

Add quiet flag (-q, --quiet) to LoggingOptions. #5988

Merged
merged 2 commits into from Dec 21, 2022
Merged

Add quiet flag (-q, --quiet) to LoggingOptions. #5988

merged 2 commits into from Dec 21, 2022

Conversation

clayellis
Copy link
Contributor

This PR adds a quiet flag (-q, --quiet) to swift commands which suppresses all but error output.

Motivation:

Closes #4395. Executable targets often depend on the output of other executable targets. When an executable target is run with swift, there is currently no way to suppress the build output, which makes it more difficult to pass the output of one executable as the input of another. The new quiet flag suppresses all output except errors.

Modifications:

  • Added a @Flag to LoggingOptions
  • Interpret that flag as a Diagnostic.Severity in LoggingOptions.logLevel.
  • Added tests for both the short and long flag.

Result:

When a user passes the quiet flag, only errors will be logged.

@clayellis
Copy link
Contributor Author

@tomerd I followed your suggestions in making these changes. I decided not to introduce the log-level option and left it for someone else as it may be useful to express the existing flags in terms of the log-level option, which would be a larger change.

Co-authored-by: Max Desiatov <m_desiatov@apple.com>
@MaxDesiatov
Copy link
Member

@swift-ci smoke test

@tomerd
Copy link
Member

tomerd commented Dec 21, 2022

thanks @clayellis

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.

[SR-15037] Add --quiet option to swift run
4 participants