[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.jdt] Re: Ant and logging in headless mode
|
Laszlo Benedek wrote:
> Laszlo Benedek wrote:
>
>> Thomas Friese wrote:
>>
>>> Laszlo Benedek wrote:
>>>
>>>> I have a headless application that invokes an Ant script thorough the
>>>> org.eclipse.ant.core.AntRunner class.
>>>> The System.out messages coming from my Ant script don't show up in the
>>>> console (dos prompt). The same messages do show up if I run the script
>>>> within the Eclipse UI (without AntRunner).
>>>>
>>>> Does anyone know why ?
>>>
>>>
>>> Do you invoke
>>>
>>> eclipse.exe -application ...
>>>
>>> or
>>>
>>> java -jar startup.jar -application ...
>>>
>>> Do you specifically set a logger with AntRunner.addBuildLogger() - e.g.
>>> the org.apache.tools.ant.DefaultLogger?
>>>
>>> Thomas
>>
>>
>> Yep, that was it. I added the line
>> AntRunner.addBuildLogger("org.apache.tools.ant.DefaultLogger") and now
>> the System.out show up in the console.
>> Thanks.
>
>
> Hmm, after paying attention to the output, I've noticed that the
> messages are still not showing up.
> I have a bunch of other messages among which the Ant ones suppose to
> appear, and that made me think it worked.
> Sorry for the confusion.
> So, going back to your question.
> I'm using "java -jar startup.jar -application ..." to start the
> application. Now I'm setting the logger,
> AntRunner.addBuildLogger("org.apache.tools.ant.DefaultLogger")
> but still nothing.
Then at least the eclipse.exe java starter does not hide&drop the
messages...
Still, your problem beats me. I have a headless application that uses
System.out to print own messages and runs an ant script via AntRunner,
echo and output messages from the script show up using
antRunner.addBuildLogger("...DefaultLogger").
Then I have the headless application wrapped in my own ant task. Running
a build file using this custom ant task with the antRunner application
from the command line shows output from the outer script, the task, the
headless application and the inner scripts without a problem...
(I'm using Eclipse 3.1.2) What you do should work as well (probably set
up a very small test for your situation?)...
Thomas