Visual Studio 2010 C#: Filter Trace Output
Is it possible to fil开发者_开发技巧ter the Output Window in Visual Studio 2010, when writing with Trace.WriteLine to it? For example, I got different trace categories, which I want to filter for.
You have a few options, two require code and one is a VS 2010 add-in.
Use NLog with a DebugTarget to redirect logging to the Output window. You can then log information at different levels, e.g. Trace, Debug, Error, Warn, Info.
Write your own
DefaultTraceListener
, read this article for some information and search Google for examples.There is an add-in in the Visual Studio Gallery that may help, I've used it before however I cannot recall the name and a quick search did not turn up any results.
HTH,
精彩评论