>Yes, that's right. But I didn't get any output at all when running the >task from inside a java class. So how can I get the ant log messages as a >string? > > From my first message: > >BuildLogger log = new DefaultLogger(); >log.setMessageOutputLevel(Project.MSG_VERBOSE); >log.setOutputPrintStream(System.out); >log.setErrorPrintStream(System.out); >project.addBuildListener(log); > >Did not produce any outputs for me.
My ant task logs like this: public class ReorganizeAntTask extends Task ... void logVerbose(String s) { log(s, Project.MSG_VERBOSE); } void logError(String s) { log(s, Project.MSG_ERR); } ... logVerbose("some verbose logging"); that's all I needed to get the log messages to System.out. It works, because my task inherits the logging functionality from the "task" class. Martin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]