Beispiel #1
0
 public static void e(bool condition, CTag tag, object arg)
 {
     if (condition && ShouldLogLevel(CLogLevel.Error) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Error, arg != null ? arg.ToString() : "");
     }
 }
Beispiel #2
0
 public static void e <A0>(CTag tag, string format, A0 arg0)
 {
     if (ShouldLogLevel(CLogLevel.Error) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Error, CStringUtils.TryFormat(format, arg0));
     }
 }
Beispiel #3
0
 public static void w <A0, A1, A2>(bool condition, CTag tag, string format, A0 arg0, A1 arg1, A2 arg2)
 {
     if (condition && ShouldLogLevel(CLogLevel.Warn) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Warn, CStringUtils.TryFormat(format, arg0, arg1, arg2));
     }
 }
Beispiel #4
0
 public static void w(bool condition, CTag tag, string format, params object[] args)
 {
     if (condition && ShouldLogLevel(CLogLevel.Warn) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Warn, CStringUtils.TryFormat(format, args));
     }
 }
Beispiel #5
0
 public static void w <A0, A1>(CTag tag, string format, A0 arg0, A1 arg1)
 {
     if (ShouldLogLevel(CLogLevel.Warn) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Warn, CStringUtils.TryFormat(format, arg0, arg1));
     }
 }
Beispiel #6
0
 public static void w <A0, A1, A2, A3, A4>(CTag tag, string format, A0 arg0, A1 arg1, A2 arg2, A3 arg3, A4 arg4)
 {
     if (ShouldLogLevel(CLogLevel.Warn) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Warn, CStringUtils.TryFormat(format, arg0, arg1, arg2, arg3, arg4));
     }
 }
Beispiel #7
0
 public static void i <A0, A1>(bool condition, CTag tag, string format, A0 arg0, A1 arg1)
 {
     if (condition && ShouldLogLevel(CLogLevel.Info) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Info, CStringUtils.TryFormat(format, arg0, arg1));
     }
 }
Beispiel #8
0
 public static void w(CTag tag, object arg)
 {
     if (ShouldLogLevel(CLogLevel.Warn) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Warn, arg != null ? arg.ToString() : "");
     }
 }
Beispiel #9
0
 public static void i <A0, A1, A2, A3>(CTag tag, string format, A0 arg0, A1 arg1, A2 arg2, A3 arg3)
 {
     if (ShouldLogLevel(CLogLevel.Info) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Info, CStringUtils.TryFormat(format, arg0, arg1, arg2, arg3));
     }
 }
Beispiel #10
0
 public static void i(CTag tag, string format, params object[] args)
 {
     if (ShouldLogLevel(CLogLevel.Info) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Info, CStringUtils.TryFormat(format, args));
     }
 }
Beispiel #11
0
 public static void d <A0>(bool condition, CTag tag, string format, A0 arg0)
 {
     if (condition && ShouldLogLevel(CLogLevel.Debug) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Debug, CStringUtils.TryFormat(format, arg0));
     }
 }
Beispiel #12
0
 public static void d <A0, A1, A2>(CTag tag, string format, A0 arg0, A1 arg1, A2 arg2)
 {
     if (ShouldLogLevel(CLogLevel.Debug) && ShouldLogTag(tag))
     {
         LogMessage(tag, CLogLevel.Debug, CStringUtils.TryFormat(format, arg0, arg1, arg2));
     }
 }
Beispiel #13
0
 internal static void LogMessage(CTag tag, CLogLevel level, string message, string stackTrace)
 {
     for (int i = 0; i < logDelegates.Count; ++i)
     {
         logDelegates[i](level, tag, message, stackTrace);
     }
 }
Beispiel #14
0
 private static bool ShouldLogTag(CTag tag)
 {
     return(tag == null || tag.Enabled);
 }
Beispiel #15
0
 internal static void LogMessage(CTag tag, CLogLevel level, string message)
 {
     LogMessage(tag, level, message, CStackTrace.ExtractStackTrace(3));
 }