Class HiLog
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
writerStreamWriterThe 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
WriteToConsole
Gets or sets a value indicating whether log messages should also be written to the console.
public bool WriteToConsole { get; set; }
Property Value
Writer
Gets or sets the stream writer used for logging.
public StreamWriter Writer { get; set; }
Property Value
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
infostringThe 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
infostringThe information to log
Returns
- Task
A task representing the asynchronous operation