CSharpTest.Net
Options Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Logging Assembly > (Global) Namespace > Log.Config Class : Options Property

Glossary Item Box

Gets or sets the availability of stack info etc. The following performance characterists were taken with a simple example app running 10 threads each writing 1000 log statements in a tight-loop. The times below reflect threading enabled (someone having called Log.AppStart()). The following hardware was used: AMD Turion 64x2 TL-62 2.10 GHz, 3 GB RAM running Vista 32-bit SP1 (HP Notebook). The time indicated below was estimated by taking the total number of milliseconds until all threads completed and dividing by the 10,000 messages that were written.

Syntax

Visual Basic (Declaration) 
Public Shared Property Options As LogOptions
C# 
public static LogOptions Options {get; set;}

Example

Log/Test/NegativeTests.cs

C#Copy Code
base.Setup();
Log.Config.Output = LogOutputs.TraceWrite;
Log.Config.Options = LogOptions.LogAddAssemblyInfo | LogOptions.LogAddFileInfo | LogOptions.Default;
Log.Config.Level = LogLevels.Verbose;
Log.Config.SetOutputFormat(LogOutputs.TraceWrite, "NegativeTests: {FULLMESSAGE}");

_out = Console.Out;
_error = Console.Error;
Console.SetOut(new StringWriter());
Console.SetError(new StringWriter());
VB.NETCopy Code
MyBase.Setup()
Log.Config.Output = LogOutputs.TraceWrite
Log.Config.Options = LogOptions.LogAddAssemblyInfo Or LogOptions.LogAddFileInfo Or LogOptions.[Default]
Log.Config.Level = LogLevels.Verbose
Log.Config.SetOutputFormat(LogOutputs.TraceWrite, "NegativeTests: {FULLMESSAGE}")

_out = Console.Out
_error = Console.[Error]
Console.SetOut(New StringWriter())
Console.SetError(New StringWriter())

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys