ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Schwaebli <hans_schwae...@yahoo.com>
Subject Re: How to enable logging when using Ant programatically?
Date Tue, 22 Aug 2006 11:23:03 GMT
Thank you! It works.
  

Antoine Levy-Lambert <antoine@gmx.de> wrote:
  Hello Hans,

add this to your code :
r.getProject().addBuildListener(createLogger());
private static BuildLogger createLogger() {
BuildLogger logger = null;
logger = new DefaultLogger();
logger.setMessageOutputLevel(Project.MSG_VERBOSE);
logger.setOutputPrintStream(System.out);
logger.setErrorPrintStream(System.err);
logger.setEmacsMode(false);
return logger;
}
Regards,
Antoine



On Aug 22, 2006, at 10:58 AM, Hans Schwaebli wrote:

> I am using some Ant tasks programatically like:
> ReplaceRegExp r = new ReplaceRegExp();
> r.setProject(new Project());
> r.setFile(file);
> r.setFlags("");
> r.setMatch(removal);
> r.setReplace("-- removed line");
> r.execute();
>
> How can I enable logging? If I execute the program, which uses 
> these lines above, the task works but I don't see any logging on 
> the console.
>



 		
---------------------------------
Stay in the know. Pulse on the new Yahoo.com.  Check it out. 
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message