mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-12-03 19:51:49 +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) {
|
static void msg(String string) {
|
||||||
try {
|
try {
|
||||||
Iris plugin = Iris.instance;
|
Iris plugin = Iris.instance;
|
||||||
|
if (shadesConsole()) {
|
||||||
|
logShaded(Level.INFO, logPrefix() + string);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ComponentLog.logMarkup(
|
ComponentLog.logMarkup(
|
||||||
plugin,
|
plugin,
|
||||||
Logger.getLogger("Iris"),
|
Logger.getLogger("Iris"),
|
||||||
@@ -601,6 +605,10 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void diagnostic(Level level, String message) {
|
private static void diagnostic(Level level, String message) {
|
||||||
|
if (shadesConsole()) {
|
||||||
|
logShaded(level, logPrefix() + C.escapeTags(message));
|
||||||
|
return;
|
||||||
|
}
|
||||||
Iris plugin = Iris.instance;
|
Iris plugin = Iris.instance;
|
||||||
ComponentLog.logLegacy(
|
ComponentLog.logLegacy(
|
||||||
plugin,
|
plugin,
|
||||||
@@ -611,6 +619,16 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
|||||||
null);
|
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() {
|
private static String logPrefix() {
|
||||||
return IrisSafeguard.mode().logTag();
|
return IrisSafeguard.mode().logTag();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,6 +387,10 @@ public enum C {
|
|||||||
return toMarkup(s, color -> color.token);
|
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) {
|
public static String aura(String s, int hrad, int srad, int vrad) {
|
||||||
return aura(s, hrad, srad, vrad, 0.3D);
|
return aura(s, hrad, srad, vrad, 0.3D);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user