TraceLogger(String, Boolean, Int32, LogLevel) Constructor

Create a new TraceLogger instance with automatic naming incorporating the supplied log file type

Definition

Namespace: ASCOM.Tools
Assembly: ASCOM.Tools (in ASCOM.Tools.dll) Version: 3.0.0-rc.1+86c25ce733aebb4d8b1b8a62e84770ea5e972bea
C#
public TraceLogger(
	string logFileType,
	bool enabled,
	int identifierWidth = 25,
	LogLevel logLevel = LogLevel.Information
)

Parameters

logFileType  String
A short name to identify the contents of the log.
enabled  Boolean
Initial state of the trace logger - Enabled or Disabled.
identifierWidth  Int32  (Optional)
Width of the identifier field in the log message (Optional parameter, default: 25)
logLevel  LogLevel  (Optional)
Log level of the trace logger (Debug, Information, Warning etc.) (Optional parameter, default: LogLevel.Information)

Remarks

Automatically generated directory names will be of the form: "Documents\ASCOM\Logs {CurrentDate:yyyymmdd}" on Windows and "HOME/ASCOM/Logs{CurrentDate:yyyymmdd}" on Linux Automatically generated file names will be of the form: "ASCOM.{LogFileType}.{CurrentTime:HHmm.ssfff}{1 or 2 Digits, usually 0}.txt".

Version Information

.NET Standard

Supported in: 2.0

See Also