Flo
Flo

Reputation: 11

Visual Studio 2010 C#: Filter Trace Output

Is it possible to filter 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.

Upvotes: 1

Views: 1333

Answers (1)

Dennis
Dennis

Reputation: 20561

You have a few options, two require code and one is a VS 2010 add-in.

  1. 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.

  2. Write your own DefaultTraceListener, read this article for some information and search Google for examples.

  3. 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,

Upvotes: 1

Related Questions