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

(#508) Change NuGet normal logging to be verbose logging #2944

Merged
merged 4 commits into from
Dec 21, 2022

Conversation

AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Dec 21, 2022

Description Of Changes

This pull request updates the custom nuget logger we are using to not log normal informational output to the console unless --verbose is being used.
Additionally, this pull request updates the nuget logger, and the custom project context logging functionality to get rid of duplicated code.

Motivation and Context

We do not want to obscure normal output for the user by including the information from NuGet.
While these can be helpful in some cases, hiding it behind a verbose flag by default make sense.

Testing

  1. Run choco search 7zip.install
  2. Verify no output from NuGet is being shown
  3. Run choco search 7zip.install --verbose (verbose in this case is synanymous with --detailed).
  4. Verify the output from NuGet is shown with green text.
  5. Run choco info firefox
  6. Verify no output from NuGet is being shown
  7. Run choco info firefox --verbose
  8. Verify the output from NuGet is shown with green text.
  9. Run choco install trid --version 2.24.20221127
  10. Verify no output from NuGet is shown
  11. Run choco outdated
  12. Verify no output from NuGet is shown
  13. Run choco upgrade all
  14. Verify no output from NuGet is shown
  15. Run choco install 7zip.portable --version 19.0 --verbose
  16. Verify the output from NuGet is shown with green text.
  17. Run choco outdated --verbose
  18. Verify the output from NuGet is shown with green text.
  19. Run choco upgrade all --verbose

Operating Systems Testing

  • Windows 11/10

Change Types Made

  • Bug fix (non-breaking change).
  • Feature / Enhancement (non-breaking change).
  • Breaking change (fix or feature that could cause existing functionality to change).
  • Documentation changes.
  • PowerShell code changes.

Change Checklist

  • Requires a change to the documentation.
  • Documentation has been updated.
  • Tests to cover my changes, have been added.
  • All new and existing tests passed?
  • PowerShell code changes: PowerShell v2 compatibility checked?

Related Issue

#508
https://app.clickup.com/t/20540031/PROJ-395

@AdmiringWorm AdmiringWorm self-assigned this Dec 21, 2022
@AdmiringWorm AdmiringWorm requested a review from gep13 December 21, 2022 11:33
This commit updates the normal informational logging
done by NuGet to instead log itself as a verbose message.

This is mainly done so outputs of the sources being hit aren't
outputted by default to the user in the console.
This commit updates the custom nuget logger to ensure
that we get rid of the duplication in the code that is not
necessary.
This commit updates the nuget logger being used to make sure
that all lines that is passed to the logger is prefixed with the
[NuGet] prefix. Not just the first line of the message.
This commit updates the custom nuget project context to
reuse our custom logging implementation to get rid of some
duplication, and to prevent the need to change the logic in
multiple places if there is a need in the future.
@choco-bot
Copy link

Copy link
Member

@gep13 gep13 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gep13 gep13 merged commit 0e6bca6 into chocolatey:develop Dec 21, 2022
@gep13
Copy link
Member

gep13 commented Dec 21, 2022

@AdmiringWorm this looks great! Thanks for getting this added!

@TheCakeIsNaOH TheCakeIsNaOH mentioned this pull request Jan 9, 2023
46 tasks
@AdmiringWorm AdmiringWorm deleted the source-logging branch April 4, 2023 13:07
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.

3 participants