-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix terminal logger quiet mode to show project context for warnings/errors #12930
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
base: main
Are you sure you want to change the base?
Conversation
…rrors Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
|
@copilot since in quiet mode there is no dynamic refresh, can we prevent the hide/show pair from being written at all? |
…ow codes Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Fixed in fde9744. Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes terminal logger quiet mode (-v:q) to display project context for warnings and errors. Previously, diagnostics in quiet mode were rendered immediately without project information, making it impossible to identify which project they originated from.
Key Changes:
- Modified diagnostic accumulation to store warnings/errors in project collections regardless of verbosity level
- Changed project summary rendering to display projects with errors/warnings even in quiet mode
- Added logic to skip cursor control codes in quiet mode since there's no dynamic refresh
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Build/Logging/TerminalLogger/TerminalLogger.cs | Core logic changes: removed verbosity checks from warning/error accumulation; added quiet mode handling to show projects with diagnostics; skips DisplayNodes() in quiet mode to avoid unnecessary ANSI codes |
| src/Build.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummaryQuietVerbosity_FailedWithErrors.Windows.verified.txt | Updated test snapshot showing new output format with project header and indented diagnostics |
| src/Build.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummaryQuietVerbosity_FailedWithErrors.OSX.verified.txt | Updated test snapshot for macOS platform |
| src/Build.UnitTests/Snapshots/TerminalLogger_Tests.PrintBuildSummaryQuietVerbosity_FailedWithErrors.Linux.verified.txt | Updated test snapshot for Linux platform |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Context
In quiet mode (
-v:q), warnings and errors were rendered immediately without project context. Users saw diagnostic messages but couldn't identify which project they came from.Changes Made
Modified diagnostic accumulation logic
WarningRaisedandErrorRaisednow accumulate diagnostics in the project'sBuildMessagescollection regardless of verbosityModified project summary rendering
ProjectFinishednow displays project summaries in quiet mode whenHasErrorsOrWarningsis trueVerbosity < LoggerVerbosity.Quiet || (Verbosity == LoggerVerbosity.Quiet && !project.HasErrorsOrWarnings)DisplayNodes()call in quiet mode to avoid writing unnecessary cursor hide/show ANSI codes since there's no dynamic refreshResult in quiet mode:
Testing
PrintBuildSummaryQuietVerbosity_FailedWithErrorsacross Linux/OSX/WindowsNotes
Uses the same project-grouping primitives as higher verbosity levels, toggled by runtime state per maintainer guidance.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.