We all have been there, that moment when you need to catch some specific message in your output window but you just can’t because all of those messages going through.
A while back i was working on a project which was quite big in terms of code base. In the process of debugging something i needed to read something from output that i was writing Debug.WriteLine(“Some debug info”) but that proved more challenging then i thought. Once i was starting the app the output was all but useless, entity framework was output queries, different sections were output different outputs for debugging purposes, things like signalr were outputting connection info as well, which made its impossible to get to my information.
In order to combat this i went ahead and created a simple visual studio plugin which would allow me to filter the output window using custom filter which i could save and use them in future.
Using the extension
Install the extension
To open the extension go to View => OtherWindows => Output Filter
On the window that shows click the plus button to add a new filter
Choose how you handle multiple filters
On the filter selection you will find two important selectiosn
Filter Mode: You have two options for the filters, Include or Exclude. Choosing include will shown items that match and if you choose exclude you will show items that do not match, there is a lot of flexibility to cover any case which makes it easier for you to get to your results.
Multi Filter Mode: In some cases you can create more then one filter and select multiple at the same time, you might want to show data that matches all of the filters or data that matches at least one of the filters. Here where this setting comes handy, if you want to filter items that match all of the filters choose And, otherwise choose Or.
The source code can be found in the link below