Java Code Examples for org.apache.uima.util.Level#WARNING_INT

The following examples show how to use org.apache.uima.util.Level#WARNING_INT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Logger_common_impl.java    From uima-uimaj with Apache License 2.0 6 votes vote down vote up
/**
 * 
 * @param level -
 * @return true if not limited
 */
private boolean isNotLimited(Level level) {
  if (!isLimited) {
    return true;
  }
  switch(level.toInteger()) {
  case Level.SEVERE_INT: if (SEVERE_COUNT >= limit_common) return false; SEVERE_COUNT++; return true; 
  case Level.WARNING_INT: if (WARNING_COUNT >= limit_common) return false; WARNING_COUNT++; return true; 
  case Level.INFO_INT: if (INFO_COUNT >= limit_common) return false; INFO_COUNT++; return true; 
  case Level.CONFIG_INT: if (CONFIG_COUNT >= limit_common) return false; CONFIG_COUNT++; return true; 
  case Level.FINE_INT: if (FINE_COUNT >= limit_common) return false; FINE_COUNT++; return true; 
  case Level.FINER_INT: if (FINER_COUNT >= limit_common) return false; FINER_COUNT++; return true; 
  case Level.FINEST_INT: if (FINEST_COUNT >= limit_common) return false; FINEST_COUNT++; return true; 
  }
  Misc.internalError();
  return false;
}
 
Example 2
Source File: Slf4jLogger_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
public static int getSlf4jLevel(Level level) {
  switch(level.toInteger()) {
  case Level.SEVERE_INT: return LocationAwareLogger.ERROR_INT;
  case Level.WARNING_INT: return LocationAwareLogger.WARN_INT;
  case Level.INFO_INT: return LocationAwareLogger.INFO_INT;
  case Level.CONFIG_INT: return LocationAwareLogger.INFO_INT;
  case Level.FINE_INT: return LocationAwareLogger.DEBUG_INT;
  case Level.FINER_INT: return LocationAwareLogger.TRACE_INT;
  case Level.FINEST_INT: return LocationAwareLogger.TRACE_INT;
  }
  Misc.internalError();
  return LocationAwareLogger.ERROR_INT; //ignored, just here for compile error avoidance
}
 
Example 3
Source File: Slf4jLogger_impl.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
@Override
public void log(Marker m, String aFqcn, Level level, String msg_with_params, Throwable thrown) {
  m = (m == null) 
      ? getMarkerForLevel(level) 
      : m;
      
if (isLocationCapable) {  // slf4j simple logger is not
  ((org.slf4j.spi.LocationAwareLogger)logger).log(m, aFqcn, getSlf4jLevel(level), msg_with_params, null, thrown);
} else {
  switch(level.toInteger()) {
  case Level.SEVERE_INT: 
    // all of these calls to MessageFormat are to the java.text.MessageFormat
    // to do {n} style format substitution
    logger.error(m, msg_with_params, thrown); 
    break;
  case Level.WARNING_INT: 
    logger.warn(m, msg_with_params, thrown); 
    break;
  case Level.INFO_INT: 
    logger.info(m, msg_with_params, thrown); 
    break;
  case Level.CONFIG_INT: 
    logger.info(m, msg_with_params, thrown); 
    break;
  case Level.FINE_INT: 
    logger.debug(m, msg_with_params, thrown); 
    break;
  case Level.FINER_INT: 
    logger.trace(m, msg_with_params, thrown); 
    break;
  case Level.FINEST_INT: 
    logger.trace(m, msg_with_params, thrown); 
    break;
  default: Misc.internalError();
  }
}
  
}
 
Example 4
Source File: Slf4jLogger_impl.java    From uima-uimaj with Apache License 2.0 4 votes vote down vote up
public void log2(Marker m, String aFqcn, Level level, String message, Object[] args, Throwable thrown) {
  m = (m == null) 
      ? getMarkerForLevel(level) 
      : m;
      
  if (isLocationCapable) {  // slf4j simple logger is not
    ((org.slf4j.spi.LocationAwareLogger)logger).log(m, aFqcn, getSlf4jLevel(level), message, args, thrown);
  } else {
    if (thrown != null) {
      Object[] args1 = (args == null) ? new Object[1] : new Object[args.length + 1];
      if (args != null) {
        System.arraycopy(args, 0, args1, 0, args.length);
      }
      args1[args1.length - 1] = thrown;
      args = args1;
    }  
    switch(level.toInteger()) {
    case Level.SEVERE_INT: 
      logger.error(m, message, args); 
      break;
    case Level.WARNING_INT: 
      logger.warn(m, message, args); 
      break;
    case Level.INFO_INT: 
      logger.info(m, message, args); 
      break;
    case Level.CONFIG_INT: 
      logger.info(m, message, args); 
      break;
    case Level.FINE_INT: 
      logger.debug(m, message, args); 
      break;
    case Level.FINER_INT: 
      logger.trace(m, message, args); 
      break;
    case Level.FINEST_INT: 
      logger.trace(m, message, args); 
      break;
    default: Misc.internalError();
    }
  }
}