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