public void IsEnabledFor_ReturnsValidResult(LogLevel minLevel, MsLogLevel level, bool expectedEnabled) { loggerProvider = new VostokLoggerProvider(log.WithMinimumLevel(minLevel)); var logger = loggerProvider.CreateLogger(null); logger.IsEnabled(level).Should().Be(expectedEnabled); }
public void IsEnabledFor_ReturnsValidResult(MsLogLevel minLevel, LogLevel level, bool expectedEnabled) { var provider = new VostokLoggerProvider(oracleLog); var loggerFilterOptions = new LoggerFilterOptions { MinLevel = minLevel }; var loggerFactory = new LoggerFactory(new[] { provider }, loggerFilterOptions); var microsoftLogger1 = loggerFactory.CreateLogger <MicrosoftLog_BasedOnPureLogger_Tests>(); var microsoftLog1 = new MicrosoftLog(microsoftLogger1); microsoftLog1.IsEnabledFor(level).Should().Be(expectedEnabled); }
private static MicrosoftLogLevel ConvertLogLevel(VostokLogLevel logLevel) { switch (logLevel) { case VostokLogLevel.Debug: return(MicrosoftLogLevel.Debug); case VostokLogLevel.Info: return(MicrosoftLogLevel.Information); case VostokLogLevel.Warn: return(MicrosoftLogLevel.Warning); case VostokLogLevel.Error: return(MicrosoftLogLevel.Error); case VostokLogLevel.Fatal: return(MicrosoftLogLevel.Critical); default: return(MicrosoftLogLevel.None); } }
public bool IsEnabledFor(VostokLogLevel level) => true;
public bool IsEnabledFor(VostokLogLevel level) { var logLevel = ConvertLogLevel(level); return(logger.IsEnabled(logLevel)); }
public bool IsEnabledFor(VostokLogLevel level) { var logLevel = TranslateLogLevel(level); return(IsEnabledFor(logLevel)); }
public bool IsEnabledFor(LogLevel level) => true;