IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Common.InternalTrace Class Reference

InternalTrace provides facilities for tracing the execution of the NUnit framework. Tests and classes under test may make use of Console writes, System.Diagnostics.Trace or various loggers and NUnit itself traps and processes each of them. For that reason, a separate internal trace is needed. More...

+ Collaboration diagram for NUnit.Common.InternalTrace:

Static Public Member Functions

static void Initialize (string logName, InternalTraceLevel level)
 Initialize the internal trace facility using the name of the log to be written to and the trace level. More...
 
static void Initialize (TextWriter writer, InternalTraceLevel level)
 Initialize the internal trace using a provided TextWriter and level More...
 
static Logger GetLogger (string name)
 Get a named Logger More...
 
static Logger GetLogger (Type type)
 Get a logger named for a particular Type. More...
 

Properties

static bool Initialized [get, private set]
 Gets a flag indicating whether the InternalTrace is initialized More...
 

Static Private Attributes

static InternalTraceLevel traceLevel
 
static InternalTraceWriter traceWriter
 

Detailed Description

InternalTrace provides facilities for tracing the execution of the NUnit framework. Tests and classes under test may make use of Console writes, System.Diagnostics.Trace or various loggers and NUnit itself traps and processes each of them. For that reason, a separate internal trace is needed.

Note: InternalTrace uses a global lock to allow multiple threads to write trace messages. This can easily make it a bottleneck so it must be used sparingly. Keep the trace Level as low as possible and only insert InternalTrace writes where they are needed. TODO: add some buffering and a separate writer thread as an option. TODO: figure out a way to turn on trace in specific classes only.

Member Function Documentation

static void NUnit.Common.InternalTrace.Initialize ( string  logName,
InternalTraceLevel  level 
)
inlinestatic

Initialize the internal trace facility using the name of the log to be written to and the trace level.

Parameters
logNameThe log name
levelThe trace level

Referenced by NUnit.Framework.Api.FrameworkController.Initialize(), and NUnitLite.AutoRun.InitializeInternalTrace().

static void NUnit.Common.InternalTrace.Initialize ( TextWriter  writer,
InternalTraceLevel  level 
)
inlinestatic

Initialize the internal trace using a provided TextWriter and level

Parameters
writerA TextWriter
levelThe InternalTraceLevel

References NUnit.Common.InternalTraceWriter.WriteLine().

static Logger NUnit.Common.InternalTrace.GetLogger ( string  name)
inlinestatic

Get a named Logger

Returns
static Logger NUnit.Common.InternalTrace.GetLogger ( Type  type)
inlinestatic

Get a logger named for a particular Type.

Member Data Documentation

InternalTraceLevel NUnit.Common.InternalTrace.traceLevel
staticprivate
InternalTraceWriter NUnit.Common.InternalTrace.traceWriter
staticprivate

Property Documentation

bool NUnit.Common.InternalTrace.Initialized
staticgetprivate set

Gets a flag indicating whether the InternalTrace is initialized


The documentation for this class was generated from the following file: