msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Prevent unwanted logging of eval data

Open JanKrivanek opened this issue 1 year ago • 0 comments

Context

https://github.com/dotnet/msbuild/pull/10508 made it possible to properly distinguish if just some loggers requests evaluation data (expresse via IEventSource4.IncludeEvaluationPropertiesAndItems). However if this is not called the data are still included on ProjectStartedEventArgs - this is required to support older loggers (which expected the data on ProjectStartedEventArgs).

So we can end up in one of the situations:

  • Data are included in EvaluationFinishedEventArgs (if all loggers explicitly opted in)
  • Data are included in ProjectStartedEventArgs (if none logger opted in)
  • Data are included in both events (if we have mix of above)

But there is currently no way to indicate that no eval data are needed.

Goals

  • Intoduce IEventSource5 and on it a method/property to indicate no eval data are needed (e.g. ExcludeEvaluationPropertiesAndItems)
  • Call this from SimpleErrorLogger, BaseConsoleLogger (depending on verbosity level), TerminalLogger (unless it leverages the eval data which might happen soon)
  • Expose the method on MuxLogger and inform users of MuxLogger about the existence of this
  • SimpleErrorLogger should as well set OnlyLogCriticalEvents

JanKrivanek avatar Aug 15 '24 15:08 JanKrivanek