Skip to content

Commit d9ef528

Browse files
committed
Better logging from proxying CDP nodes when in debug mode
1 parent dcc371d commit d9ef528

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

java/server/src/org/openqa/selenium/grid/node/ProxyNodeCdp.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import java.util.logging.Level;
4040
import java.util.logging.Logger;
4141

42+
import static org.openqa.selenium.internal.Debug.getDebugLogLevel;
4243
import static org.openqa.selenium.remote.http.HttpMethod.GET;
4344

4445
public class ProxyNodeCdp implements BiFunction<String, Consumer<Message>, Optional<Consumer<Message>>> {
@@ -78,20 +79,23 @@ public Optional<Consumer<Message>> apply(String uri, Consumer<Message> downstrea
7879
Optional<URI> cdpUri = CdpEndpointFinder.getReportedUri("goog:chromeOptions", caps)
7980
.flatMap(reported -> CdpEndpointFinder.getCdpEndPoint(clientFactory, reported));
8081
if (cdpUri.isPresent()) {
81-
LOG.fine("Chrome endpoint found");
82+
LOG.log(getDebugLogLevel(), "Chrome endpoint found");
8283
return cdpUri.map(cdp -> createCdpEndPoint(cdp, downstream));
8384
}
8485

8586
cdpUri = CdpEndpointFinder.getReportedUri("moz:debuggerAddress", caps)
8687
.flatMap(reported -> CdpEndpointFinder.getCdpEndPoint(clientFactory, reported));
8788
if (cdpUri.isPresent()) {
88-
LOG.fine("Firefox endpoint found");
89+
LOG.log(getDebugLogLevel(), "Firefox endpoint found");
8990
return cdpUri.map(cdp -> createCdpEndPoint(cdp, downstream));
9091
}
9192

9293
LOG.fine("Searching for edge options");
9394
cdpUri = CdpEndpointFinder.getReportedUri("ms:edgeOptions", caps)
9495
.flatMap(reported -> CdpEndpointFinder.getCdpEndPoint(clientFactory, reported));
96+
if (cdpUri.isPresent()) {
97+
LOG.log(getDebugLogLevel(), "Edge endpoint found");
98+
}
9599
return cdpUri.map(cdp -> createCdpEndPoint(cdp, downstream));
96100
}
97101

0 commit comments

Comments
 (0)