From: Jeremias Maerki Date: Thu, 15 Jul 2010 06:59:07 +0000 (+0000) Subject: Log exception if available to make error localization easier. X-Git-Tag: fop-1_1rc1old~487 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2226cea00b9cfef0e23d50bcf166326e71547db5;p=xmlgraphics-fop.git Log exception if available to make error localization easier. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@964320 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/events/LoggingEventListener.java b/src/java/org/apache/fop/events/LoggingEventListener.java index 03467303e..58fbb7f97 100644 --- a/src/java/org/apache/fop/events/LoggingEventListener.java +++ b/src/java/org/apache/fop/events/LoggingEventListener.java @@ -79,10 +79,18 @@ public class LoggingEventListener implements EventListener { } else if (severity == EventSeverity.WARN) { log.warn(msg); } else if (severity == EventSeverity.ERROR) { - log.error(msg); + if (event.getParam("e") != null) { + log.error(msg, (Throwable)event.getParam("e")); + } else { + log.error(msg); + } } else if (severity == EventSeverity.FATAL) { if (!skipFatal) { - log.fatal(msg); + if (event.getParam("e") != null) { + log.fatal(msg, (Throwable)event.getParam("e")); + } else { + log.fatal(msg); + } } } else { assert false;