LoggerExtensions
This commit is contained in:
parent
80964f193f
commit
34922b7cc9
12
DTLib.Logging/Loggers/LoggerExtensions.cs
Normal file
12
DTLib.Logging/Loggers/LoggerExtensions.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using Ben.Demystifier;
|
||||||
|
|
||||||
|
namespace DTLib.Logging.New;
|
||||||
|
|
||||||
|
public static class LoggerExtensions
|
||||||
|
{
|
||||||
|
public static void Log(this ILogger logger, string context, LogSeverity severity, object message)
|
||||||
|
=> logger.Log(context, severity, message, logger.Format);
|
||||||
|
|
||||||
|
public static void LogException(this ILogger logger, string context, Exception ex)
|
||||||
|
=> logger.Log(context, LogSeverity.Error, ex.Demystify());
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user