mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Big cleanup of logging. Might do some tweaks of the userdev logging, but this should be good for vanilla..
Signed-off-by: cpw <[email protected]>
This commit is contained in:
9 files changed
+46
-22
No files matched your search
@@ -66,7 +66,7 @@ public class AutomaticEventSubscriber
|
||||
if (Objects.equals(mod.getModId(), modId) && sides.contains(FMLEnvironment.dist)) {
|
||||
try
|
||||
{
|
||||
LOGGER.info(LOADING, "Auto-subscribing {} to {}", ad.getClassType().getClassName(), busTarget);
|
||||
LOGGER.debug(LOADING, "Auto-subscribing {} to {}", ad.getClassType().getClassName(), busTarget);
|
||||
busTarget.bus().get().register(Class.forName(ad.getClassType().getClassName(), true, loader));
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
|
||||
@@ -37,15 +37,15 @@ public class LaunchTesting
|
||||
public static void main(String... args) throws InterruptedException
|
||||
{
|
||||
Configurator.setRootLevel(Level.DEBUG);
|
||||
final MarkerFilter classloadingFilter = MarkerFilter.createFilter("CLASSLOADING", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
final MarkerFilter launchpluginFilter = MarkerFilter.createFilter("LAUNCHPLUGIN", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
// final MarkerFilter classloadingFilter = MarkerFilter.createFilter("CLASSLOADING", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
// final MarkerFilter launchpluginFilter = MarkerFilter.createFilter("LAUNCHPLUGIN", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
final MarkerFilter axformFilter= MarkerFilter.createFilter("AXFORM", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
final MarkerFilter eventbusFilter = MarkerFilter.createFilter("EVENTBUS", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
final MarkerFilter distxformFilter = MarkerFilter.createFilter("DISTXFORM", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
// final MarkerFilter scannerFilter = MarkerFilter.createFilter("SCAN", Filter.Result.DENY, Filter.Result.NEUTRAL);
|
||||
final LoggerContext logcontext = LoggerContext.getContext(false);
|
||||
logcontext.getConfiguration().addFilter(classloadingFilter);
|
||||
logcontext.getConfiguration().addFilter(launchpluginFilter);
|
||||
// logcontext.getConfiguration().addFilter(classloadingFilter);
|
||||
// logcontext.getConfiguration().addFilter(launchpluginFilter);
|
||||
// logcontext.getConfiguration().addFilter(axformFilter);
|
||||
// logcontext.getConfiguration().addFilter(eventbusFilter);
|
||||
// logcontext.getConfiguration().addFilter(distxformFilter);
|
||||
|
||||
@@ -94,13 +94,13 @@ public class ModList
|
||||
}
|
||||
|
||||
private void dispatchSynchronousEvent(LifecycleEventProvider.LifecycleEvent lifecycleEvent, final Consumer<List<ModLoadingException>> errorHandler) {
|
||||
LOGGER.info(LOADING, "Dispatching synchronous event {}", lifecycleEvent);
|
||||
LOGGER.debug(LOADING, "Dispatching synchronous event {}", lifecycleEvent);
|
||||
FMLLoader.getLanguageLoadingProvider().forEach(lp->lp.consumeLifecycleEvent(()->lifecycleEvent));
|
||||
this.mods.forEach(m->m.transitionState(lifecycleEvent, errorHandler));
|
||||
FMLLoader.getLanguageLoadingProvider().forEach(lp->lp.consumeLifecycleEvent(()->lifecycleEvent));
|
||||
}
|
||||
private void dispatchParallelEvent(LifecycleEventProvider.LifecycleEvent lifecycleEvent, final Consumer<List<ModLoadingException>> errorHandler) {
|
||||
LOGGER.info(LOADING, "Dispatching parallel event {}", lifecycleEvent);
|
||||
LOGGER.debug(LOADING, "Dispatching parallel event {}", lifecycleEvent);
|
||||
FMLLoader.getLanguageLoadingProvider().forEach(lp->lp.consumeLifecycleEvent(()->lifecycleEvent));
|
||||
DeferredWorkQueue.clear();
|
||||
try
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.ModContainer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class ModLifecycleEvent extends Event
|
||||
public final String description()
|
||||
{
|
||||
String cn = getClass().getName();
|
||||
return cn.substring(cn.lastIndexOf('.')+4,cn.length()-5);
|
||||
return cn.substring(cn.lastIndexOf('.')+1);
|
||||
}
|
||||
|
||||
public Stream<InterModComms.IMCMessage> getIMCStream() {
|
||||
@@ -52,4 +53,9 @@ public class ModLifecycleEvent extends Event
|
||||
public Stream<InterModComms.IMCMessage> getIMCStream(Predicate<String> methodFilter) {
|
||||
return InterModComms.getMessages(this.container.getModId(), methodFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return description();
|
||||
}
|
||||
}
|
||||
@@ -98,11 +98,11 @@ public class FMLModContainer extends ModContainer
|
||||
|
||||
private void fireEvent(LifecycleEventProvider.LifecycleEvent lifecycleEvent) {
|
||||
final Event event = lifecycleEvent.getOrBuildEvent(this);
|
||||
LOGGER.info(LOADING, "Firing event for modid {} : {}", this.getModId(), event.getClass().getName());
|
||||
LOGGER.debug(LOADING, "Firing event for modid {} : {}", this.getModId(), event);
|
||||
try
|
||||
{
|
||||
eventBus.post(event);
|
||||
LOGGER.debug(LOADING, "Fired event for modid {} : {}", this.getModId(), event.getClass().getName());
|
||||
LOGGER.debug(LOADING, "Fired event for modid {} : {}", this.getModId(), event);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user