forked from StarOpenSource/Engine
Print full class path for enums (UnitLogger)
This commit is contained in:
parent
c66a780b78
commit
9f646db94a
1 changed files with 8 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue