comments
This commit is contained in:
@@ -4,9 +4,18 @@ namespace DTLib.Logging.New;
|
||||
|
||||
public static class LoggerExtensions
|
||||
{
|
||||
// replaces same overload in every ILogger instaance
|
||||
public static void Log(this ILogger logger, string context, LogSeverity severity, object message)
|
||||
=> logger.Log(context, severity, message, logger.Format);
|
||||
|
||||
public static void LogDebug(this ILogger logger, string context, object message)
|
||||
=> logger.Log(context, LogSeverity.Debug, message);
|
||||
public static void LogInfo(this ILogger logger, string context, object message)
|
||||
=> logger.Log(context, LogSeverity.Info, message);
|
||||
public static void LogWarn(this ILogger logger, string context, object message)
|
||||
=> logger.Log(context, LogSeverity.Warn, message);
|
||||
|
||||
/// uses Ben.Demystifier to serialize exception
|
||||
public static void LogException(this ILogger logger, string context, Exception ex)
|
||||
=> logger.Log(context, LogSeverity.Error, ex.Demystify());
|
||||
}
|
||||
Reference in New Issue
Block a user