Skip to content

Commit e9ca574

Browse files
committed
apply suggestion
1 parent d831f37 commit e9ca574

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

framework/spring/lifecycle/src/main/java/org/apache/cloudstack/spring/lifecycle/CloudStackExtendedLifeCycle.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public void with(ComponentLifecycle lifecycle) {
7373
try {
7474
lifecycle.start();
7575
} catch (Exception e) {
76-
logger.error("Error on starting bean {} - {}", lifecycle.getName(), e.getMessage(), e);
77-
throw new CloudRuntimeException("Failed to start bean [" + lifecycle.getName() + "]", e);
76+
logger.error("Error on starting bean [{}] due to: {}", lifecycle.getName(), e);
77+
throw new CloudRuntimeException("Failed to start bean [" + lifecycle.getName() + "]");
7878
}
7979

8080
if (lifecycle instanceof ManagementBean) {

framework/spring/module/src/main/java/org/apache/cloudstack/spring/module/model/impl/DefaultModuleDefinitionSet.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,8 @@ public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
112112
logger.debug(String.format("Could not get module [%s] context bean.", moduleDefinitionName));
113113
}
114114
} catch (BeansException e) {
115-
logger.warn(String.format("Failed to start module [%s] due to: [%s].", moduleDefinitionName, e.getMessage()));
116-
if (logger.isDebugEnabled()) {
117-
logger.debug(String.format("module start failure of module [%s] was due to: ", moduleDefinitionName), e);
118-
}
119-
throw new RuntimeException(String.format("Failed to start module [%s]", moduleDefinitionName), e);
115+
logger.error("Failed to start module [{}] due to: {}", def.getName(), e);
116+
throw new RuntimeException(String.format("Failed to start module [%s]", def.getName()));
120117
}
121118
} catch (EmptyStackException e) {
122119
logger.warn(String.format("Failed to obtain module context due to [%s]. Using root context instead.", e.getMessage()));
@@ -148,11 +145,8 @@ public void with(ModuleDefinition def, Stack<ModuleDefinition> parents) {
148145
logger.debug("Failed to obtain module context: ", e);
149146
}
150147
} catch (BeansException e) {
151-
logger.warn(String.format("Failed to load module [%s] due to: [%s].", def.getName(), e.getMessage()));
152-
if (logger.isDebugEnabled()) {
153-
logger.debug(String.format("module load failure of module [%s] was due to: ", def.getName()), e);
154-
}
155-
throw new RuntimeException(String.format("Failed to load module [%s]", def.getName()), e);
148+
logger.error("Failed to load module [{}] due to: {}", def.getName(), e);
149+
throw new RuntimeException(String.format("Failed to load module [%s]", def.getName()));
156150
}
157151
}
158152
});

0 commit comments

Comments
 (0)