File tree 1 file changed +8
-6
lines changed
javaagent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,17 @@ private AgentArgUtil() {}
15
15
public static void setSystemProperties (@ Nullable String agentArgs ) {
16
16
boolean debug = false ;
17
17
if (agentArgs != null && !agentArgs .isEmpty ()) {
18
- String [] options = agentArgs .split (";" );
19
- for (String option : options ) {
18
+ for (String option : agentArgs .split (";" )) {
20
19
String [] keyValue = option .split ("=" );
21
20
if (keyValue .length == 2 ) {
22
- if (keyValue [0 ].equals ("otel.javaagent.debug" )) {
23
- debug = Boolean .parseBoolean (keyValue [1 ]);
24
- System .setProperty (keyValue [0 ], keyValue [1 ]);
21
+ String key = keyValue [0 ];
22
+ String value = keyValue [1 ];
23
+ System .setProperty (key , value );
24
+ if (key .equals ("otel.javaagent.debug" )) {
25
+ debug = Boolean .parseBoolean (value );
26
+ }
25
27
if (debug ) {
26
- System .out .println ("Setting property [" + keyValue [ 0 ] + "] = " + keyValue [ 1 ] );
28
+ System .out .println ("Setting property [" + key + "] = " + value );
27
29
}
28
30
}
29
31
}
You can’t perform that action at this time.
0 commit comments