示例#1
0
 public static void ErrorFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsErrorEnabled())
     {
         logger.LogFormat(TcLogLevel.Error, message, args);
     }
 }
示例#2
0
 public static void Warn(this ITcLog logger, string message)
 {
     if (logger.IsWarnEnabled())
     {
         logger.Log(TcLogLevel.Warn, message.AsFunc());
     }
 }
示例#3
0
 public static void Error(this ITcLog logger, string message)
 {
     if (logger.IsErrorEnabled())
     {
         logger.Log(TcLogLevel.Error, message.AsFunc());
     }
 }
示例#4
0
 public static void Fatal(this ITcLog logger, string message)
 {
     if (logger.IsFatalEnabled())
     {
         logger.Log(TcLogLevel.Fatal, message.AsFunc());
     }
 }
示例#5
0
 public static void DebugException(this ITcLog logger, string message, Exception exception, params object[] formatParams)
 {
     if (logger.IsDebugEnabled())
     {
         logger.Log(TcLogLevel.Debug, message.AsFunc(), exception, formatParams);
     }
 }
示例#6
0
 public static void WarnFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsWarnEnabled())
     {
         logger.LogFormat(TcLogLevel.Warn, message, args);
     }
 }
示例#7
0
 // ReSharper disable once UnusedParameter.Local
 private static void GuardAgainstNullLogger(ITcLog logger)
 {
     if (logger == null)
     {
         throw new ArgumentNullException(nameof(logger));
     }
 }
示例#8
0
 public static void Debug(this ITcLog logger, string message)
 {
     if (logger.IsDebugEnabled())
     {
         logger.Log(TcLogLevel.Debug, message.AsFunc());
     }
 }
示例#9
0
 public static void DebugException(this ITcLog logger, string message, Exception exception)
 {
     if (logger.IsDebugEnabled())
     {
         logger.Log(TcLogLevel.Debug, message.AsFunc(), exception);
     }
 }
示例#10
0
 public static void FatalFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsFatalEnabled())
     {
         logger.LogFormat(TcLogLevel.Fatal, message, args);
     }
 }
示例#11
0
 public static void TraceFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsTraceEnabled())
     {
         logger.LogFormat(TcLogLevel.Trace, message, args);
     }
 }
示例#12
0
 public static void Trace(this ITcLog logger, string message)
 {
     if (logger.IsTraceEnabled())
     {
         logger.Log(TcLogLevel.Trace, message.AsFunc());
     }
 }
示例#13
0
 public static void InfoFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsInfoEnabled())
     {
         logger.LogFormat(TcLogLevel.Info, message, args);
     }
 }
示例#14
0
 public static void Info(this ITcLog logger, string message)
 {
     if (logger.IsInfoEnabled())
     {
         logger.Log(TcLogLevel.Info, message.AsFunc());
     }
 }
示例#15
0
 public static void DebugFormat(this ITcLog logger, string message, params object[] args)
 {
     if (logger.IsDebugEnabled())
     {
         logger.LogFormat(TcLogLevel.Debug, message, args);
     }
 }
示例#16
0
 public static bool IsTraceEnabled(this ITcLog logger)
 {
     GuardAgainstNullLogger(logger);
     return(logger.IsLogLevelEnabled(TcLogLevel.Trace));
 }
示例#17
0
 private static void LogFormat(this ITcLog logger, TcLogLevel logLevel, string message, params object[] args)
 {
     logger.Log(logLevel, message.AsFunc(), null, args);
 }
示例#18
0
 public static void Debug(this ITcLog logger, Exception exception, string message, params object[] args)
 {
     logger.DebugException(message, exception, args);
 }
示例#19
0
 public static void Trace(this ITcLog logger, string message, params object[] args)
 {
     logger.TraceFormat(message, args);
 }
示例#20
0
 public static void Info(this ITcLog logger, string message, params object[] args)
 {
     logger.InfoFormat(message, args);
 }
示例#21
0
 public static void Debug(this ITcLog logger, string message, params object[] args)
 {
     logger.DebugFormat(message, args);
 }
示例#22
0
 public static bool IsDebugEnabled(this ITcLog logger)
 {
     GuardAgainstNullLogger(logger);
     return(logger.IsLogLevelEnabled(TcLogLevel.Debug));
 }
示例#23
0
 public static void Error(this ITcLog logger, string message, params object[] args)
 {
     logger.ErrorFormat(message, args);
 }
示例#24
0
 public static void Error(this ITcLog logger, Func <string> messageFunc)
 {
     GuardAgainstNullLogger(logger);
     logger.Log(TcLogLevel.Error, messageFunc);
 }
示例#25
0
 public static void Fatal(this ITcLog logger, Func <string> messageFunc)
 {
     logger.Log(TcLogLevel.Fatal, messageFunc);
 }
示例#26
0
 public static void Warn(this ITcLog logger, string message, params object[] args)
 {
     logger.WarnFormat(message, args);
 }
示例#27
0
 public static void Fatal(this ITcLog logger, string message, params object[] args)
 {
     logger.FatalFormat(message, args);
 }
示例#28
0
 protected ApplicationBase(ITcLogProvider logProvider)
 {
     Logger = logProvider.GetLogFor(typeof(ApplicationBase));
 }
示例#29
0
 public static bool IsErrorEnabled(this ITcLog logger)
 {
     GuardAgainstNullLogger(logger);
     return(logger.IsLogLevelEnabled(TcLogLevel.Error));
 }