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.