For desktop apps, it's useful to see the stacktrace on the GUI when the program crashes. I implemented this in Java by replacing System.err with my own error handler, which redirects all error messages to a GUI component and a text file.
The problem: Quite a few libraries out there (e.g. Apache POI) don't just write to System.err when a crash occurs, they also output simple warning messages. This causes the crash window to pop up unnecessarily. So my question is, does anybody know how to (1) show the stacktrace when the program crashes, while (2) not showing it in case of warning messages?
[Edit] My GUI is written in SWT.