mirror of
https://github.com/games647/ColorConsole.git
synced 2024-11-23 19:05:19 +01:00
Add datestyle
This commit is contained in:
parent
c8690398df
commit
93b5fd1c59
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user