KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.41k stars 188 forks source link

Add support for logging assembly loads logging #653

Closed JanKrivanek closed 1 year ago

JanKrivanek commented 1 year ago

Related to: https://github.com/dotnet/msbuild/issues/6303 Feature in MSBuild: https://github.com/dotnet/msbuild/pull/8316

Context

Adding support for showing assembly load events, prduced by the MSBuild. There is no special treating of the events - they get disaplayed as text message. For sample messages, see the MSBuild PR listed at top. Sample viewer screenshot:

image
JanKrivanek commented 1 year ago

@KirillOsenkov Do you have any quick thoughts why the same events are sometimes displayed as Message sometimes as Property?

image

The Property display happens for MSBuild tasks (indicated by BuildEventCotnext).

Unless this is expected or unless there might be some obvious reason for that I'll of cource investigate closer (I just wanted to see if I'm not missing anything)

KirillOsenkov commented 1 year ago

it looks for space, equals, space to guess whether it’s a property :) The Version = string sometimes contains spaces and sometimes doesn’t :) We can tune the heuristic to account for this case. It ‘s in MessageProcessor.cs somewhere.

JanKrivanek commented 1 year ago

Thank you @KirillOsenkov! It got me into the right direction - the fix proposal: https://github.com/KirillOsenkov/MSBuildStructuredLog/pull/654

Something that seems strange to me now is that those messages do not appear in the search results:

image

Do you have any idea for reason for that?

KirillOsenkov commented 1 year ago

yes you need to intern the strings in a special way to include them in search, look for Intern() methods used everywhere in Construction.cs and MessageProcessor.cs

JanKrivanek commented 1 year ago

Thank you! Works like a charm now! ;-) (https://github.com/KirillOsenkov/MSBuildStructuredLog/pull/654)