C# Class BytesRoad.Diag.NSTraceOptions

Provides a multilevel switch to control tracing output of the BytesRoad.NetSuit Library.
By using NSTraceOptions class you may setup level of the tracing information output for the BytesRoad.NetSuit Library, form appropriate set of listeners as well as to set up other tracing options.

There is four different level of tracing you may set via Level property. You need to use BytesRoad.Diag.NSTraceOptions.Listeners property to configure set of listeners which you want to be subscribed for tracing information notifications of BytesRoad.NetSuit Library. One of the simple way to enable tracing is to use System.Diagnostics.TextWriterTraceListener class provided by .NET Framework (see example below).

using System; using System.Diagnostics; using System.IO; using BytesRoad.Diag; // Setup tracing options - redirect all tracing // into the 'c:\temp\NetSuitTrace.txt' file void SetupNetSuitTracing() { //trace only errors NSTraceOptions.Level = TraceLevel.Error; //create instance of listener, provided by the .net framework TextWriterTraceListener listener = new TextWriterTraceListener(@"c:\temp\NetSuitTrace.txt"); //adding listener to the collection of listeners NSTraceOptions.Listeners.Add(listener); //disable caching NSTraceOptions.AutoFlush = true; }
Show file Open project: NikolayIT/RatioMaster.NET

Private Methods

Method Description
NSTraceOptions ( ) : System.Diagnostics