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
5959The usage is: ` -XX:FlightRecorderLogging=[tag1[+tag2...][*][=level][,...]] ` .
6060For example:
6161``` shell
62- -XX:FlightRecorderLogging=jfr, system=debug
62+ -XX:FlightRecorderLogging=jfr+ system=debug
6363-XX:FlightRecorderLogging=all=trace
6464-XX:FlightRecorderLogging=jfr* =error
6565```
Original file line number Diff line number Diff line change @@ -92,8 +92,27 @@ private static void setLogTagSetLevels(JfrLogSelection[] selections) {
9292 private static void verifySelections (JfrLogSelection [] selections ) {
9393 for (JfrLogSelection selection : selections ) {
9494 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+
95113 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 ));
97116 }
98117 }
99118 }
You can’t perform that action at this time.
0 commit comments