1212import org .elasticsearch .bootstrap .BootstrapInfo ;
1313import org .elasticsearch .cli .Terminal ;
1414import org .elasticsearch .cli .Terminal .Verbosity ;
15+ import org .elasticsearch .common .regex .Regex ;
1516
1617import java .io .BufferedReader ;
1718import java .io .Closeable ;
1819import java .io .IOException ;
1920import java .io .InputStream ;
2021import java .io .InputStreamReader ;
2122import java .nio .charset .StandardCharsets ;
22- import java .util .List ;
2323import java .util .concurrent .CountDownLatch ;
24+ import java .util .function .Predicate ;
2425
2526import static org .elasticsearch .bootstrap .BootstrapInfo .SERVER_READY_MARKER ;
2627import static org .elasticsearch .server .cli .ProcessUtil .nonInterruptibleVoid ;
@@ -84,8 +85,12 @@ void drain() {
8485 nonInterruptibleVoid (this ::join );
8586 }
8687
87- /** List of messages / lines to filter from the output. */
88- List <String > filter = List .of ("WARNING: Using incubator modules: jdk.incubator.vector" );
88+ /** Messages / lines predicate to filter from the output. */
89+ private static Predicate <String > filter = Regex .simpleMatcher (
90+ "WARNING: Using incubator modules: jdk.incubator.vector" ,
91+ // requires log4j2 upgrade, see https://github.com/elastic/elasticsearch/issues/132035
92+ "WARNING: Use of the three-letter time zone ID * is deprecated and it will be removed in a future release"
93+ );
8994
9095 @ Override
9196 public void run () {
@@ -95,7 +100,7 @@ public void run() {
95100 if (line .isEmpty () == false && line .charAt (0 ) == SERVER_READY_MARKER ) {
96101 ready = true ;
97102 readyOrDead .countDown ();
98- } else if (filter .contains (line ) == false ) {
103+ } else if (filter .test (line ) == false ) {
99104 terminal .errorPrintln (Verbosity .SILENT , line , false );
100105 }
101106 }
0 commit comments