1717
1818package org .openqa .selenium .remote .http ;
1919
20+ import static com .google .common .net .HttpHeaders .CONTENT_LENGTH ;
21+ import static java .net .HttpURLConnection .HTTP_INTERNAL_ERROR ;
22+ import static java .net .HttpURLConnection .HTTP_UNAVAILABLE ;
23+ import static org .openqa .selenium .internal .Debug .getDebugLogLevel ;
24+
2025import net .jodah .failsafe .Failsafe ;
2126import net .jodah .failsafe .RetryPolicy ;
27+
2228import org .openqa .selenium .TimeoutException ;
2329
2430import java .net .ConnectException ;
2531import java .time .Duration ;
2632import java .time .temporal .ChronoUnit ;
27- import java .util .logging .Level ;
2833import java .util .logging .Logger ;
2934
30- import static com .google .common .net .HttpHeaders .CONTENT_LENGTH ;
31- import static java .net .HttpURLConnection .HTTP_INTERNAL_ERROR ;
32- import static java .net .HttpURLConnection .HTTP_UNAVAILABLE ;
33-
3435public class RetryRequest implements Filter {
3536
3637 private static final Logger LOG = Logger .getLogger (RetryRequest .class .getName ());
@@ -43,7 +44,7 @@ public class RetryRequest implements Filter {
4344 .withMaxRetries (3 )
4445 .withMaxDuration (Duration .ofSeconds (10 ))
4546 .onRetry (e -> LOG .log (
46- Level . WARNING ,
47+ getDebugLogLevel () ,
4748 "Connection failure #{0}. Retrying." ,
4849 e .getAttemptCount ()));
4950
@@ -55,7 +56,7 @@ public class RetryRequest implements Filter {
5556 .withMaxRetries (3 )
5657 .withMaxDuration (Duration .ofSeconds (10 ))
5758 .onRetry (e -> LOG .log (
58- Level . WARNING ,
59+ getDebugLogLevel () ,
5960 "Read timeout #{0}. Retrying." ,
6061 e .getAttemptCount ()));
6162
@@ -69,7 +70,7 @@ public class RetryRequest implements Filter {
6970 .withMaxRetries (2 )
7071 .withMaxDuration (Duration .ofSeconds (3 ))
7172 .onRetry (e -> LOG .log (
72- Level . WARNING ,
73+ getDebugLogLevel () ,
7374 "Failure due to server error #{0}. Retrying." ,
7475 e .getAttemptCount ()));
7576
0 commit comments