File tree 3 files changed +13
-45
lines changed
src/org/openqa/selenium/internal
3 files changed +13
-45
lines changed Original file line number Diff line number Diff line change 26
26
*/
27
27
public class Debug {
28
28
29
- private static final boolean IS_DEBUG ;
29
+ private static boolean IS_DEBUG ;
30
30
static {
31
- IS_DEBUG = Boolean .getBoolean ("selenium.webdriver.verbose" ) ||
32
- // Thanks https://stackoverflow.com/a/6865049
33
- ManagementFactory .getRuntimeMXBean ().getInputArguments ().toString ().contains ("-agentlib:jdwp" );
31
+ boolean debugFlag = ManagementFactory .getRuntimeMXBean ().getInputArguments ().stream ()
32
+ .map (str -> str .contains ("-agentlib:jdwp" ))
33
+ .reduce (Boolean ::logicalOr )
34
+ .orElse (false );
35
+ boolean simpleProperty = Boolean .getBoolean ("selenium.debug" );
36
+ boolean longerProperty = Boolean .getBoolean ("selenium.webdriver.verbose" );
37
+
38
+ IS_DEBUG = debugFlag || simpleProperty || longerProperty ;
34
39
}
35
40
36
41
private Debug () {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 39
39
40
40
import static java .util .Collections .emptyList ;
41
41
import static java .util .stream .Collectors .toList ;
42
- import static org .openqa .selenium .build .Debug .isDebug ;
42
+ import static org .openqa .selenium .internal .Debug .isDebugging ;
43
43
44
44
public class CaptureLoggingRule implements TestRule {
45
45
@ Override
@@ -71,7 +71,7 @@ public void evaluate() throws Throwable {
71
71
}
72
72
73
73
private List <Handler > beginLogCapture () {
74
- if (isDebug ()) {
74
+ if (isDebugging ()) {
75
75
return emptyList ();
76
76
}
77
77
@@ -92,7 +92,7 @@ private List<Handler> beginLogCapture() {
92
92
}
93
93
94
94
private void writeCapturedLogs () {
95
- if (isDebug ()) {
95
+ if (isDebugging ()) {
96
96
return ;
97
97
}
98
98
@@ -104,7 +104,7 @@ private void writeCapturedLogs() {
104
104
}
105
105
106
106
private void endLogCapture (List <Handler > handlers ) {
107
- if (isDebug ()) {
107
+ if (isDebugging ()) {
108
108
return ;
109
109
}
110
110
You can’t perform that action at this time.
0 commit comments