Skip to content

Commit

Permalink
Don't move Properties and Items to ProjectEvaluationFinished if legac…
Browse files Browse the repository at this point in the history
…y loggers present

Switch from the "use the new logic if any logger is present that supports it" to the more conservative "use the old logic if any logger doesn't support the new logic".

There are legacy loggers such as the Azure DevOps logger that crash if ProjectStartedEventArgs.Properties is null.

Both console loggers also need more work to properly support the new logic.

Effectively the new logic will now only take place when the binary logger is the only logger.
  • Loading branch information
KirillOsenkov authored and rainersigwald committed Jun 7, 2021
1 parent 2fd48ab commit 794abcb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Build/BackEnd/Components/Logging/LoggingService.cs
Expand Up @@ -514,7 +514,18 @@ public bool IncludeTaskInputs
/// </summary>
public bool IncludeEvaluationPropertiesAndItems
{
get => _includeEvaluationPropertiesAndItems ??= _eventSinkDictionary.Values.OfType<EventSourceSink>().Any(sink => sink.IncludeEvaluationPropertiesAndItems);
get
{
if (_includeEvaluationPropertiesAndItems == null)
{
var sinks = _eventSinkDictionary.Values.OfType<EventSourceSink>();
// .All() on an empty list defaults to true, we want to default to false
_includeEvaluationPropertiesAndItems = sinks.Any() && sinks.All(sink => sink.IncludeEvaluationPropertiesAndItems);
}

return _includeEvaluationPropertiesAndItems ?? false;
}

set => _includeEvaluationPropertiesAndItems = value;
}

Expand Down

0 comments on commit 794abcb

Please sign in to comment.