Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The folder contains collection of docs and references for MSBuild, detailed info
### Logging

* [Binary log](wiki/Binary-Log.md)
* [Live logger: how to opt in](livelogger/Opt-In-Mechanism.md)
* [Terminal logger: how to opt in](terminallogger/Opt-In-Mechanism.md)

## Archived Designs
* [Resolve Assembly Reference as a service](specs/rar-as-service.md)
Expand Down
2 changes: 1 addition & 1 deletion documentation/terminallogger/Opt-In-Mechanism.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Using the `/terminallogger` or `/tl` command line switches, users are able to op

### Enabling for all builds

Users can set the `MSBUILDLIVELOGGER` environment variable to enable TerminalLogger without adding a swtich to all build invocations.
Users can set the `MSBUILDTERMINALLOGGER` environment variable to enable TerminalLogger without adding a swtich to all build invocations.

### TerminalLogger parameters

Expand Down
4 changes: 2 additions & 2 deletions src/Build/BackEnd/Components/Logging/LoggingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1657,8 +1657,8 @@ private void UpdateMinimumMessageImportance(ILogger logger)
// The null logger has no effect on minimum verbosity.
Execution.BuildManager.NullLogger => null,

// The live logger consumes only high priority messages.
_ => innerLogger.GetType().FullName == "Microsoft.Build.Logging.LiveLogger.LiveLogger"
// The terminal logger consumes only high priority messages.
_ => innerLogger.GetType().FullName == "Microsoft.Build.Logging.TerminalLogger.TerminalLogger"
? MessageImportance.High
// If the logger is not on our allow list, there are no importance guarantees. Fall back to "any importance".
: MessageImportance.Low,
Expand Down
11 changes: 3 additions & 8 deletions src/MSBuild.UnitTests/CommandLineSwitches_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,18 @@ public void DistributedFileLoggerSwitchIdentificationTests(string distributedfil
}

[Theory]
[InlineData("ll")]
[InlineData("LL")]
[InlineData("livelogger")]
[InlineData("LiveLogger")]
[InlineData("LIVELOGGER")]
[InlineData("tl")]
[InlineData("TL")]
[InlineData("terminallogger")]
[InlineData("TerminalLogger")]
[InlineData("TERMINALLOGGER")]
public void LiveLoggerSwitchIdentificationTests(string livelogger)
public void TerminalLoggerSwitchIdentificationTests(string terminallogger)
{
CommandLineSwitches.ParameterizedSwitch parameterlessSwitch;
string duplicateSwitchErrorMessage;

CommandLineSwitches.IsParameterizedSwitch(livelogger, out parameterlessSwitch, out duplicateSwitchErrorMessage, out bool multipleParametersAllowed, out string missingParametersErrorMessage, out bool unquoteParameters, out bool emptyParametersAllowed).ShouldBeTrue();
parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.LiveLogger);
CommandLineSwitches.IsParameterizedSwitch(terminallogger, out parameterlessSwitch, out duplicateSwitchErrorMessage, out bool multipleParametersAllowed, out string missingParametersErrorMessage, out bool unquoteParameters, out bool emptyParametersAllowed).ShouldBeTrue();
parameterlessSwitch.ShouldBe(CommandLineSwitches.ParameterizedSwitch.TerminalLogger);
duplicateSwitchErrorMessage.ShouldBeNull();
multipleParametersAllowed.ShouldBeTrue();
missingParametersErrorMessage.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using System.Threading.Tasks;

using Microsoft.Build.Framework;
using Microsoft.Build.Logging.LiveLogger;
using Microsoft.Build.Logging.TerminalLogger;

using VerifyTests;
using VerifyXunit;
Expand All @@ -22,7 +22,7 @@
namespace Microsoft.Build.UnitTests
{
[UsesVerify]
public class LiveLogger_Tests : IEventSource, IDisposable
public class TerminalLogger_Tests : IEventSource, IDisposable
{
private const int _nodeCount = 8;
private const string _eventSender = "Test";
Expand All @@ -31,7 +31,7 @@ public class LiveLogger_Tests : IEventSource, IDisposable
private StringWriter _outputWriter = new();

private readonly Terminal _mockTerminal;
private readonly LiveLogger _liveLogger;
private readonly TerminalLogger _terminallogger;

private readonly DateTime _buildStartTime = new DateTime(2023, 3, 30, 16, 30, 0);
private readonly DateTime _buildFinishTime = new DateTime(2023, 3, 30, 16, 30, 5);
Expand All @@ -40,12 +40,12 @@ public class LiveLogger_Tests : IEventSource, IDisposable

private static Regex s_elapsedTime = new($@"\d+{Regex.Escape(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)}\ds", RegexOptions.Compiled);

public LiveLogger_Tests()
public TerminalLogger_Tests()
{
_mockTerminal = new Terminal(_outputWriter);
_liveLogger = new LiveLogger(_mockTerminal);
_terminallogger = new TerminalLogger(_mockTerminal);

_liveLogger.Initialize(this, _nodeCount);
_terminallogger.Initialize(this, _nodeCount);

UseProjectRelativeDirectory("Snapshots");

Expand Down Expand Up @@ -98,7 +98,7 @@ public LiveLogger_Tests()

public void Dispose()
{
_liveLogger.Shutdown();
_terminallogger.Shutdown();
}

#endregion
Expand Down Expand Up @@ -251,7 +251,7 @@ public void DisplayNodesShowsCurrent()
{
InvokeLoggerCallbacksForSimpleProject(succeeded: false, async () =>
{
_liveLogger.DisplayNodes();
_terminallogger.DisplayNodes();

await Verify(_outputWriter.ToString(), _settings);
});
Expand All @@ -270,7 +270,7 @@ public async Task DisplayNodesOverwritesWithNewTargetFramework()
TargetStarted?.Invoke(_eventSender, MakeTargetStartedEventArgs(_projectFile, "Build"));
TaskStarted?.Invoke(_eventSender, MakeTaskStartedEventArgs(_projectFile, "Task"));

_liveLogger.DisplayNodes();
_terminallogger.DisplayNodes();

// This is a bit fast and loose with the events that would be fired
// in a real "stop building that TF for the project and start building
Expand All @@ -281,7 +281,7 @@ public async Task DisplayNodesOverwritesWithNewTargetFramework()
ProjectStarted?.Invoke(_eventSender, pse2);
TargetStarted?.Invoke(_eventSender, MakeTargetStartedEventArgs(_projectFile, "Build"));

_liveLogger.DisplayNodes();
_terminallogger.DisplayNodes();

await Verify(_outputWriter.ToString(), _settings);
}
Expand Down
4 changes: 2 additions & 2 deletions src/MSBuild/CommandLineSwitches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ internal enum ParameterizedSwitch
FileLoggerParameters7,
FileLoggerParameters8,
FileLoggerParameters9,
LiveLogger,
TerminalLogger,
NodeReuse,
Preprocess,
Targets,
Expand Down Expand Up @@ -246,7 +246,7 @@ internal ParameterizedSwitchInfo(
new ParameterizedSwitchInfo( new string[] { "fileloggerparameters7", "flp7" }, ParameterizedSwitch.FileLoggerParameters7, null, false, "MissingFileLoggerParameterError", true, false),
new ParameterizedSwitchInfo( new string[] { "fileloggerparameters8", "flp8" }, ParameterizedSwitch.FileLoggerParameters8, null, false, "MissingFileLoggerParameterError", true, false),
new ParameterizedSwitchInfo( new string[] { "fileloggerparameters9", "flp9" }, ParameterizedSwitch.FileLoggerParameters9, null, false, "MissingFileLoggerParameterError", true, false),
new ParameterizedSwitchInfo( new string[] { "livelogger", "ll", "terminallogger", "tl" }, ParameterizedSwitch.LiveLogger, null, true, null, true, true),
new ParameterizedSwitchInfo( new string[] { "terminallogger", "tl" }, ParameterizedSwitch.TerminalLogger, null, true, null, true, true),
new ParameterizedSwitchInfo( new string[] { "nodereuse", "nr" }, ParameterizedSwitch.NodeReuse, null, false, "MissingNodeReuseParameterError", true, false),
new ParameterizedSwitchInfo( new string[] { "preprocess", "pp" }, ParameterizedSwitch.Preprocess, null, false, null, true, false),
new ParameterizedSwitchInfo( new string[] { "targets", "ts" }, ParameterizedSwitch.Targets, null, false, null, true, false),
Expand Down
2 changes: 1 addition & 1 deletion src/MSBuild/MSBuild.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<Compile Include="DistributedLoggerRecord.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="LiveLogger\*.cs" />
<Compile Include="TerminalLogger\*.cs" />
<Compile Include="InitializationException.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
Expand Down
14 changes: 7 additions & 7 deletions src/MSBuild/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@
<data name="UnsupportedSwitchForSolutionFiles" Visibility="Public">
<value>The '{0}' switch is not supported for solution files.</value>
</data>
<!-- **** LiveLogger strings begin **** -->
<!-- **** TerminalLogger strings begin **** -->
<data name="RestoreComplete" xml:space="preserve">
<value>Restore complete ({0}s)</value>
<comment>
Expand All @@ -1405,31 +1405,31 @@
<data name="BuildResult_FailedWithErrors" xml:space="preserve">
<value>failed with errors</value>
<comment>
Part of Live Logger summary message: "Build {BuildResult_X} in {duration}s"
Part of Terminal Logger summary message: "Build {BuildResult_X} in {duration}s"
</comment>
</data>
<data name="BuildResult_FailedWithWarnings" xml:space="preserve">
<value>failed with warnings</value>
<comment>
Part of Live Logger summary message: "Build {BuildResult_X} in {duration}s"
Part of Terminal Logger summary message: "Build {BuildResult_X} in {duration}s"
</comment>
</data>
<data name="BuildResult_Failed" xml:space="preserve">
<value>failed</value>
<comment>
Part of Live Logger summary message: "Build {BuildResult_X} in {duration}s"
Part of Terminal Logger summary message: "Build {BuildResult_X} in {duration}s"
</comment>
</data>
<data name="BuildResult_Succeeded" xml:space="preserve">
<value>succeeded</value>
<comment>
Part of Live Logger summary message: "Build {BuildResult_X} in {duration}s"
Part of Terminal Logger summary message: "Build {BuildResult_X} in {duration}s"
</comment>
</data>
<data name="BuildResult_SucceededWithWarnings" xml:space="preserve">
<value>succeeded with warnings</value>
<comment>
Part of Live Logger summary message: "Build {BuildResult_X} in {duration}s"
Part of Terminal Logger summary message: "Build {BuildResult_X} in {duration}s"
</comment>
</data>
<data name="ProjectFinished_NoTF" xml:space="preserve">
Expand Down Expand Up @@ -1481,7 +1481,7 @@
{4}: duration in seconds with 1 decimal point
</comment>
</data>
<!-- **** LiveLogger strings end **** -->
<!-- **** TerminalLogger strings end **** -->

<!--
The command line message bucket is: MSB1001 - MSB1999
Expand Down
10 changes: 5 additions & 5 deletions src/MSBuild/Resources/xlf/Strings.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/MSBuild/Resources/xlf/Strings.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/MSBuild/Resources/xlf/Strings.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/MSBuild/Resources/xlf/Strings.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading