开发者

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.

  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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜