@@ -132,10 +132,14 @@ public PluginsService(Settings settings, Path configPath, Path modulesDirectory,
132
132
133
133
// load modules
134
134
List <PluginDescriptor > modulesList = new ArrayList <>();
135
+ Set <String > moduleNameList = new HashSet <>();
135
136
if (modulesDirectory != null ) {
136
137
try {
137
138
Set <PluginBundle > modules = PluginsUtils .getModuleBundles (modulesDirectory );
138
- modules .stream ().map (PluginBundle ::pluginDescriptor ).forEach (modulesList ::add );
139
+ modules .stream ().map (PluginBundle ::pluginDescriptor ).forEach (m -> {
140
+ modulesList .add (m );
141
+ moduleNameList .add (m .getName ());
142
+ });
139
143
seenBundles .addAll (modules );
140
144
} catch (IOException ex ) {
141
145
throw new IllegalStateException ("Unable to initialize modules" , ex );
@@ -173,8 +177,13 @@ public PluginsService(Settings settings, Path configPath, Path modulesDirectory,
173
177
174
178
// we don't log jars in lib/ we really shouldn't log modules,
175
179
// but for now: just be transparent so we can debug any potential issues
176
- logPluginInfo (info .getModuleInfos (), "module" , logger );
177
- logPluginInfo (pluginsList , "plugin" , logger );
180
+ for (String name : loadedPlugins .keySet ()) {
181
+ if (moduleNameList .contains (name )) {
182
+ logger .info ("loaded module [{}]" , name );
183
+ } else {
184
+ logger .info ("loaded plugin [{}]" , name );
185
+ }
186
+ }
178
187
}
179
188
180
189
// package-private for testing
@@ -194,17 +203,6 @@ static void checkMandatoryPlugins(Set<String> existingPlugins, Set<String> manda
194
203
}
195
204
}
196
205
197
- private static void logPluginInfo (final List <PluginDescriptor > pluginDescriptors , final String type , final Logger logger ) {
198
- assert pluginDescriptors != null ;
199
- if (pluginDescriptors .isEmpty ()) {
200
- logger .info ("no " + type + "s loaded" );
201
- } else {
202
- for (final String name : pluginDescriptors .stream ().map (PluginDescriptor ::getName ).sorted ().toList ()) {
203
- logger .info ("loaded " + type + " [" + name + "]" );
204
- }
205
- }
206
- }
207
-
208
206
private static List <PluginRuntimeInfo > getRuntimeInfos (
209
207
PluginIntrospector inspector ,
210
208
List <PluginDescriptor > pluginDescriptors ,
0 commit comments