-
Notifications
You must be signed in to change notification settings - Fork 725
Create Restore Bar logger in Package Manager UI #6433
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
Conversation
src/NuGet.Clients/NuGet.PackageManagement.UI/Utility/RestoreBarLogger.cs
Show resolved
Hide resolved
src/NuGet.Clients/NuGet.PackageManagement.UI/Utility/RestoreBarLogger.cs
Outdated
Show resolved
Hide resolved
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 introduces a new RestoreBarLogger to ensure that only log messages of Warning level or higher are displayed in NuGet's Package Manager UI Restore Bar, addressing the bug described in NuGet/Home#13407.
- Added unit tests for RestoreBarLogger behavior.
- Updated PackageRestoreBar.xaml.cs to use RestoreBarLogger instead of LoggerAdapter.
- Implemented RestoreBarLogger to forward only selected log levels to the underlying INuGetProjectContext.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Utility/RestoreBarLoggerTests.cs | Added tests verifying that only Warning level and above messages are logged. |
src/NuGet.Clients/NuGet.PackageManagement.UI/Xamls/PackageRestoreBar.xaml.cs | Updated logger initialization to use RestoreBarLogger. |
src/NuGet.Clients/NuGet.PackageManagement.UI/Utility/RestoreBarLogger.cs | Introduced RestoreBarLogger with filtering based on verbosity level. |
Bug
Fixes: NuGet/Home#13407
Description
Informational messages are no longer logged to the RestoreBar (InfoBar / Gold Bar / Yellow bar) in NuGet's Package Manager UI.
Warning
level or higher are displayed.INuGetProjectContext
.Info
level, informational logging.CACHE https://api.nuget.org/v3/vulnerabilities/index.json
is shown in Output Pane but no longer in the Restore Bar.Side effects
Future considerations
LoggerBase
andLoggerAdapter
can be merged as there's a lot of overlap.INuGetProjectContext
representing a project and a logger isn't a great abstraction. The separation of concerns could be improved.PR Checklist
Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.