On Tue, 17 Jun 2008, Ruel Loehr <[EMAIL PROTECTED]> wrote:

> Does anyone know of a way to pass ants logger to an external type

Not Ant's logger (since there could be more than one BuildListener
attached), but the Project instance that is running Ant.

If your type defines a method of signature

public void setProject(org.apache.tools.ant.Project)

Ant will inject the current project instance into your type when
creating it and you can use project.logMessage and friends.

> such that I could do something like this:
> 
> If (logger !=null)
>             Logger.LogMessage("My message");
> Else
>             System.out.println("My message");

Or you can always log to System.out/err.  Everything that goes to
System.err will end up as WARN message in Ant's logging system,
System.out as INFO (the default level).

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to