Skip to content

Commit 54ca223

Browse files
committed
pluggable discovery: Debugging messages under 'discovery.debug' preference
1 parent 20e1770 commit 54ca223

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arduino-core/src/cc/arduino/packages/DiscoveryManager.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,17 @@ public DiscoveryManager(Map<String, TargetPackage> packages) {
7474
continue;
7575
}
7676
try {
77-
System.out.println("found discovery: " + discoveryName + " -> " + pattern);
78-
System.out.println("with preferencess -> " + discoveryPrefs);
77+
if (PreferencesData.getBoolean("discovery.debug")) {
78+
System.out.println("found discovery: " + discoveryName + " -> " + pattern);
79+
System.out.println("with preferencess -> " + discoveryPrefs);
80+
}
7981
pattern = StringReplacer.replaceFromMapping(pattern, PreferencesData.getMap());
8082
String[] cmd = StringReplacer.formatAndSplit(pattern, discoveryPrefs);
8183
discoverers.add(new PluggableDiscovery(discoveryName, cmd));
8284
} catch (Exception e) {
83-
System.out.println(format(tr("Could not start discovery '{0}': {1}"), discoveryName, e.getMessage()));
85+
if (PreferencesData.getBoolean("discovery.debug")) {
86+
System.out.println(format(tr("Could not start discovery '{0}': {1}"), discoveryName, e.getMessage()));
87+
}
8488
}
8589
}
8690
}

0 commit comments

Comments
 (0)