ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian O'Halloran" <bohallo...@reference-info.com>
Subject Re: ant MSG_ERR does not appear to be generated
Date Tue, 30 Dec 2003 00:04:39 GMT
Peter -- I think I understand, however I'm still a little confused and
unable to find a way to trap an event at error level.  Attached is some
simple code to illustrate my example.

To run, first compile Listner.java and then run as "ant -listener
Listener", this should generate a compile error, which should in turn
generate a Project.MSG_ERR == 0.

Examine the generated file "testlistener.txt", there are no entries for
"0".

Can you please confirm my findings.  Any thoughts on how to trap an
event at error level?

Am I confusing Project.MSG_ERR with "event at error level"?

Thanks,
Brian 

On Mon, 2003-12-29 at 10:19, Peter Reilly wrote:
> This was changed in ant 1.6.0.
> 
> The problem was that the event priority of std error has been changed
> from err to warning as sometimes it was output at error level and
> sometimes it was output at warning level (when fork or exec was used).
> 
> There should still be an event at error level:
> ant -find compile.xml -logger org.apache.tools.ant.XmlLogger
> 
> generates the following:
>  <build time="1 second" error="/home/preilly/learning/ant/compile.xml:3: 
> Compile failed; see the compiler error output for details.">
>     <task name="mkdir" 
> location="/home/preilly/learning/ant/compile.xml:2: " time="0 
> seconds"></task>
>     <task name="javac" 
> location="/home/preilly/learning/ant/compile.xml:3: " tim
> ......
> 
> Peter
> Brian O'Halloran wrote:
> 
> >I recently converted to ant 1.6.0 from 1.5.4.
> >
> >Part of our build process writes build PASS/FAIL to a postgresql db.
> >
> >I have implemented an ant listener that looks at logged messages and
> >determines if any errors occur during the build;
> >
> >    public void messageLogged(BuildEvent event) {
> >
> >        // check all messages for build errors
> >        if(event.getPriority() == Project.MSG_ERR)
> >            buildStatus = "F";
> >
> >    }
> >
> >When I invoke ant with -listener and there are javac compile errors, I
> >find that event.getPriority() never sees any MSG_ERR type messages.
> >
> >I'm mostly seeing MSG_VERBOSE and MSG_DEBUG with a much smaller number
> >of MSG_WARN and MSG_INFO, but never any MSG_ERR.
> >
> >With ant 1.5.4 MSG_ERR would always be generated with a javac compile
> >error.
> >
> >Anyone else seeing this behaviour with 1.6.0?  Should I be looking for
> >errors by some other mechanism?
> >
> >Brian O'Halloran
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

Mime
View raw message