This section describes, how to compare log levels to each other. In Java, the Level class assigns a set of multiple logging levels that has already an individual integer type value. With the help of this you can compare log levels and get specified results.
There are following levels in descending order:
Additional levels:
Descriptions of program:
This program creates two objects of the Level class with different logging levels. One is with the Level.FINEST level and another object is created with the Level.SEVERE level. And this program gets it's different integer value by using it's intValue() method. This value is by default specific for the specific logging levels. These retrieved integer value of the different level are compared at last in the following program.
Here is the code of program:
import java.util.logging.*;
|
|
Recommend the tutorial |
Ask Questions? Discuss: Comparing Log Levels in Java
Post your Comment