C# Class AlarmWorkflow.Shared.Diagnostics.ExceptionIntervalLogger

Writes Exception Loggs at a predetermined interval.
显示文件 Open project: OpenFireSource/AlarmWorkflow Class Usage Examples

Public Methods

Method Description
ExceptionIntervalLogger ( System.TimeSpan logInterval ) : System

Initializes the Exception Logger.

LogException ( object source, Exception ex ) : void

Log a exception. The Logger decides to log or discard the exception.

LogFormat ( Exception ex, LogType type, object source, string format ) : void

Ability to log the exception as formatted text.

ResetExceptionCollection ( ) : void

Reset the stored exception entries.

Private Methods

Method Description
ShouldLogException ( Exception ex ) : bool

Method Details

ExceptionIntervalLogger() public method

Initializes the Exception Logger.
public ExceptionIntervalLogger ( System.TimeSpan logInterval ) : System
logInterval System.TimeSpan the interval how often a Exception should be logged
return System

LogException() public method

Log a exception. The Logger decides to log or discard the exception.
public LogException ( object source, Exception ex ) : void
source object The component from which this type comes. The type name of the instance is used.
ex System.Exception The exception.
return void

LogFormat() public method

Ability to log the exception as formatted text.
public LogFormat ( Exception ex, LogType type, object source, string format ) : void
ex System.Exception The exception.
type LogType The message type.
source object The component from which this type comes. The type name of the instance is used.
format string The text to use as the format string.
return void

ResetExceptionCollection() public method

Reset the stored exception entries.
public ResetExceptionCollection ( ) : void
return void