File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
docs/reference-manual/native-image
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/logging Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ You can configure the logging for the JFR system with a separate flag `-XX:Fligh
59
59
The usage is: ` -XX:FlightRecorderLogging=[tag1[+tag2...][*][=level][,...]] ` .
60
60
For example:
61
61
``` shell
62
- -XX:FlightRecorderLogging=jfr, system=debug
62
+ -XX:FlightRecorderLogging=jfr+ system=debug
63
63
-XX:FlightRecorderLogging=all=trace
64
64
-XX:FlightRecorderLogging=jfr* =error
65
65
```
Original file line number Diff line number Diff line change @@ -92,8 +92,27 @@ private static void setLogTagSetLevels(JfrLogSelection[] selections) {
92
92
private static void verifySelections (JfrLogSelection [] selections ) {
93
93
for (JfrLogSelection selection : selections ) {
94
94
if (!selection .matchesATagSet ) {
95
+ // prepare suggestions
96
+ StringBuilder logTagSuggestions = new StringBuilder ();
97
+ for (Set <JfrLogTag > valid : JfrLogConfiguration .LOG_TAG_SETS .values ()) {
98
+ if (valid .containsAll (selection .tags )) {
99
+ boolean first = true ;
100
+ for (JfrLogTag jfrLogTag : valid ) {
101
+ if (!first ) {
102
+ logTagSuggestions .append ("+" );
103
+ }
104
+ logTagSuggestions .append (jfrLogTag .toString ().toLowerCase (Locale .ROOT ));
105
+ first = false ;
106
+ }
107
+ if (!logTagSuggestions .isEmpty ()) {
108
+ logTagSuggestions .append (" " );
109
+ }
110
+ }
111
+ }
112
+
95
113
throw new IllegalArgumentException ("No tag set matches tag combination " +
96
- selection .tags .toString ().toLowerCase (Locale .ROOT ) + (selection .wildcard ? "*" : "" ) + " for FlightRecorderLogging" );
114
+ selection .tags .toString ().toLowerCase (Locale .ROOT ) + (selection .wildcard ? "*" : "" ) + " for FlightRecorderLogging" +
115
+ (logTagSuggestions .isEmpty () ? "" : ". Did you mean any of the following? " + logTagSuggestions ));
97
116
}
98
117
}
99
118
}
You can’t perform that action at this time.
0 commit comments