コード例 #1
0
        private static void WriteEntry(this IIsLoggable loggable, LogLevel level, Func <string> callback, Exception ex = null, Action <LogArgs> options = null)
        {
            var log = (Log)loggable.GetLog();

            if (log.IsLevelEnabled(level))
            {
                var buf = callback();
                log.LogMessage(level, buf, ex, options);
            }
        }
コード例 #2
0
 public static void LogFatal(this IIsLoggable loggable, Func <string> callback, Exception ex = null, Action <LogArgs> options = null)
 {
     loggable.WriteEntry(LogLevel.Fatal, callback, ex, options);
 }
コード例 #3
0
 public static ILog GetLog(this IIsLoggable loggable)
 {
     return(LogManager.GetLogger(loggable.GetType()));
 }