Fix log4j2 config. Fix server gui to *show* logging. Fix log spamminess in the console. Fix bug in servergui that can cause deadlock.

This commit is contained in:
Christian 2014-01-20 15:09:24 -05:00
parent 7a3fd048d2
commit 87a45d83fb
4 changed files with 51 additions and 19 deletions

View file

@ -0,0 +1,34 @@
--- ../src-base/minecraft/net/minecraft/server/gui/MinecraftServerGui.java
+++ ../src-work/minecraft/net/minecraft/server/gui/MinecraftServerGui.java
@@ -13,6 +13,7 @@
import java.awt.event.FocusEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.util.concurrent.CountDownLatch;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
@@ -79,6 +80,7 @@
System.exit(0);
}
});
+ minecraftservergui.latch.countDown();
}
public MinecraftServerGui(DedicatedServer p_i2362_1_)
@@ -165,8 +167,15 @@
return jpanel;
}
+ private CountDownLatch latch = new CountDownLatch(1);
public void func_164247_a(final JTextArea p_164247_1_, final JScrollPane p_164247_2_, final String p_164247_3_)
{
+ try
+ {
+ latch.await();
+ } catch (InterruptedException e)
+ {
+ }
if (!SwingUtilities.isEventDispatchThread())
{
SwingUtilities.invokeLater(new Runnable()

View file

@ -13,6 +13,7 @@ public class FMLServerTweaker extends FMLTweaker {
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
classLoader.addClassLoaderExclusion("com.mojang.util.");
classLoader.addTransformerExclusion("cpw.mods.fml.repackage.");
classLoader.addTransformerExclusion("cpw.mods.fml.relauncher.");
classLoader.addTransformerExclusion("cpw.mods.fml.common.asm.transformers.");

View file

@ -125,13 +125,13 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
@Override
public void func_148756_a(int id, String name, Object thing)
{
FMLLog.info("Add : %s %d %s", name, id, thing);
FMLLog.finer("Add : %s %d %s", name, id, thing);
add(id, name, superType.cast(thing));
}
int swap(int id, String name, I thing)
{
FMLLog.info("Swap : %s %d %s", name, id, thing);
FMLLog.fine("Swap : %s %d %s", name, id, thing);
BitSet temporary = availabilityMap;
availabilityMap = transactionalAvailabilityMap;
@ -149,7 +149,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
reassignMapping(name, idToUse);
useSlot(idToUse);
availabilityMap = temporary;
FMLLog.info("Swap : %s %d %s", name, idToUse, thing);
FMLLog.fine("Swap : %s %d %s", name, idToUse, thing);
return idToUse;
}
public int add(int id, String name, I thing)
@ -178,7 +178,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
namedIds.forcePut(func_148755_c(name),idToUse);
super.func_148756_a(idToUse, name, thing);
useSlot(idToUse);
FMLLog.info("Add : %s %d %s", name, idToUse, thing);
FMLLog.finer("Add : %s %d %s", name, idToUse, thing);
return idToUse;
}
@ -313,7 +313,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
{
String name = entry.getKey();
Object thing = idMap().get(entry.getValue().intValue());
FMLLog.info("Registry : %s %d %s", name, entry.getValue(), thing);
FMLLog.finer("Registry : %s %d %s", name, entry.getValue(), thing);
}
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="net.minecraft,com.mojang">
<Configuration status="WARN" packages="com.mojang.util" verbose="true">
<Appenders>
<Console name="FmlSysOut" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
@ -8,10 +8,7 @@
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
</Console>
<Queue name="ServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level]: %msg%n" />
</Queue>
<Queue name="FmlServerGuiConsole">
<PatternLayout pattern="[%d{HH:mm:ss} %level] [%logger]: %msg%n" />
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
</Queue>
<RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level]: %msg%n" />
@ -22,26 +19,26 @@
</RollingRandomAccessFile>
<RollingRandomAccessFile name="FmlFile" fileName="logs/fml-latest.log" filePattern="logs/fml-%d{yyyy-MM-dd}-%i.log.gz">
<PatternLayout pattern="[%d{HH:mm:ss}] [%t/%level] [%logger]: %msg%n" />
<DefaultRolloverStrategy max="3" />
<Policies>
<TimeBasedTriggeringPolicy />
<OnStartupTriggeringPolicy />
<DefaultRolloverStrategy max="3"/>
</Policies>
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="info" name="net/minecraft" additibity="false">
<Logger level="info" name="net.minecraft" additivity="false">
<filters>
<MarkerFilter marker="NETWORK_PACKETS" onMatch="DENY" onMismatch="NEUTRAL" />
</filters>
<AppenderRef ref="SysOut"/>
<AppenderRef ref="File"/>
<AppenderRef ref="ServerGuiConsole"/>
</Root>
<AppenderRef ref="SysOut" level="INFO"/>
<AppenderRef ref="File" />
<AppenderRef ref="ServerGuiConsole" level="INFO"/>
</Logger>
<Root level="all">
<AppenderRef ref="FmlSysOut"/>
<AppenderRef ref="FmlFile"/>
<AppenderRef ref="FmlServerGuiConsole"/>
<AppenderRef ref="FmlSysOut" level="INFO"/>
<AppenderRef ref="ServerGuiConsole" level="INFO"/>
<AppenderRef ref="FmlFile" />
</Root>
</Loggers>
</Configuration>