Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
Code:
import java.util.logging.*;
public class CustomLevel extends Level{ public static void main(String[] args) { Logger log = Logger.getLogger("RoseIndia.Net"); Level level1 = Level.WARNING; int num = level1.intValue(); Level level = new CustomLevel("RoseIndia Level", num); Level clevel = level.parse("RoseIndia Level"); log.log(clevel, "This is a Custom Level"); } public CustomLevel(String str, int val){ super(str, val); } }
This program creates a logger and the CustomLevel class extends the Level class for constructing a custom log level. All levels have an unique value. Similarly, the custom log level has an unique value which is retrieved by the intValue() method.
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )