User a logger - Java:
import java.util.logging.Logger;
/**
* This class is used to create a logger with javadoc.
* @author Juan Carlos Fonseca
* @version 1.0
*/
public class LoggerExample {
/**
* This method is used to create a logger with javadoc.
* @param args Unused.
* @return Nothing.
*/
public static void main(String[] args) {
// Create a logger with the name of the class
Logger logger = Logger.getLogger(LoggerExample.class.getName());
// Log a message with the info level
logger.info("This is an info message");
// Log a message with the warning level
logger.warning("This is a warning message");
// Log a message with the severe level
logger.severe("This is a severe message");
}
}
Top comments (0)