Пример #1
0
  void differentiatedLog(Marker marker, String fqcn, int level, Object message, Throwable t) {

    String m = convertToString(message);
    if (locationAwareLogger != null) {
      locationAwareLogger.log(marker, fqcn, level, m, null, t);
    } else {
      switch (level) {
        case LocationAwareLogger.TRACE_INT:
          slf4jLogger.trace(marker, m);
          break;
        case LocationAwareLogger.DEBUG_INT:
          slf4jLogger.debug(marker, m);
          break;
        case LocationAwareLogger.INFO_INT:
          slf4jLogger.info(marker, m);
          break;
        case LocationAwareLogger.WARN_INT:
          slf4jLogger.warn(marker, m);
          break;
        case LocationAwareLogger.ERROR_INT:
          slf4jLogger.error(marker, m);
          break;
      }
    }
  }
Пример #2
0
 protected void callLocationAwareLogger(LocationAwareLogger lal, LogRecord record) {
   final int julLevelValue = record.getLevel().intValue();
   final int slf4jLevel;
   if (julLevelValue <= TRACE_LEVEL_THRESHOLD) {
     slf4jLevel = LocationAwareLogger.TRACE_INT;
   } else if (julLevelValue <= DEBUG_LEVEL_THRESHOLD) {
     slf4jLevel = LocationAwareLogger.DEBUG_INT;
   } else if (julLevelValue <= INFO_LEVEL_THRESHOLD) {
     slf4jLevel = LocationAwareLogger.INFO_INT;
   } else if (julLevelValue <= WARN_LEVEL_THRESHOLD) {
     slf4jLevel = LocationAwareLogger.WARN_INT;
   } else {
     slf4jLevel = LocationAwareLogger.ERROR_INT;
   }
   final String i18nMessage = getMessageI18N(record);
   lal.log(null, FQCN, slf4jLevel, i18nMessage, null, record.getThrown());
 }