Skip to content

Fix issue 7828: enabling the binary logger adds console output#7989

Merged
Forgind merged 10 commits intodotnet:mainfrom
fanhaipeng:fanhaipeng-issue7828
Oct 7, 2022
Merged

Fix issue 7828: enabling the binary logger adds console output#7989
Forgind merged 10 commits intodotnet:mainfrom
fanhaipeng:fanhaipeng-issue7828

Conversation

@fanhaipeng
Copy link
Contributor

Fixes #7828

Context

Binary logger option overrides verbosity by diagnostic and prints a line even verbosity is set to quiet.

Changes Made

The fix introduces a variable to store the original verbosity, if the "original verbosity" is quiet, it suppresses the console output when binary logger is requested.

Testing

Notes

@fanhaipeng fanhaipeng changed the title Fanhaipeng issue7828 Fix issue 7828: enabling the binary logger adds console output Sep 20, 2022
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Can you please add a regression test, using RunnerUtilities.ExecMSBuild like

RunnerUtilities.ExecMSBuild($"{projectFile.Path} -bl:{logger.Parameters}", out bool success);

that validates the stdout output?

Copy link
Contributor

@Forgind Forgind left a comment

Choose a reason for hiding this comment

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

LGTM!

}

if (verbosity == LoggerVerbosity.Diagnostic)
if (verbosity == LoggerVerbosity.Diagnostic && originalVerbosity != LoggerVerbosity.Quiet)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe just:

Suggested change
if (verbosity == LoggerVerbosity.Diagnostic && originalVerbosity != LoggerVerbosity.Quiet)
if (originalVerbosity == LoggerVerbosity.Diagnostic)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when bl is set and other verbosity than quiet/diagnostic is set, the output is still wanted.

Copy link
Member

Choose a reason for hiding this comment

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

This is interesting. My instinct was to suppress the message for "quiet", "minimal" and "normal" but leave it for "detailed" and "diagnostic". Why "quiet" only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... we need more requirement clarifications. My understanding of the requirement is solely from the #7828 statement. It seems we three have different understandings, let me know how we can make an agreement. @rainersigwald / @Forgind

Copy link
Member

Choose a reason for hiding this comment

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

@Forgind and I actually talked about this this morning, and I think it's ok for it to be there for "diagnostic" only.

@dnfadmin
Copy link

dnfadmin commented Sep 21, 2022

CLA assistant check
All CLA requirements met.

@dnfadmin
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ fanhaipeng sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@fanhaipeng
Copy link
Contributor Author

Hi @Forgind / @rainersigwald, the failed test case is from MultiplePlugins, should not be related to my change, what next step do you recommend? Thanks

Microsoft.Build.Engine.UnitTests.ProjectCache.ProjectCacheTests.MultiplePlugins
System.IndexOutOfRangeException : Index was outside the bounds of the array.

@Forgind
Copy link
Contributor

Forgind commented Sep 21, 2022

@fanhaipeng, I reran it, and it passed.

/cc: @dfederm for awareness on the flaky test.

Copy link
Contributor

@Forgind Forgind left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

I'd like to hold this for 17.5/7.0.200 since it's a fairly visible behavior change, but this looks good, thanks!

@rainersigwald rainersigwald added this to the VS 17.5 milestone Sep 26, 2022
@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Oct 3, 2022
@Forgind Forgind merged commit 9e6f145 into dotnet:main Oct 7, 2022
@Forgind
Copy link
Contributor

Forgind commented Oct 7, 2022

Thanks @fanhaipeng!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enabling the binary logger adds console output

4 participants