public void Log(LogLevel level, string message) { var newLevel = level.AsLoggerLevel(); var logger = _logger.Value; switch (newLevel) { case CastleLog.LoggerLevel.Fatal: logger.Fatal(message); break; case CastleLog.LoggerLevel.Error: logger.Error(message); break; case CastleLog.LoggerLevel.Warn: logger.Warn(message); break; case CastleLog.LoggerLevel.Info: logger.Info(message); break; case CastleLog.LoggerLevel.Debug: logger.Debug(message); break; } }
public void Log(LogLevel level, string sLogMessage, params object[] args) { var newLevel = level.AsLoggerLevel(); var logger = _logger.Value; switch (newLevel) { case CastleLog.LoggerLevel.Fatal: logger.FatalFormat(sLogMessage, args); break; case CastleLog.LoggerLevel.Error: logger.ErrorFormat(sLogMessage, args); break; case CastleLog.LoggerLevel.Warn: logger.WarnFormat(sLogMessage, args); break; case CastleLog.LoggerLevel.Info: logger.InfoFormat(sLogMessage, args); break; case CastleLog.LoggerLevel.Debug: logger.DebugFormat(sLogMessage, args); break; } }
public bool Loggable(LogLevel eLogLevel) { var newLevel = eLogLevel.AsLoggerLevel(); var logger = _logger.Value; var b = false; switch (newLevel) { case CastleLog.LoggerLevel.Fatal: b = logger.IsFatalEnabled; break; case CastleLog.LoggerLevel.Error: b = logger.IsErrorEnabled; break; case CastleLog.LoggerLevel.Warn: b = logger.IsWarnEnabled; break; case CastleLog.LoggerLevel.Info: b = logger.IsInfoEnabled; break; case CastleLog.LoggerLevel.Debug: b = logger.IsDebugEnabled; break; } return(b); }