ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: How to enable logging when using Ant programatically?
Date Tue, 22 Aug 2006 10:54:06 GMT
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.
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message