-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Log SDK resolution result #9621
Log SDK resolution result #9621
Conversation
I didn't include the SDK resolver info that resolved the SDK in the success message since we don't mention it in the failure message. Let me know if you think we should log anything else. |
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.
Can you please include examples of the new log output in the PR description? Thank you!
src/Build/BackEnd/Components/SdkResolution/SdkResolverService.cs
Outdated
Show resolved
Hide resolved
I am still trying to figure out how useful would be to log particular SDK resolvers outcome so user UX would be:
as oppose to
with reasoning that when user investigate why it stopped resolving when it just worked fine so far he could see the differences and details. @rainersigwald @baronfel what is your take at this? |
Agree 💯 @rokonec - getting all results could be very helpful. |
2. log each SDK resolver attempt + errors and warnings as message 3. rephrese the success message
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.
We need to fully localize log messages
src/Build/BackEnd/Components/SdkResolution/SdkResolverService.cs
Outdated
Show resolved
Hide resolved
src/Build/BackEnd/Components/SdkResolution/SdkResolverService.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.
Looks great! If resolution fails, warnings and errors will now be logged twice - as low-important messages and as actual warnings and errors by pre-existing code. I may be splitting hair but I think ideally they would appear in the log exactly once. It is also somewhat inconsistent that the existing logic uses individual log events and the new one string-joins all warnings into one message.
I don't fell strongly about fixing it, though. cc @rokonec
Yes, warnings and errors will now be logged twice - as low-important messages and as actual warnings and errors in case when all resolvers failed. I don't like the duplication too. I opted for this approach because we aim to preserve timestamps for each resolver's attempt. The current logic is that in case of resolver succeeded then we want to see only warnings coming from its result and don't want to see other resolvers' warnings. That is why I log them as joined warnings in low-importance message and not as warnings. Alternatively, we could log warnings and errors for each resolver in a single low-importance message before resolution succeeds. In this way, if the resolution fails, we would only see the warnings and errors at the end, a per the current behavior. However, we would lose the timestamps of each resolver's attempt, as opposed to the original change. |
/azp run |
Commenter does not have sufficient privileges for PR 9621 in repo dotnet/msbuild |
I like it the way it is now. i.e.:
I believe it will deliver customers clear intuitive UX. In this particular case I don't mind duplication as I believe it is better UX with it than without it. It can be optimized to not show 1) when 2) but I prefer consistency of logging in both success and failure path. |
src/Build/BackEnd/Components/SdkResolution/SdkResolverService.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Ladi Prosek <ladi.prosek@gmail.com>
Fixes #9413
Context
We currently log when we are starting to resolve SDK and when we failed to resolve SDK but not when we succeeded or any resolvers' attempts.
Currently we log:
Changes Made
Testing
Unit tests + manual
Notes
Example of new log output: