Example #1
0
 private String getColor(int logLevel) {
   if (logLevel == Level.OFF.intValue()) {
     return "#000"; // black
   }
   if (logLevel >= Level.SEVERE.intValue()) {
     return "#F00"; // bright red
   }
   if (logLevel >= Level.WARNING.intValue()) {
     return "#E56717"; // dark orange
   }
   if (logLevel >= Level.INFO.intValue()) {
     return "#20b000"; // green
   }
   if (logLevel >= Level.CONFIG.intValue()) {
     return "#2B60DE"; // blue
   }
   if (logLevel >= Level.FINE.intValue()) {
     return "#F0F"; // purple
   }
   if (logLevel >= Level.FINER.intValue()) {
     return "#F0F"; // purple
   }
   if (logLevel >= Level.FINEST.intValue()) {
     return "#F0F"; // purple
   }
   return "#000"; // black
 }
  protected int mapLevelToAnt(final Level level) {
    if (Level.CONFIG.equals(level)) return Project.MSG_DEBUG;
    if (Level.FINE.equals(level)) return Project.MSG_VERBOSE;
    if (Level.FINER.equals(level)) return Project.MSG_DEBUG;
    if (Level.FINEST.equals(level)) return Project.MSG_DEBUG;
    if (Level.INFO.equals(level)) return Project.MSG_INFO;
    if (Level.SEVERE.equals(level)) return Project.MSG_ERR;
    if (Level.WARNING.equals(level)) return Project.MSG_WARN;

    return Project.MSG_WARN;
  }
 private static LogLevel getLogLevel(LogRecord record) {
   int level = record.getLevel().intValue();
   if (level <= Level.CONFIG.intValue()) {
     return LogLevel.DEBUG;
   } else if (level <= Level.INFO.intValue()) {
     return LogLevel.INFO;
   } else if (level <= Level.WARNING.intValue()) {
     return LogLevel.WARN;
   } else if (level <= Level.SEVERE.intValue()) {
     return LogLevel.ERROR;
   } else {
     return LogLevel.FATAL;
   }
 }