mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Shade console log lines like chat
This commit is contained in:
1 parent
673dda2860
commit
b545500abe
2 files changed
+22
No files matched your search
@@ -309,6 +309,10 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
||||
static void msg(String string) {
|
||||
try {
|
||||
Iris plugin = Iris.instance;
|
||||
if (shadesConsole()) {
|
||||
logShaded(Level.INFO, logPrefix() + string);
|
||||
return;
|
||||
}
|
||||
ComponentLog.logMarkup(
|
||||
plugin,
|
||||
Logger.getLogger("Iris"),
|
||||
@@ -601,6 +605,10 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
||||
}
|
||||
|
||||
private static void diagnostic(Level level, String message) {
|
||||
if (shadesConsole()) {
|
||||
logShaded(level, logPrefix() + C.escapeTags(message));
|
||||
return;
|
||||
}
|
||||
Iris plugin = Iris.instance;
|
||||
ComponentLog.logLegacy(
|
||||
plugin,
|
||||
@@ -611,6 +619,16 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
||||
null);
|
||||
}
|
||||
|
||||
private static boolean shadesConsole() {
|
||||
return IrisSettings.get().getGeneral().isUseConsoleCustomColors();
|
||||
}
|
||||
|
||||
private static void logShaded(Level level, String prefixedLine) {
|
||||
IrisSettings.IrisSettingsGeneral general = IrisSettings.get().getGeneral();
|
||||
String shaded = C.aura(prefixedLine, general.getSpinh(), general.getSpins(), general.getSpinb());
|
||||
ComponentLog.logMarkup(Iris.instance, Logger.getLogger("Iris"), "", level, shaded, null);
|
||||
}
|
||||
|
||||
private static String logPrefix() {
|
||||
return IrisSafeguard.mode().logTag();
|
||||
}
|
||||
|
||||
@@ -387,6 +387,10 @@ public enum C {
|
||||
return toMarkup(s, color -> color.token);
|
||||
}
|
||||
|
||||
public static String escapeTags(String s) {
|
||||
return MiniMessage.miniMessage().escapeTags(s);
|
||||
}
|
||||
|
||||
public static String aura(String s, int hrad, int srad, int vrad) {
|
||||
return aura(s, hrad, srad, vrad, 0.3D);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user