Class ILoggerExtensions
- Namespace
- Songhay.Extensions
- Assembly
- SonghayCore.dll
Extensions of ILogger to assist with “structured logging.”
public static class ILoggerExtensions
- Inheritance
-
ILoggerExtensions
- Inherited Members
Remarks
For a video overview, see https://www.youtube.com/watch?v=NlBjVJPkT6M 🎥
Methods
LogErrorForMissingData(ILogger?, string)
Calls LogError(ILogger, string, params object[]) for missing data.
public static void LogErrorForMissingData(this ILogger? logger, string caption)
Parameters
LogErrorForMissingData<TData>(ILogger?)
Calls LogError(ILogger, string, params object[]) for missing data.
public static void LogErrorForMissingData<TData>(this ILogger? logger)
Parameters
logger
ILoggerThe logger.
Type Parameters
TData
The type of the data.
LogInformationNewLine(ILogger?)
Calls LogNewLine(ILogger?, LogLevel) for Information.
public static void LogInformationNewLine(this ILogger? logger)
Parameters
logger
ILoggerThe logger.
LogNewLine(ILogger?, LogLevel)
Logs NewLine for human readability.
public static void LogNewLine(this ILogger? logger, LogLevel level)
Parameters
LogTraceDataTypeAndValue<TData>(ILogger?, TData?)
Traces data type and value.
public static void LogTraceDataTypeAndValue<TData>(this ILogger? logger, TData? data)
Parameters
logger
ILoggerThe logger.
data
TDataThe data.
Type Parameters
TData
The type of the data.
Remarks
For the best results, ensure that the ToString() method is properly overridden.
LogTraceMethodCall(ILogger?, string?)
Conventional trace of the specified method call.
public static void LogTraceMethodCall(this ILogger? logger, string? methodName)
Parameters
LogTraceNewLine(ILogger?)
Calls LogNewLine(ILogger?, LogLevel) for Trace.
public static void LogTraceNewLine(this ILogger? logger)
Parameters
logger
ILoggerThe logger.