Skip to content

Commit b2d8eb0

Browse files
committed
[java] Reduce noisy logs from CDP version finder
Related to #11088
1 parent 877c34d commit b2d8eb0

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

java/src/org/openqa/selenium/devtools/CdpVersionFinder.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.util.Optional;
2626
import java.util.ServiceLoader;
2727
import java.util.Set;
28+
import java.util.logging.Level;
2829
import java.util.logging.Logger;
2930
import java.util.regex.Matcher;
3031
import java.util.regex.Pattern;
@@ -121,7 +122,7 @@ private Optional<CdpInfo> findNearestMatch(int version) {
121122

122123
for (CdpInfo info : infos) {
123124
if (info.getMajorVersion() == version) {
124-
LOG.info(String.format("Found exact CDP implementation for version %d", version));
125+
LOG.log(Level.FINE, "Found exact CDP implementation for version {0}", version);
125126
return Optional.of(info);
126127
}
127128

@@ -137,15 +138,12 @@ private Optional<CdpInfo> findNearestMatch(int version) {
137138
}
138139
}
139140

140-
LOG.warning(String.format(
141-
"Unable to find an exact match for CDP version %d, so returning the closest version found: %s",
142-
version,
143-
nearestMatch == null ? "a no-op implementation" : nearestMatch.getMajorVersion()));
144-
145141
if (nearestMatch == null) {
146-
LOG.info(String.format("Unable to find CDP implementation matching %d.", version));
142+
LOG.log(Level.WARNING, "Unable to find CDP implementation matching {0}", version);
147143
} else {
148-
LOG.info(String.format("Found CDP implementation for version %d of %d", version, nearestMatch.getMajorVersion()));
144+
LOG.log(Level.WARNING,
145+
"Unable to find an exact match for CDP version {0}, so returning the closest version found: {1}",
146+
new Object[]{version, nearestMatch.getMajorVersion()});
149147
}
150148

151149
return Optional.ofNullable(nearestMatch);

0 commit comments

Comments
 (0)