From 2226cea00b9cfef0e23d50bcf166326e71547db5 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 15 Jul 2010 06:59:07 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/events/LoggingEventListener.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 2.39.5