Enables calls to Log.xxx() to be processed on another thread to improve throughput... Place this in a using() statement within Main: using( new Log.AppStart("Some Name") ) This call (and Disponse) IS Thread safe and can be called multiple times either concurrently, sequentially, nested, or overlapping calls are all permitted and handled.
Syntax
Example
Log/Test/NegativeTests.cs
C# | Copy Code |
---|
IDisposable disp = Log.AppStart(null);
disp.Dispose();
disp.Dispose();
foreach( string format in badFormats )
Log.AppStart(format, i_blow_up).Dispose();
disp = Log.Start(null);
disp.Dispose();
disp.Dispose();
foreach (string format in badFormats)
Log.AppStart(format, i_blow_up).Dispose();
foreach (string format in badFormats)
Log.Write(format, i_blow_up);
foreach (string format in badFormats)
Log.Critical(format, i_blow_up);
foreach (string format in badFormats)
Log.Critical(i_blow_up, format, i_blow_up);
Log.Critical(i_blow_up);
foreach (string format in badFormats)
Log.Error(format, i_blow_up);
foreach (string format in badFormats)
Log.Error(i_blow_up, format, i_blow_up);
Log.Error(i_blow_up);
foreach (string format in badFormats)
Log.Warning(format, i_blow_up);
foreach (string format in badFormats)
Log.Warning(i_blow_up, format, i_blow_up);
Log.Warning(i_blow_up);
foreach (string format in badFormats)
Log.Info(format, i_blow_up);
foreach (string format in badFormats)
Log.Info(i_blow_up, format, i_blow_up);
Log.Info(i_blow_up);
foreach (string format in badFormats)
Log.Verbose(format, i_blow_up);
foreach (string format in badFormats)
Log.Verbose(i_blow_up, format, i_blow_up);
Log.Verbose(i_blow_up); |
VB.NET | Copy Code |
---|
Dim disp As IDisposable = Log.AppStart(Nothing)
disp.Dispose()
disp.Dispose()
For Each format As String In badFormats
Log.AppStart(format, i_blow_up).Dispose()
Next
disp = Log.Start(Nothing)
disp.Dispose()
disp.Dispose()
For Each format As String In badFormats
Log.AppStart(format, i_blow_up).Dispose()
Next
For Each format As String In badFormats
Log.Write(format, i_blow_up)
Next
For Each format As String In badFormats
Log.Critical(format, i_blow_up)
Next
For Each format As String In badFormats
Log.Critical(i_blow_up, format, i_blow_up)
Next
Log.Critical(i_blow_up)
For Each format As String In badFormats
Log.[Error](format, i_blow_up)
Next
For Each format As String In badFormats
Log.[Error](i_blow_up, format, i_blow_up)
Next
Log.[Error](i_blow_up)
For Each format As String In badFormats
Log.Warning(format, i_blow_up)
Next
For Each format As String In badFormats
Log.Warning(i_blow_up, format, i_blow_up)
Next
Log.Warning(i_blow_up)
For Each format As String In badFormats
Log.Info(format, i_blow_up)
Next
For Each format As String In badFormats
Log.Info(i_blow_up, format, i_blow_up)
Next
Log.Info(i_blow_up)
For Each format As String In badFormats
Log.Verbose(format, i_blow_up)
Next
For Each format As String In badFormats
Log.Verbose(i_blow_up, format, i_blow_up)
Next
Log.Verbose(i_blow_up) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also