Click or drag to resize
TraceLogger Class
Creates a log file for a driver or application. Uses a similar file name and internal format to the serial logger. Multiple logs can be created simultaneously if needed.
Inheritance Hierarchy
SystemObject
  ASCOM.UtilitiesTraceLogger

Namespace: ASCOM.Utilities
Assembly: ASCOM.Utilities (in ASCOM.Utilities.dll) Version: 6.0.0.0 (6.2.0.2774)
Syntax
public class TraceLogger : IDisposable

The TraceLogger type exposes the following members.

Constructors
  NameDescription
Public methodTraceLogger
Creates a new TraceLogger instance
Public methodTraceLogger(String)
Create and enable a new TraceLogger instance with automatic naming based on the supplied log file type
Public methodTraceLogger(String, String)
Creates a new TraceLogger instance and initialises filename and type
Top
Properties
  NameDescription
Public propertyEnabled
Enables or disables logging to the file.
Public propertyLogFileName
Return the full filename of the log file being created
Top
Methods
  NameDescription
Public methodBlankLine
Insert a blank line into the log file
Public methodDispose
Disposes of the TraceLogger object
Public methodLogContinue(String)
Appends further message to a line started by LogStart, does not terminate the line.
Public methodLogContinue(String, Boolean)
Appends further message to a line started by LogStart, appends a hex translation of the message to the line, does not terminate the line.
Public methodLogFinish(String)
Closes a line started by LogStart with the supplied message
Public methodLogFinish(String, Boolean)
Closes a line started by LogStart with the supplied message and a hex translation of the message
Public methodLogIssue
Logs an issue, closing any open line and opening a continuation line if necessary after the issue message.
Public methodLogMessage(String, String)
Logs a complete message in one call
Public methodLogMessage(String, String, Boolean)
Logs a complete message in one call, including a hex translation of the message
Public methodLogMessageCrLf
Displays a message respecting carriage return and linefeed characters
Public methodLogStart
Writes the time and identifier to the log, leaving the line ready for further content through LogContinue and LogFinish
Public methodSetLogFile
Sets the log filename and type if the constructor is called without parameters
Top
Remarks

In automatic mode the file will be stored in an ASCOM folder within XP's My Documents folder or equivalent places in other operating systems. Within the ASCOM folder will be a folder named Logs yyyy-mm-dd where yyyy, mm and dd are today's year, month and day numbers. The trace file will appear within the day folder with the name ASCOM.Identifier.hhmm.ssffff where hh, mm, ss and ffff are the current hour, minute, second and fraction of second numbers at the time of file creation.

Within the file the format of each line is hh:mm:ss.fff Identifier Message where hh, mm, ss and fff are the hour, minute, second and fractional second at the time that the message was logged, Identifier is the supplied identifier (usually the subroutine, function, property or method from which the message is sent) and Message is the message to be logged.

See Also