Trace Related

Today I wrote a vey simple demo to show the use of Trace Relate class, which are all int the namespace System.Diagnostics: Trace, TraceSwitch, TraceListener.

App.config

Code

Code

Code

Whatever, Trace and TraceSwitch are all simple concepts, and are really easy to use. Pay attention to this line of code:

TraceSwitch traceS = new TraceSwitch("traceS", "Application Switch");

The constructor of TraceSwitch will use the info of

原文地址:https://www.cnblogs.com/xingyukun/p/1258393.html