Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MINOR] - Add plugin version summary #6221

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ public void registerPlugins(final Path pluginsDir) {
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 "
Expand Down Expand Up @@ -156,7 +157,7 @@ public List<String> getPluginsSummaryLog() {
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())
Expand All @@ -166,8 +167,7 @@ private void addPluginVersion(final BesuPlugin plugin) {
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. */
Expand Down
Loading