- syserr(e);
- }
- }
-
- /**
- * Replace the global syserr handler.
- *
- * @param syserrHandler
- * the new syserr handler
- */
- public static void setSyserrHandler(SyserrHandler syserrHandler) {
- Instance.syserrHandler = syserrHandler;
- }
-
- /**
- * Replace the global trace handler.
- *
- * @param traceHandler
- * the new trace handler
- */
- public static void setTraceHandler(TraceHandler traceHandler) {
- Instance.traceHandler = traceHandler;
- }
-
- /**
- * Report an error to the user
- *
- * @param e
- * the {@link Exception} to report
- */
- public static void syserr(Exception e) {
- if (syserrHandler != null) {
- syserrHandler.notify(e, debug);
- } else {
- if (debug) {
- e.printStackTrace();
- } else {
- System.err.println(e.getMessage());
- }
- }
- }
-
- /**
- * Notify of a debug message.
- *
- * @param message
- * the message
- */
- public static void trace(String message) {
- if (trace) {
- if (traceHandler != null) {
- traceHandler.trace(message);
- } else {
- System.out.println(message);
- }