From 1dd238327ec20bf594e4710122a3f5fc490df022 Mon Sep 17 00:00:00 2001 From: Progwml6 Date: Tue, 25 Mar 2014 01:58:16 -0400 Subject: [PATCH] fix issue w/ new threads and logger redirection --- src/mantle/debug/LogIdentifier.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mantle/debug/LogIdentifier.java b/src/mantle/debug/LogIdentifier.java index f7f0c10..af814c3 100644 --- a/src/mantle/debug/LogIdentifier.java +++ b/src/mantle/debug/LogIdentifier.java @@ -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); } } - -