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