25
25
import java .util .Optional ;
26
26
import java .util .ServiceLoader ;
27
27
import java .util .Set ;
28
+ import java .util .logging .Level ;
28
29
import java .util .logging .Logger ;
29
30
import java .util .regex .Matcher ;
30
31
import java .util .regex .Pattern ;
@@ -121,7 +122,7 @@ private Optional<CdpInfo> findNearestMatch(int version) {
121
122
122
123
for (CdpInfo info : infos ) {
123
124
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 );
125
126
return Optional .of (info );
126
127
}
127
128
@@ -137,15 +138,12 @@ private Optional<CdpInfo> findNearestMatch(int version) {
137
138
}
138
139
}
139
140
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
-
145
141
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 );
147
143
} 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 ()});
149
147
}
150
148
151
149
return Optional .ofNullable (nearestMatch );
0 commit comments