Table of Contents

Class HiLog

Namespace
Hi.Common
Assembly
HiGeom.dll

Logging utility class that provides logging functionality with timestamp.

public class HiLog
Inheritance
HiLog
Inherited Members
Extension Methods

Remarks

Internal Use Only

Constructors

HiLog()

Initializes a new instance of the HiLog class with no writer.

public HiLog()

HiLog(StreamWriter)

Initializes a new instance of the HiLog class with the specified writer.

public HiLog(StreamWriter writer)

Parameters

writer StreamWriter

The stream writer to use for logging

Properties

Default

Gets or sets the default logger instance. The default log file name is formatted as “logYYYYMM.txt” based on the current date.

public static HiLog Default { get; set; }

Property Value

HiLog

WriteToConsole

Gets or sets a value indicating whether log messages should also be written to the console.

public bool WriteToConsole { get; set; }

Property Value

bool

Writer

Gets or sets the stream writer used for logging.

public StreamWriter Writer { get; set; }

Property Value

StreamWriter

Methods

Append(string)

Synchronously appends the specified information to the log with a timestamp. This is a blocking wrapper around AppendAsync(string).

public void Append(string info)

Parameters

info string

The information to log

AppendAsync(string)

Asynchronously appends the specified information to the log with a timestamp. If WriteToConsole is true, the information is also output to the console.

public Task AppendAsync(string info)

Parameters

info string

The information to log

Returns

Task

A task representing the asynchronous operation