Skip to content

Commit

Permalink
Add a way to write output (#10203)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd committed Jun 13, 2024
1 parent 3deec2f commit 63f447b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/MSBuild/TerminalLogger/TerminalLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,14 @@ private void BuildFinished(object sender, BuildFinishedEventArgs e)

Terminal.BeginUpdate();
try
{
{
if (Verbosity > LoggerVerbosity.Quiet)
{
string duration = (e.Timestamp - _buildStartTime).TotalSeconds.ToString("F1");
string buildResult = RenderBuildResult(e.Succeeded, _buildErrorsCount, _buildWarningsCount);

Terminal.WriteLine("");
if(_testRunSummaries.Any())
if (_testRunSummaries.Any())
{
var total = _testRunSummaries.Sum(t => t.Total);
var failed = _testRunSummaries.Sum(t => t.Failed);
Expand Down Expand Up @@ -864,7 +864,16 @@ private void MessageRaised(object sender, BuildMessageEventArgs e)
: e.Timestamp > _testEndTime
? e.Timestamp : _testEndTime;
}


break;
}

case "TLTESTOUTPUT":
{
if (e.Message != null && Verbosity > LoggerVerbosity.Quiet)
{
RenderImmediateMessage(e.Message);
}
break;
}
}
Expand Down Expand Up @@ -936,7 +945,7 @@ private void WarningRaised(object sender, BuildWarningEventArgs e)
private void ErrorRaised(object sender, BuildErrorEventArgs e)
{
BuildEventContext? buildEventContext = e.BuildEventContext;

if (buildEventContext is not null
&& _projects.TryGetValue(new ProjectContext(buildEventContext), out Project? project)
&& Verbosity > LoggerVerbosity.Quiet)
Expand All @@ -951,7 +960,7 @@ private void ErrorRaised(object sender, BuildErrorEventArgs e)
}
}

#endregion
#endregion

#region Refresher thread implementation

Expand Down

0 comments on commit 63f447b

Please sign in to comment.