Commit 53506bde065422b6949f366f0f744254cb352238

Authored by Mumfrey
1 parent c35f486d

reduce log spam from event injection

java/common/com/mumfrey/liteloader/common/transformers/PacketEvent.java
@@ -29,6 +29,7 @@ public class PacketEvent extends Event @@ -29,6 +29,7 @@ public class PacketEvent extends Event
29 { 29 {
30 super("on" + packet.getShortName(), true, 1000); 30 super("on" + packet.getShortName(), true, 1000);
31 this.packetIndex = packet.getIndex(); 31 this.packetIndex = packet.getIndex();
  32 + this.verbose = false;
32 } 33 }
33 34
34 /* (non-Javadoc) 35 /* (non-Javadoc)
java/common/com/mumfrey/liteloader/transformers/event/EventTransformer.java
@@ -348,7 +348,15 @@ public final class EventTransformer extends ClassTransformer @@ -348,7 +348,15 @@ public final class EventTransformer extends ClassTransformer
348 { 348 {
349 Event head = injection.getHead(); 349 Event head = injection.getHead();
350 350
351 - LiteLoaderLogger.info("Injecting %s[x%d] in %s in %s", head.getName(), injection.size(), method.name, ClassTransformer.getSimpleClassName(classNode)); 351 + if (head.isVerbose())
  352 + {
  353 + LiteLoaderLogger.info("Injecting %s[x%d] in %s in %s", head.getName(), injection.size(), method.name, ClassTransformer.getSimpleClassName(classNode));
  354 + }
  355 + else
  356 + {
  357 + LiteLoaderLogger.debug("Injecting %s[x%d] in %s in %s", head.getName(), injection.size(), method.name, ClassTransformer.getSimpleClassName(classNode));
  358 + }
  359 +
352 MethodNode handler = head.inject(injectionPoint, injection.isCancellable(), this.globalEventID, injection.captureLocals(), injection.getLocalTypes()); 360 MethodNode handler = head.inject(injectionPoint, injection.isCancellable(), this.globalEventID, injection.captureLocals(), injection.getLocalTypes());
353 injection.addEventsToHandler(handler); 361 injection.addEventsToHandler(handler);
354 362