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

Glossary Item Box

Gets or sets the current log LogLevel

Syntax

Visual Basic (Declaration) 
Public Shared Property Level As LogLevels
C# 
public static LogLevels Level {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