Open richlander opened 1 year ago
Looks like a codepath hitting info or normal verbosity for the implicit restore.
We should respect verbosity throughout the NuGet commands and then work on saying just enough for each level.
Priority wise this is a nice to have, perhaps we can define some SDK best practices for CLI verbosity output given the only thing I've found is to ensure verbosity is respected.
https://github.com/dotnet/sdk/blob/main/documentation/general/cli-ux-guidelines.md#verbosity
@baronfel
We've captured additional dotnet CLI guidelines in a section of suggestions for CLI authors using System.CommandLine here.
Generally 3 levels seem to be enough:
For this specific case, I can see a few lines that I think would qualify for 'normal' output:
info: Adding PackageReference for package 'spectre.console' into project '/Users/rich/git/font/LedMatrix/samples/Matrix.samples.csproj'. info: Package 'spectre.console' is compatible with all the specified frameworks in project '/Users/rich/git/font/LedMatrix/samples/Matrix.samples.csproj'. info: PackageReference for package 'spectre.console' version '0.46.0' added to file '/Users/rich/git/font/LedMatrix/samples/Matrix.samples.csproj'.
Basically everything talking about implicit restore should be behind the diagnostic verbosity level IMO, and the verbosity level should not leak as a 'prefix' in otherwise-unstructured messages.
We do have other knobs here, though - if a quiet
mode was implemented on the NuGet side, the final output/layout/etc could be handled entirely in the dotnet CLI if the team didn't want to impact NuGet's output directly.
This seems a duplicate issue of #6374 dotnet-nuget doesn't support verbosity.
From the code, we can see that only the later commands dotnet nuget verify/sign
command implement the verbosity in NuGet.CommandLine.XPlat.
If this ticket is still available for community contrib I'd be interested in a taking a look at it.
@johnbrimley please feel free! We marked it help wanted. If you need help, we can assist through PR review.
NuGet Product(s) Affected
dotnet.exe
Current Behavior
This is the default experience for
dotnet add package
.This looks like excellent output for "verbose mode". I am wondering why this is the default experience since there is no call to action from this information in the success case. We should aim to simplify UX. This flow is presumably popular enough that we should seek to improve it.
I don't believe that there is another experience in the product that has this same level of console output.
Here is a nice counterexample, doing something very similar.
Also, there isn't an obvious way to control verbosity.
Desired Behavior
Provide output that is useful for the scenario.
Additional Context
https://github.com/dotnet/sdk/issues/31946