mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
[MINOR] - Add plugin version summary (#6221)
* Add plugin version to summary on startup Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> * Remove test code Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net> --------- Signed-off-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
This commit is contained in:
committed by
GitHub
parent
3ec078ae7c
commit
bbb6c83eaf
@@ -124,8 +124,9 @@ public class BesuPluginContextImpl implements BesuContext, PluginVersionsProvide
|
||||
try {
|
||||
plugin.register(this);
|
||||
LOG.info("Registered plugin of type {}.", plugin.getClass().getName());
|
||||
lines.add(String.format(plugin.getClass().getSimpleName()));
|
||||
addPluginVersion(plugin);
|
||||
String pluginVersion = getPluginVersion(plugin);
|
||||
pluginVersions.add(pluginVersion);
|
||||
lines.add(String.format("%s (%s)", plugin.getClass().getSimpleName(), pluginVersion));
|
||||
} catch (final Exception e) {
|
||||
LOG.error(
|
||||
"Error registering plugin of type "
|
||||
@@ -156,7 +157,7 @@ public class BesuPluginContextImpl implements BesuContext, PluginVersionsProvide
|
||||
return lines;
|
||||
}
|
||||
|
||||
private void addPluginVersion(final BesuPlugin plugin) {
|
||||
private String getPluginVersion(final BesuPlugin plugin) {
|
||||
final Package pluginPackage = plugin.getClass().getPackage();
|
||||
final String implTitle =
|
||||
Optional.ofNullable(pluginPackage.getImplementationTitle())
|
||||
@@ -166,8 +167,7 @@ public class BesuPluginContextImpl implements BesuContext, PluginVersionsProvide
|
||||
Optional.ofNullable(pluginPackage.getImplementationVersion())
|
||||
.filter(Predicate.not(String::isBlank))
|
||||
.orElse("<Unknown Version>");
|
||||
final String pluginVersion = implTitle + "/v" + implVersion;
|
||||
pluginVersions.add(pluginVersion);
|
||||
return implTitle + "/v" + implVersion;
|
||||
}
|
||||
|
||||
/** Before external services. */
|
||||
|
||||
Reference in New Issue
Block a user