开发者

Visual Studio 2010 C#: Filter Trace Output

开发者 https://www.devze.com 2023-03-29 19:26 出处:网络
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

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.

  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,

0

精彩评论

暂无评论...
验证码 换一张
取 消