ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Why does the echo task output to System.out? (Was: RE: [submi t] I ntegration of Ant into Visual Age for Java)
Date Mon, 20 Nov 2000 08:50:36 GMT
Simeon Fitch <> wrote:

> --- Jose  Alberto Fernandez <> wrote:
>> So the above is equivalent to:
>>  <echo message="my message" output="myfile" loglevel="warn" />
>> how do I say just write this to the file!!!
> You don't.

This is taking away part of <echo>'s functionality. The output
attribute has been added to <echo> to have a simple means of writing
files from inside the build file. This use case is in no way connected
to logging at all.

> I think all messages should be available to any listener who wishes
> to processes it. I don't think there should be any message hidden
> from the build listeners.

But if you specify outfile, you want to write to a file, you don't
intend to log messages. It's some kind of poor man's editor, similar
to using echo in shell scripts and batch files.

>> Every time people clump together to different tasks into one just
>> because it is easy, I looks to me like a hack.
> I think that is unfair, as I'm not proposing it becuase it is
> "easy". I happen to think it's desireable behavior.

In a sense both of you are right. The echo implementation we have now
is somewhat similar to /bin/sh's echo builtin or the one of
COMMAND.COM (or is this really an executable of its own?).

It would probably be cleaner to have two separate tasks, one for
writing text - maybe redirecting it to a file - and one for writing
log messages. I'm just not sure, which of both would deserve the name

If we keep them as one task (which might be easiest for new users, I'm
not sure) maybe we should say you can either specify outfile or
loglevel, but not both of them? If you don't specify outfile we use
the logging system, if you do we'll write to the file.


View raw message