]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Log exception if available to make error localization easier.
authorJeremias Maerki <jeremias@apache.org>
Thu, 15 Jul 2010 06:59:07 +0000 (06:59 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 15 Jul 2010 06:59:07 +0000 (06:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@964320 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/events/LoggingEventListener.java

index 03467303e32f04e3eee2f4565a54719183d75b6a..58fbb7f972af7943e26128de600f2e4a391b22c3 100644 (file)
@@ -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;