dotnet / dotnet/msbuild

MuxLogger discrepancy introduced by new event

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

Description

MuxLogger and normal logger have output difference of a blank line with the introduction of new event. The [Mux Logger test](https://github.com/maridematte/msbuild/blob/9fa9d800dabce3bfcf8365f651f3a713e01f8a85/src/Utilities.UnitTests/MuxLogger_Tests.cs#L129) was made more lenient so we could get work done without this being a blocker. This issue is being created to keep track of this difference and address it in the future.

## Context
When adding the new event `BuildSubmissionStartedEventArgs` (https://github.com/dotnet/msbuild/pull/10424) an unintentional side effect was changing how the logging output looks like. This is happening because there is a difference in event order between loggers.

Using the case of the `MockLogger`. The `MockLogger` will receive a `BuildStartedEvent`, log it, and then receive `BuildSubmissionStartedEvent`, log it, and then receive `ProjectStartedEvent` and log it.
```mermaid
flowchart LR
BS[BuildStartedEvent] --> BSS[BuildSubmissionStartedEvent] --> BS2[ProjectStartedEvent]
```

The MuxLogger will receive a `BuildStartedEvent`, ignore it, receive a `BuildSubmissionStartedEvent`, log it, and then receive `ProjectStartedEvent` when it will create an artificial `BuildStartedEvent` that will then log before logging `ProjectStartedEvent`.
```mermaid
flowchart LR
BS[BuildSubmissionStartedEvent] --> BSS[BuildStartedEvent] --> BS2[ProjectStartedEvent]
```

This causes the general event order to be different and for the outputs to be different.

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.