dotnet / dotnet/msbuild

Prevent unwanted logging of eval data

Open
#10,525 0 comments 0 reactions 0 assignees View on GitHub
Area: Logging Area: Performance triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### 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](https://dev.azure.com/devdiv/DevDiv/_search?text=muxlogger*&type=code&pageSize=25&filters=ProjectFilters%7BDevDiv%7DRepositoryFilters%7BAnyCode*CPS*VS%7D&action=contents&result=DefaultCollection/DevDiv/CPS/GBmain//src/Microsoft.VisualStudio.ProjectSystem.Implementation/Build/IndependentBuildManagerHost.cs) about the existence of this
* `SimpleErrorLogger` should as well set `OnlyLogCriticalEvents`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.