mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-04 23:06:05 +00:00
add logging
This commit is contained in:
@@ -200,12 +200,15 @@ public abstract class AbstractPlatform implements Platform {
|
||||
platformInjector.addExplicitTarget(Platform.class);
|
||||
|
||||
bootstrapAddonLoader.loadAddons(addonsFolder, getClass().getClassLoader())
|
||||
.forEach(bootstrap -> bootstrap.loadAddons(addonsFolder, getClass().getClassLoader())
|
||||
.forEach(addon -> {
|
||||
platformInjector.inject(addon);
|
||||
addon.initialize();
|
||||
addonRegistry.register(addon.getID(), addon);
|
||||
}));
|
||||
.forEach(bootstrap -> {
|
||||
platformInjector.inject(bootstrap);
|
||||
bootstrap.loadAddons(addonsFolder, getClass().getClassLoader())
|
||||
.forEach(addon -> {
|
||||
platformInjector.inject(addon);
|
||||
addon.initialize();
|
||||
addonRegistry.register(addon.getID(), addon);
|
||||
});
|
||||
});
|
||||
|
||||
eventManager
|
||||
.getHandler(FunctionalEventHandler.class)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.dfsek.terra.addon;
|
||||
import com.dfsek.terra.addon.exception.AddonLoadException;
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.addon.bootstrap.BootstrapBaseAddon;
|
||||
import com.dfsek.terra.api.inject.Injector;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
@@ -43,6 +44,7 @@ public class BootstrapAddonLoader implements BootstrapBaseAddon<BootstrapBaseAdd
|
||||
if(!(in instanceof BootstrapBaseAddon)) {
|
||||
throw new AddonLoadException(in.getClass() + " does not extend " + BootstrapBaseAddon.class);
|
||||
}
|
||||
platform.logger().info("Loaded bootstrap addon " + ((BootstrapBaseAddon<?>) in).getID());
|
||||
return (BootstrapBaseAddon<?>) in;
|
||||
} catch(InvocationTargetException e) {
|
||||
throw new AddonLoadException("Exception occurred while instantiating addon: ", e);
|
||||
|
||||
Reference in New Issue
Block a user