Mega Code Archive

 
Categories / Java / Language Basics
 

Comparing Log Levels

import java.util.logging.Level; public class Main {   public static void main(String[] argv) throws Exception {     Level level1 = Level.INFO;     Level level2 = Level.CONFIG;     if (level1.intValue() > level2.intValue()) {       System.out.println("level1 is more severe");     } else if (level1.intValue() < level2.intValue()) {       System.out.println("level2 is more severe");     } else {       System.out.println("level1 == level2");     }   } }