コード例 #1
0
 public static void PublishDebug(this ILog logger, object message, JsonProperty[] jsonProperties)
 {
     if (logger.IsDebugEnabled) {
         logger.Debug(message + "; jsonProperties: " + String.Join(",", jsonProperties.Select(t => t.Name + "=" + t.Value)));
         if (_logglyLogger != null && message != null) {
             var data = new Dictionary<string, object>();
             addPropertiesToJsonData(jsonProperties, data);
             publish(message, DEBUG, data, null, logger.Logger.Name);
         }
     }
 }
コード例 #2
0
 public static void PublishWarnFormat(this ILog logger, string format, JsonProperty[] jsonProperties, params object[] args)
 {
     if (logger.IsWarnEnabled) {
         logger.WarnFormat(format, args);
         var message = String.Format(format, args);
         if (_logglyLogger != null && !String.IsNullOrEmpty(message)) {
             var data = new Dictionary<string, object>();
             addPropertiesToJsonData(jsonProperties, data);
             publish(message, WARN, data, null, logger.Logger.Name);
         }
     }
 }