From e512386e9a8e457271505dfd5f0cbd43a09668c8 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 17 Feb 2004 15:08:08 +0000 Subject: [PATCH] Adding logError() methods. --- src/helma/framework/core/Application.java | 26 +++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 1619e43e..e23eba60 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -1176,13 +1176,13 @@ public final class Application implements IPathElement, Runnable { if (args == null) { args = new Object[0]; } - + if (reval != null) { try { return reval.invokeDirectFunction(obj, func, args); } catch (Exception x) { if (debug) { - System.err.println("Error in Application.invokeFunction (" + + System.err.println("Error in Application.invokeFunction (" + func + "): " + x); } } @@ -1316,6 +1316,28 @@ public final class Application implements IPathElement, Runnable { //////////////////////////////////////////////////////////////////////// + /** + * Log an application error + */ + public void logError(String msg, Throwable error) { + if (eventLog == null) { + eventLog = getLogger(eventLogName); + } + + eventLog.error(msg, error); + } + + /** + * Log an application error + */ + public void logError(String msg) { + if (eventLog == null) { + eventLog = getLogger(eventLogName); + } + + eventLog.error(msg); + } + /** * Log a generic application event */