Skip to content

LogFormatter Methods

Formats values for logging purposes.

ParseDate(string)

static
View source
public static DateTime ParseDate(string dateStr)
Parses a date.

Parameters

dateStrstring
The date string.

Returns

The parsed date.

PrintDate(DateTime)

static
View source
public static string PrintDate(DateTime date)
Utility function to convert a DateTime object into printable data format used by the Logger subsystem.

Parameters

dateDateTime
The DateTime value to be printed.

Returns

Formatted string representation of the input data, in the printable format used by the Logger subsystem.

PrintException(Exception)

static
View source
public static string PrintException(Exception exception)
Utility function to convert an exception into printable format, including expanding and formatting any nested sub-expressions.

Parameters

exceptionException
The exception to be printed.

Returns

Formatted string representation of the exception, including expanding and formatting any nested sub-expressions.

PrintTime(DateTime)

static
View source
public static string PrintTime(DateTime date)
Utility function to convert a DateTime object into printable time format used by the Logger subsystem.

Parameters

dateDateTime
The DateTime value to be printed.

Returns

Formatted string representation of the input data, in the printable format used by the Logger subsystem.

SetExceptionDecoder(Type, Func<Exception, string>)

static
View source
public static void SetExceptionDecoder(Type exceptionType, Func<Exception, string> decoder)
Configures the exception decoder for the specified exception type.

Parameters

exceptionTypeType
The exception type to configure a decoder for.
decoderFunc<Exception, string>
The decoder.