Beispiel #1
0
        private LogLevel Map(Microsoft.Extensions.Logging.LogLevel logLevel)
        {
            switch (logLevel)
            {
            case Microsoft.Extensions.Logging.LogLevel.Debug:
            case Microsoft.Extensions.Logging.LogLevel.Trace:
            case Microsoft.Extensions.Logging.LogLevel.Information:
                return(LogLevel.Info);

            case Microsoft.Extensions.Logging.LogLevel.Warning:
                return(LogLevel.Warning);

            case Microsoft.Extensions.Logging.LogLevel.Error:
                return(LogLevel.Error);

            case Microsoft.Extensions.Logging.LogLevel.Critical:
                return(LogLevel.FatalError);

            default:
                return(LogLevel.None);
            }
        }
Beispiel #2
0
 public bool IsEnabled(Microsoft.Extensions.Logging.LogLevel logLevel)
 {
     return(true);
 }
Beispiel #3
0
 public void Log <TState>(Microsoft.Extensions.Logging.LogLevel logLevel, EventId eventId, TState state, Exception exception, Func <TState, Exception, string> formatter) where TState : LogEntryParameters
 {
     WriteLog(Map(logLevel), "", "", state.ToJson(), formatter(state, exception), exception);
 }