Add datestyle

This commit is contained in:
games647 2017-05-21 15:27:26 +02:00
parent c8690398df
commit 93b5fd1c59
No known key found for this signature in database
GPG Key ID: E9E962F08F621538
4 changed files with 19 additions and 0 deletions

View File

@ -72,6 +72,9 @@ public class ColorConsoleBukkit extends JavaPlugin {
+ "TRACE=" + getConfig().getString("TRACE") + "}");
}
String dateStyle = getConfig().getString("dateStyle");
logFormat = logFormat.replaceFirst("(%d)\\{.{1,}\\}", "%style{$0}{" + dateStyle + "}");
PatternLayout layout = PatternLayout
.createLayout(logFormat, new DefaultConfiguration(), null, Charset.defaultCharset().name(), "true");
setLayout(layout);

View File

@ -56,6 +56,11 @@ public class ColorConsoleConfig {
@Setting(comment = "Custom plugin colors")
private Map<String, String> pluginColors;
@Setting(comment = "How should the time be highlighted\n" +
"Like below it could also be default which means it's the default font color depending on " +
"your terminal settings.")
private String dateStyle;
@Setting(comment = "Hides the log message if it contains one or more of the following texts\n"
+ "The texts are case-sensitive")
private Set<String> hideMessages;
@ -87,4 +92,8 @@ public class ColorConsoleConfig {
public Set<String> getHideMessages() {
return hideMessages;
}
public String getDateStyle() {
return dateStyle;
}
}

View File

@ -94,6 +94,9 @@ public class ColorConsoleSponge {
+ "TRACE=" + configMapper.getInstance().getLevelColors().get("TRACE") + "}");
}
String dateStyle = configMapper.getInstance().getDateStyle();
logFormat = logFormat.replaceFirst("(%d)\\{.{1,}\\}", "%style{$0}{" + dateStyle + "}");
PatternLayout layout = PatternLayout
.createLayout(logFormat, new DefaultConfiguration(), null, Charset.defaultCharset().name(), "true");
setLayout(layout);

View File

@ -46,6 +46,10 @@ P-ChangeSkin: yellow
P-ScoreboardStats: white
P-mcMMOAction: blue
# How should the time be highlighted
# Like below it could also be default which means it's the default font color depending on your terminal settings.
dateStyle: cyan
# Available foreground colors | Available background colors
# Black | BG_Black
# Red | BG_Red