From a6d7afa6685ffe8f57b2abf582e0dd1725200f2d Mon Sep 17 00:00:00 2001 From: Jacobus Martinus Kruithof Date: Thu, 2 Feb 2006 20:43:05 +0000 Subject: [PATCH] Corrected fix in Task.java (first shortcut removed the task name from the logging entry.) Used patch of Andreas Mross. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@374488 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + src/main/org/apache/tools/ant/Task.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 78278e795..a1db6339c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2,6 +2,7 @@ Amongst other, the following people contributed to ant: Aleksandr Ishutin Andreas Ames +Andreas Mross Andrew Everitt Anil K. Vijendran Anli Shundi diff --git a/src/main/org/apache/tools/ant/Task.java b/src/main/org/apache/tools/ant/Task.java index 8105c26df..b6c4500ff 100644 --- a/src/main/org/apache/tools/ant/Task.java +++ b/src/main/org/apache/tools/ant/Task.java @@ -335,6 +335,22 @@ public abstract class Task extends ProjectComponent { log(msg, Project.MSG_INFO); } + /** + * Logs a message with the given priority. This delegates + * the actual logging to the project. + * + * @param msg The message to be logged. Should not be null. + * @param msgLevel The message priority at which this message is to + * be logged. + */ + public void log(String msg, int msgLevel) { + if (getProject() != null) { + getProject().log(this, msg, msgLevel); + } else { + super.log(msg, msgLevel); + } + } + /** * Performs this task if it's still valid, or gets a replacement * version and performs that otherwise.