Code example for Logger

Methods: info, setLevel, severe, warning

0
     */ 
    public static void main(String[] args) {
        // 
        // log level = Level.INFO 
        // 
        logger.setLevel(Level.INFO);
        logger.severe("This message will be logged.");
 
        // 
        // log level = Level.SEVERE 
        // 
        logger.setLevel(Level.SEVERE);
        logger.warning("This message won't be logged.");
 
        // 
        // LOG OFF 
        // 
        logger.setLevel(Level.OFF);
        logger.info("All log is turned off.");
 
        // 
        // LOG ON 
        // 
        logger.setLevel(Level.ALL);
        logger.info("Information message.");
        logger.warning("Warning message.");
        logger.severe("Severe message.");
    } 
}