Package dev.frostlake.executor.udf
Class UdfConsoleCapture
java.lang.Object
dev.frostlake.executor.udf.UdfConsoleCapture
Routes a JVM-handler UDF's console output (
System.out/System.err written on the
invoking thread) into the engine log instead of the embedder's console. Snowflake never surfaces a
UDF's console output to the SQL client — e.g. an ANTLR-based handler's default error listener
printing line 1:1 missing '\n' at … on every recovered parse — so an embedder's test run
should not see it either; it lands here as dev.frostlake.udf.console INFO lines.
Installation swaps System.out/System.err for pass-through wrappers
(UdfConsoleStream) the first time a handler runs; threads outside enter()/
exit() write through to the original streams byte-for-byte. A test harness may replace the
system streams between tests (Surefire does), so enter() re-installs when the wrapper has
been displaced. The relay guard stops recursion when the log appender itself writes to the console.
-
Method Summary