Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Extended messages data to binary log #9198

Merged
merged 6 commits into from
Oct 2, 2023

Conversation

rokonec
Copy link
Contributor

@rokonec rokonec commented Aug 31, 2023

Fixes #9091

Context

We have introducing new extended event args (error, warn, message, custom) so time ago.
This PR is about logging extended data into binary log and will serve for modifying bin log viewer as well.

Changes Made

Add BuildEventArgsFieldFlags.Extended and implement related code.

Testing

Unit tests

Notes

@rokonec
Copy link
Contributor Author

rokonec commented Aug 31, 2023

@KirillOsenkov I suppose we shall 1st release forward compatible log viewer. We can do it in two phases:

  1. make it read new file version
  2. UI changes to somehow show extended data

While I can easily do 1 for 2 I might need some help.
We expect that after C++ teams implement extended error logs people might start to need it frequently.

@KirillOsenkov
Copy link
Member

Do we have a design document or a wiki page outlining the problem space, the motivation and the proposed approach? What do we know about the existing usage of the "exotic" event args? Do we have a list of teams/scenarios depending on these?

As we discover scenarios and knowledge, let's add to the doc. I'm sure we'll break someone, so would be nice to point them to the doc. I've always felt uncertainty about the exotic event args - they're ancient and it's unclear who if anyone is still using them and for what. Would also help to know these scenarios so we can test and validate.

@rokonec
Copy link
Contributor Author

rokonec commented Aug 31, 2023

@KirillOsenkov

Research of usage custom event arguments was concluded in:
#8825

Custom event arguments has been deprecated for dotnet core msbuild in favor of new messages containing general purpose transparent payload. See #8917

I would not care too much about binlog supporting rare needs for custom events args.
However, for close future, C++ team is improving VS with enhanced structured errors and warnings info json format called SARIF. These structured data comes from C++ compiler.

We believe, that there can be substantial value in capturing and showing such info in log viewer. And this PR is the part of such effort.

@KirillOsenkov
Copy link
Member

KirillOsenkov commented Aug 31, 2023

Sounds good. I'm missing a ton of context, but superficially everything seems fine.

See if you can utilize BuildEventArgsFieldFlags in any way:
https://source.dot.net/#Microsoft.Build/Logging/BinaryLogger/BuildEventArgsFieldFlags.cs,58948e4bf96933c9,references

Perhaps you can avoid writing a boolean to see if extended data is present if you can write a single bit in the flags.

@rokonec
Copy link
Contributor Author

rokonec commented Sep 1, 2023

@KirillOsenkov I have totally missed BuildEventArgsFieldFlags. Have just simplified and rewritten it. Good catch. Thx

@rokonec
Copy link
Contributor Author

rokonec commented Sep 1, 2023

It is ready for review. I just left it in Draft so it is not merged before we release compatible log viewer.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

src/Build/Logging/BinaryLogger/ExtendedDataFields.cs Outdated Show resolved Hide resolved
@KirillOsenkov
Copy link
Member

Looks OK as far as I can see

@rokonec rokonec changed the title Add Extended messages data to binary log [DO NOT MERGE YET] Add Extended messages data to binary log Sep 5, 2023
@rokonec rokonec marked this pull request as ready for review September 5, 2023 14:20
@rokonec rokonec changed the title [DO NOT MERGE YET] Add Extended messages data to binary log Add Extended messages data to binary log Sep 7, 2023
@JanKrivanek JanKrivanek merged commit d074c12 into dotnet:main Oct 2, 2023
8 checks passed
bulatgrzegorz pushed a commit to bulatgrzegorz/selective-condition-evaluator that referenced this pull request Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BinFmt] Support extended messages in binary log and binary viewer
4 participants