Print full class path for enums (UnitLogger)

This commit is contained in:
JeremyStar™ 2024-06-09 13:42:54 +02:00
parent c66a780b78
commit 9f646db94a
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -46,9 +46,16 @@ public class UnitLogger {
StringBuilder args = new StringBuilder(); StringBuilder args = new StringBuilder();
for (Object arg : additionalStuff) { for (Object arg : additionalStuff) {
boolean stringQuotes = arg instanceof String;
// Print full class path for enums
if (arg instanceof Enum<?>) {
arg = arg.getClass().getName() + "." + ((Enum<?>) arg).name();
}
if (!args.isEmpty()) args.append(" "); if (!args.isEmpty()) args.append(" ");
args.append("'"); args.append("'");
if (arg instanceof String) if (stringQuotes)
args.append("\"").append(arg).append("\""); args.append("\"").append(arg).append("\"");
else else
args.append(arg); args.append(arg);