ljacqu a8df8ceb09 #605 Add custom log levels, create debug logging method
- Log levels in the log file too
- Create migration from old boolean "stop spam" property to new log level property
2016-07-22 17:45:00 +02:00

39 lines
873 B
Java

package fr.xephi.authme.output;
/**
* Log level.
*/
public enum LogLevel {
/** Info: general messages. */
INFO(3),
/** Fine: more detailed messages that may still be interesting to plugin users. */
FINE(2),
/** Debug: very detailed messages for debugging. */
DEBUG(1);
private int value;
/**
* Constructor.
*
* @param value the log level; the higher the number the more "important" the level.
* A log level enables its number and all above.
*/
LogLevel(int value) {
this.value = value;
}
/**
* Return whether the current log level includes the given log level.
*
* @param level the level to process
* @return true if the level is enabled, false otherwise
*/
public boolean includes(LogLevel level) {
return value <= level.value;
}
}