-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use terminal logger when building file-based apps #49385
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
@@ -88,8 +84,8 @@ public VirtualProjectBuildingCommand( | |||
public override int Execute() | |||
{ | |||
Debug.Assert(!(NoRestore && NoBuild)); | |||
var consoleLogger = RunCommand.MakeTerminalLogger(Verbosity); | |||
var binaryLogger = GetBinaryLogger(BinaryLoggerArgs); | |||
var consoleLogger = TerminalLogger.CreateTerminalOrConsoleLogger(LoggerArgs); |
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.
Did RunCommand.MakeTerminalLogger
not create a terminal logger, you ask? No:
sdk/src/Cli/dotnet/Commands/Run/RunCommand.cs
Lines 397 to 404 in a37b351
internal static ILogger MakeTerminalLogger(VerbosityOptions? verbosity) | |
{ | |
var msbuildVerbosity = ToLoggerVerbosity(verbosity); | |
// Temporary fix for 9.0.1xx. 9.0.2xx will use the TerminalLogger in the safe way. | |
var thing = new ConsoleLogger(msbuildVerbosity); | |
return thing!; | |
} |
But I'm not confident that should change, because that's used for evaluating the project after it's built and if terminal logger is used there, it results in additional "Build succeeded in 0.0s" message like:
whereas if the evaluation phase continues to use the console logger, it's nicely quiet.
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.
IIRC what I was planning to do was crank down the verbosity for the evaluations when I went back to TL to prevent that addtional output, but you have a point
IReadOnlyList<string> msbuildArgs, | ||
VerbosityOptions? verbosity, | ||
bool interactive) | ||
string[] msbuildArgs) |
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.
Why not call it loggerArgs
so it lines up with the property name?
string[] msbuildArgs) | |
string[] loggerArgs) |
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.
It's also used to fill GlobalProperties, only afterwards the property is used for logger construction, hence LoggerArgs.
{ | ||
Debug.Assert(Path.IsPathFullyQualified(entryPointFileFullPath)); | ||
|
||
EntryPointFileFullPath = entryPointFileFullPath; | ||
GlobalProperties = new(StringComparer.OrdinalIgnoreCase); | ||
CommonRunHelpers.AddUserPassedProperties(GlobalProperties, msbuildArgs); | ||
BinaryLoggerArgs = msbuildArgs; | ||
Verbosity = verbosity ?? RunCommand.GetDefaultVerbosity(interactive: interactive); | ||
LoggerArgs = msbuildArgs; |
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.
LoggerArgs = msbuildArgs; | |
LoggerArgs = loggerArgs; |
No description provided.