5
5
6
6
package io .opentelemetry .contrib .stacktrace ;
7
7
8
+ import static java .util .logging .Level .FINE ;
9
+ import static java .util .logging .Level .SEVERE ;
10
+
8
11
import com .google .auto .service .AutoService ;
9
12
import io .opentelemetry .sdk .autoconfigure .spi .AutoConfigurationCustomizer ;
10
13
import io .opentelemetry .sdk .autoconfigure .spi .AutoConfigurationCustomizerProvider ;
14
17
import java .lang .reflect .InvocationTargetException ;
15
18
import java .time .Duration ;
16
19
import java .util .function .Predicate ;
17
- import java .util .logging .Level ;
18
20
import java .util .logging .Logger ;
19
21
import javax .annotation .Nullable ;
20
22
21
23
@ AutoService (AutoConfigurationCustomizerProvider .class )
22
- public class StackTraceAutoConfig implements AutoConfigurationCustomizerProvider {
24
+ public final class StackTraceAutoConfig implements AutoConfigurationCustomizerProvider {
23
25
24
26
private static final Logger log = Logger .getLogger (StackTraceAutoConfig .class .getName ());
25
27
@@ -50,7 +52,7 @@ static long getMinDuration(ConfigProperties properties) {
50
52
log .fine ("Stack traces capture is disabled" );
51
53
} else {
52
54
log .log (
53
- Level . FINE ,
55
+ FINE ,
54
56
"Stack traces will be added to spans with a minimum duration of {0} nanos" ,
55
57
minDuration );
56
58
}
@@ -70,7 +72,7 @@ static Predicate<ReadableSpan> getFilterPredicate(ConfigProperties properties) {
70
72
71
73
if (filter == null ) {
72
74
// if value is set, lack of filtering is likely an error and must be reported
73
- Level disabledLogLevel = filterClass != null ? Level . SEVERE : Level . FINE ;
75
+ java . util . logging . Level disabledLogLevel = filterClass != null ? SEVERE : FINE ;
74
76
log .log (disabledLogLevel , "Span stacktrace filtering disabled" );
75
77
return span -> true ;
76
78
} else {
0 commit comments