Add stderr filtering and redirection for GTK messages
This change introduces a structured mechanism to capture and filter specific stderr messages (e.g., GTK warnings) in the hpcviewer launcher.
- Added
StderrFilterto filter and log stderr lines matching configurable patterns (in this case "Gtk-" warnings/errors/critical). - Added
NativeStdioRedirector(Linux only) that usespipe()+dup2()via the Java Foreign Function & Memory API (JDK 22+) to redirect native stderr output into a filter stream:- A single daemon thread reads from the redirected stderr pipe to prevent blocking or deadlocks, as required by Unix pipes.
- On non-Linux systems, native redirection is skipped (harmless since SWT only uses GTK on Linux)
- Provides log file output with timestamped entries for matched lines.
- Added unit tests (
StderrFilterTest) for the filtering logic
Compatibility issues:
- Requires Java 22 or newer due to Java FFM (foreign function & memory)
Signed-off-by: Laksono Adhianto laksono@gmail.com