mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-28 15:36:13 +00:00
fix issue w/ new threads and logger redirection
This commit is contained in:
1 parent
c871ee3a57
commit
1dd238327e
1 file changed
+5
-4
@@ -18,7 +18,7 @@ public class LogIdentifier
|
||||
logger.info("TracingPrintStream inserted on STDOUT/STDERR. These will now be redirected to the Mantle-STDOUT/Mantle-STDERR loggers.");
|
||||
//logger.info("Forcing Java.util.Logger logging into log4j2");
|
||||
//JavaLoggingRedirector.activate();
|
||||
// logger.info("Successfully redirected java.util.logging");
|
||||
// logger.info("Successfully redirected java.util.logging");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,9 +38,10 @@ class TracingPrintStream extends PrintStream
|
||||
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
|
||||
// stack(2) is calling object.
|
||||
String name = stack[2].getClassName();
|
||||
l.info("[" + name + "]: " + x);
|
||||
if (name != null)
|
||||
l.info("[" + name + "]: " + x);
|
||||
else
|
||||
l.info("[" + Thread.currentThread().getName() + "]: " + x);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user