C# Class Skytap.Utilities.TraceLogger

Logs information using event listeners and built in System.Diagnostics.Trace functionality.
Inheritance: Logger
显示文件 Open project: skytap/Skytap-TFS-Automation-Pack Class Usage Examples

Private Properties

Property Type Description
InitializeLogFile void

Public Methods

Method Description
Flush ( ) : void

Write out the contents of the log string to the file, flushing the contents of the in-memory string.

Reset ( ) : void

Resets the log file by flushing the Trace, closing any files, and creating a new log filename.

This method will likely not be frequently used outside of tests, but is provided to start a new session without closing down the instance.

TraceLogger ( ) : System

Constructor for TraceLogger class.

TraceLogger ( TraceListener listener ) : System

Constructor for TraceLogger class.

This constructor allows for overriding the default type of TraceListener. This can be useful for test purposes when a log file need not be generated.

Protected Methods

Method Description
Dispose ( bool disposing ) : void
_LogError ( string message ) : void
_LogImportant ( string message ) : void
_LogInfo ( string message ) : void

Private Methods

Method Description
InitializeLogFile ( ) : void

Method Details

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

Flush() public method

Write out the contents of the log string to the file, flushing the contents of the in-memory string.
public Flush ( ) : void
return void

Reset() public method

Resets the log file by flushing the Trace, closing any files, and creating a new log filename.
This method will likely not be frequently used outside of tests, but is provided to start a new session without closing down the instance.
public Reset ( ) : void
return void

TraceLogger() public method

Constructor for TraceLogger class.
public TraceLogger ( ) : System
return System

TraceLogger() public method

Constructor for TraceLogger class.
This constructor allows for overriding the default type of TraceListener. This can be useful for test purposes when a log file need not be generated.
public TraceLogger ( TraceListener listener ) : System
listener System.Diagnostics.TraceListener
return System

_LogError() protected method

protected _LogError ( string message ) : void
message string
return void

_LogImportant() protected method

protected _LogImportant ( string message ) : void
message string
return void

_LogInfo() protected method

protected _LogInfo ( string message ) : void
message string
return void