Fix logging problems- log death messages and re-route the server through FML logs properly.

This commit is contained in:
Christian committed 2012-10-17 18:05:23 -04:00
1 parent fe7a832fad
commit 002951804a
3 files changed
+44 -1

No files matched your search

@@ -22,13 +22,18 @@ public class FMLRelaunchLog
@Override
public void publish(LogRecord record)
{
boolean currInt = Thread.interrupted();
try
{
ConsoleLogThread.recordQueue.put(record);
}
catch (InterruptedException e)
{
Thread.interrupted();
e.printStackTrace(errCache);
}
if (currInt)
{
Thread.currentThread().interrupt();
}
}
@@ -61,6 +66,7 @@ public class FMLRelaunchLog
}
catch (InterruptedException e)
{
e.printStackTrace(errCache);
Thread.interrupted();
// Stupid
}
@@ -114,6 +120,8 @@ public class FMLRelaunchLog
private static boolean configured;
private static Thread consoleLogThread;
private static PrintStream errCache;
private Logger myLog;
private FMLRelaunchLog()
@@ -157,6 +165,8 @@ public class FMLRelaunchLog
}
// Set system out to a log stream
errCache = System.err;
System.setOut(new PrintStream(new LoggingOutStream(stdOut), true));
System.setErr(new PrintStream(new LoggingOutStream(stdErr), true));