KirillOsenkov / MSBuildStructuredLog

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

Filter search results to just one project #569

Closed AArnott closed 2 years ago

AArnott commented 2 years ago

Many binlogs have many projects in them, even if I only wanted to build one project. When I search for a target or task in the "Search Log" tab, all the projects appear and I have to sift through them.

I've love a way to filter search results to a particular project. Even better, offer a way to search any arbitrary node that I have selected. Often I want to find whether a particular dll shows up in a task's input parameters (which may be quite large), but searching for the dll's name in Search log turns up hundreds of results other than the one task invocation I'm curious about.

KirillOsenkov commented 2 years ago

You can do it all.

Append project(foo.csproj) to the search query to limit to only results under that project (the string in the parentheses is a substring of the project name and doesn't need to include the .csproj extension).

You can append under($task csc) to search only under nodes that satisfy the nested query (can be an arbitrary query, in this case only search under Csc tasks).

notunder(...) will exclude results that satisfy the nested query.

project(), under() and notunder() clauses can be nested arbitrarily, e.g. $additem Compile under($target ResolveAssemblyReferences project(foo project(bar))) will look for all Compile item additions under RAR of the project foo, only when built as a dependency of the project bar.

Finally you can right-click any named node and use Search in subtree, which will append the special under($234) clause. 234 is the unique identifier of the node you clicked. You can also click on Exclude subtree from search which will result in the notunder() clause instead.

It's all in the search watermark ;)

image

AArnott commented 2 years ago

Wow. Thank you.