Add configurable Level colors

This commit is contained in:
Vinnie 2016-05-06 06:08:58 -04:00
parent eb47e6c892
commit f44a6f7af2
2 changed files with 14 additions and 1 deletions

View File

@ -62,7 +62,12 @@ public class ColorConsole extends JavaPlugin {
String logFormat = getConfig().getString("logFormat");
if (getConfig().getBoolean("colorLoggingLevel")) {
logFormat = "%highlight{" + logFormat + "}{"
+ "FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=gray, DEBUG=green bold, TRACE=blue}";
+ "FATAL=" + getConfig().getString("FATAL") + ", "
+ "ERROR=" + getConfig().getString("ERROR") + ", "
+ "WARN=" + getConfig().getString("WARN") + ", "
+ "INFO=" + getConfig().getString("INFO") + ", "
+ "DEBUG=" + getConfig().getString("DEBUG") + ", "
+ "TRACE=" + getConfig().getString("TRACE") + "}";
}
PatternLayout layout = PatternLayout

View File

@ -21,3 +21,11 @@ colorLoggingLevel: true
# For more details vist: https://logging.apache.org/log4j/2.x/manual/layouts.html#Patterns
logFormat: '[%d{HH:mm:ss} %level]: %msg%n'
# Log Level Colors
FATAL: red blink
ERROR: red
WARN: yellow bold
INFO: gray
DEBUG: green bold
TRACE: blue