updated logs

This commit is contained in:
Francesco Mangiacrapa 2024-01-18 16:57:17 +01:00
parent 82e8505bdc
commit 94bb1b9315
2 changed files with 59 additions and 48 deletions

View File

@ -79,7 +79,9 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements Initializa
report.setStatus(Report.Status.OK);
report.putMessage("Initialized " + DESCRIPTOR.getId() + " in the " + context);
} catch (Exception e) {
throw new InitializationException("Unable to initialize " + DESCRIPTOR.getId(), e);
InitializationException exc = new InitializationException("Unable to initialize " + DESCRIPTOR.getId(), e);
log.error("initInContext error: {} ", exc);
throw exc;
}
return report;
}
@ -129,6 +131,8 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements Initializa
@Override
public InitializationReport init() throws InitializationException {
log.debug("Called init");
InitializationReport report = null;
try {
// Creating all listeners
EventListener<ItemObserved<Project>> listenerCreated = new EventListener<ItemObserved<Project>>() {
@ -192,7 +196,14 @@ public class CatalogueBindingPlugin extends AbstractPlugin implements Initializa
eventMngInst.subscribe(Event.PROJECT_DELETED, listenerDeleted);
eventMngInst.subscribe(Event.LIFECYCLE_STEP_PERFORMED, listenerLCStepPerformed);
return new InitializationReport(Status.OK, PLUGIN_ID + " init performed");
report = new InitializationReport(Status.OK, PLUGIN_ID + " init performed");
} catch (Exception e) {
InitializationException exc = new InitializationException("Unable to initialize " + DESCRIPTOR.getId(), e);
log.error("init error: {} ", exc);
throw exc;
}
return report;
}

View File

@ -26,10 +26,10 @@ public class PluginsReflections {
.filterInputsBy(new FilterBuilder().includePackage("org.gcube.application.cms")));
reflections.getSubTypesOf(Plugin.class).iterator().forEachRemaining(pluginClass->{
log.trace("Evaluating class {}",pluginClass);
log.debug("Evaluating class {}",pluginClass);
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
try {
log.debug("Found implementation {} ",pluginClass);
log.debug("\nFound implementation {} ",pluginClass);
Plugin plugin = pluginClass.newInstance();
log.debug("Loading {} description : {}", plugin, plugin.getDescriptor());