26 lines
614 B
Java
26 lines
614 B
Java
package io.gitlab.jfronny.commons.logging;
|
|
|
|
public enum Level {
|
|
TRACE(OutputColors.WHITE),
|
|
DEBUG(OutputColors.WHITE),
|
|
INFO(OutputColors.BLUE),
|
|
WARN(OutputColors.RED),
|
|
ERROR(OutputColors.RED_BOLD);
|
|
|
|
public final String color;
|
|
|
|
Level(String color) {
|
|
this.color = color;
|
|
}
|
|
|
|
/**
|
|
* Whether a message with the provided level should be omitted if this is the minimum level
|
|
*
|
|
* @param level The level of the message
|
|
* @return whether it should be omitted
|
|
*/
|
|
public boolean shouldOmit(Level level) {
|
|
return this.compareTo(level) > 0;
|
|
}
|
|
}
|