You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by William Ferguson <wi...@mincom.com> on 2000/07/14 01:10:36 UTC

Spurious Output

Hi all,

I was wondering what is the typical approach to removing spurious output
from the build?
Ie If I have a Task that generates lots of output (and I can't hack the
Task) how do people quench/redirect that output?

In our case we have a 3rd party java class that generates classes to
read xml, but it generates hugs amounts of typically uninteresting
output.


William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


Re: Spurious Output

Posted by Ken Wood <kw...@i2.com>.
I pipe the output through a filter, 'grep' if it's simple, 'perl'
if it's messy.

William Ferguson wrote:

> Hi all,
>
> I was wondering what is the typical approach to removing spurious output
> from the build?
> Ie If I have a Task that generates lots of output (and I can't hack the
> Task) how do people quench/redirect that output?
>
> In our case we have a 3rd party java class that generates classes to
> read xml, but it generates hugs amounts of typically uninteresting
> output.
>
> William Ferguson
>
> This transmission is for the intended addressee only and is confidential
> information. If you have received this transmission in error, please
> delete it and notify the sender. The contents of this E-mail are the
> opinion of the writer only and are not endorsed by Mincom Limited unless
> expressly stated otherwise.


Re: Spurious Output

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "CM" == Conor MacNeill <co...@cortexebusiness.com.au> writes:

 CM> I am considering introducing task level and/or target level
 CM> logging.  Something like

 CM> <noisytask loglevel="quiet" ...>

This has been proposed before (and I forgot about it after we changed
the logging to use BuildEvents). Now that logging happens on task
level this should be straight forward to implement - go for it after
the release.

Stefan

Re: Spurious Output

Posted by Tom Cook <tc...@ardec.com.au>.
donaldp@mad.scientist.com writes:
 > I can send you the .el file if you want :P. Basically the

Yes, please!

Regards
Tom
-- 
Tom Cook - Software Engineer

"The brain is a wonderful organ. It starts functioning the moment you get
up in the morning, and does not stop until you get into the office."
	- Robert Frost

LISAcorp - www.lisa.com.au

--------------------------------------------------
38 Greenhill Rd.          Level 3, 228 Pitt Street
Wayville, SA, 5034        Sydney, NSW, 2000

Phone:   +61 8 8272 1555  Phone:   +61 2 9283 0877
Fax:     +61 8 8271 1199  Fax:     +61 2 9283 0866
--------------------------------------------------

Re: Ant + Emacs compilation mode (elisp code provided)

Posted by Barrie Treloar <Ba...@camtech.com.au>.
On 20 Jul 2000, Stefan Bodewig wrote:

> >>>>> "BT" == Barrie Treloar <Ba...@camtech.com.au> writes:
> 
>  BT> The other problem was that compilation-error-regexp-alist is
>  BT> buffer local so the add-list modifies the global value and the
>  BT> local value stays unchanged.
> 
> I thought this would be a transient XEmacs problem (I've already filed
> a bug report) because other people could not reproduce my
> problems. Why did you drop the column part?

Because the Javac task doesn't generate a column value and I couldn't
figure out how to make it the matching on the column part optional so
it still works if its not there :) 

You might be able to do it by adding \\(:\\([0-9]+\\)\\)?
So the regexp becomes:

             '("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\)\\(:\\([0-9]+\\)\\)?:" 1 2 4))

But since suns jdk doesn't generate the column value I can't test it.
If someone wants to add that in and repost I wont complain.

Barrie
--
Barrie Treloar
____________________________________________________________________

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email: barrie@camtech.com.au
  Camtech (SA) Pty Ltd                http://www.camtech.com.au
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________



Re: Ant + Emacs compilation mode (elisp code provided)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "BT" == Barrie Treloar <Ba...@camtech.com.au> writes:

 BT> The other problem was that compilation-error-regexp-alist is
 BT> buffer local so the add-list modifies the global value and the
 BT> local value stays unchanged.

I thought this would be a transient XEmacs problem (I've already filed
a bug report) because other people could not reproduce my
problems. Why did you drop the column part?

Thanks for the elisp part, I'm going to try it.

Stefan

Ant + Emacs compilation mode (elisp code provided)

Posted by Barrie Treloar <Ba...@camtech.com.au>.
On 17 Jul 2000, Stefan Bodewig wrote:

> (add-hook 'compilation-mode-hook
>      '(lambda ()
>         (add-to-list 'compilation-error-regexp-alist
>                      '("^\\s-*\\[[^\\]]\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:$" 1 2 3))))
> 
> Should work - more or less untested - doesn't it?

Nope :( Its been too long since I last hacked elisp and this took way
longer that it was supposed to :)  I've also dropped the column index
from my regular expression.

The other problem was that compilation-error-regexp-alist is buffer
local so the add-list modifies the global value and the local value
stays unchanged.  If you kill the compilation buffer then it will take
its value from the global one.  The only way I could figure out to
override the default is to load the compile module so I could access
the variable's value and make the modification there.

Hope this is of help, dump it into your ~/.emacs file.

;; Compilation Mode
;; to allow it to understand ant's output
;; (for regular expression help) http://www.delorie.com/gnu/docs/elisp-manual-20/elisp_546.html
(load "compile")
(setq compile-command "ant")
(add-to-list 'compilation-error-regexp-alist 
             '("^\\s-*\\[[^]]*\\]\\s-*\\(.+\\):\\([0-9]+\\):" 1 2))


Barrie
--
Barrie Treloar
____________________________________________________________________

  Barrie Treloar                      Phone: +61 8 8303 3300
  Senior Analyst/Programmer           Fax:   +61 8 8303 4403 
  Electronic Commerce Division        Email: barrie@camtech.com.au
  Camtech (SA) Pty Ltd                http://www.camtech.com.au
 --- Level 8, 10 Pulteney Street, Adelaide SA 5000, Australia. ---
____________________________________________________________________



Re: Spurious Output

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "pd" == donaldp  <do...@mad.scientist.com> writes:

 PD> * emacs-friendly output (ie never decided upon method)
 >>  I didn't understand your problems - but I haven't tricked JDE
 >> into using Ant for building projects yet, so I'm still running ant
 >> from outside of my XEmacs.

 pd> I can send you the .el file if you want :P.

Let's swap 8^). XEmacs doesn't grok Jikes error messages unless I tell
it how to parse them anyway:
 
(add-hook 'compilation-mode-hook
     '(lambda ()
        (add-to-list 'compilation-error-regexp-alist
                     '("^\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:$" 1 2 3))))

including the task stuff that would be:

(add-hook 'compilation-mode-hook
     '(lambda ()
        (add-to-list 'compilation-error-regexp-alist
                     '("^\\s-*\\[[^\\]]\\]\\s-*\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[0-9]+:[0-9]+:$" 1 2 3))))

Should work - more or less untested - doesn't it?

Stefan

RE: Spurious Output

Posted by Conor MacNeill <co...@m64.com>.
> >  PD> * emacs-friendly output (ie never decided upon method)
> >
> > I didn't understand your problems - but I haven't tricked JDE into
> > using Ant for building projects yet, so I'm still running ant from
> > outside of my XEmacs.
>
> I can send you the .el file if you want :P. Basically the
> problem is that default logger adds "\t[taskname]" to output
> from any tasks. Usually emacs is able to pass jikes error
> messages but because of that prefix emacs doesn't recognize
> it as an error. In all my versions I just comment out that
> evil bit of code so I can automatically go to line where
> errior occurs. Much betterer :P
>
Pete,

Did you express your preference for fixing this. I think the choices are
1. An ant argument which modifies the behaviour of the default logger

ant -emacs

2. The ability to replace the default logger with a different logger.

ant -logger blah.EmacsFriendlyLogger

The distinction between -logger and -listener is that -logger implies the
right to write to standard out (or -logfile).

Conor


Re: Spurious Output

Posted by do...@mad.scientist.com.
On 17 Jul 2000, Stefan Bodewig wrote:
>  PD> * logging that suppresses output unless a task fails-
>  PD> and will then log all output of said task 
> 
> I must have missed (or forgotten) that one.

hmmm - maybe I didn't pass on that one - a few people
complained to me on another list and I proposed that and
they said that would fix problem. It could be I never passed
on the message :P

>  PD> * emacs-friendly output (ie never decided upon method)
> 
> I didn't understand your problems - but I haven't tricked JDE into
> using Ant for building projects yet, so I'm still running ant from
> outside of my XEmacs.

I can send you the .el file if you want :P. Basically the
problem is that default logger adds "\t[taskname]" to output
from any tasks. Usually emacs is able to pass jikes error
messages but because of that prefix emacs doesn't recognize
it as an error. In all my versions I just comment out that
evil bit of code so I can automatically go to line where
errior occurs. Much betterer :P


Cheers,

Pete

*--------------------------------------------------*
| Latrobe University,     |                        |
| Bundoora, Australia     | Does the name 'Pavlov' |
| Office: PW220           |    ring a bell ?       |
| Ex: 2503                |                        |
*--------------------------------------------------*



Re: Spurious Output

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "PD" == Peter Donald <do...@mad.scientist.com> writes:

 PD> * task specific logging (like what you want)

Both, with regard to the logging level and the output file. The first
one should be easy to implement, I'm not sure if I like the second.

 PD> * logging that suppresses output unless a task fails -
 PD> and will then log all output of said task 

I must have missed (or forgotten) that one.

 PD> * emacs-friendly output (ie never decided upon method)

I didn't understand your problems - but I haven't tricked JDE into
using Ant for building projects yet, so I'm still running ant from
outside of my XEmacs.

 PD> * logging to file/mail/whatever 
 PD> * logs sent to email on fail

Should be easy to implement using custom loggers - the required
functionality in Ant's core is already there.

Stefan

RE: Spurious Output

Posted by Jimmy Sieben <ji...@utdallas.edu>.
At 08:55 PM 7/16/2000, you wrote:
>I don't believe there was any final decision on logging as such but I
>believe the following features were requested (and thus will probably make
>it).
>
>* task specific logging (like what you want)
>* task output format changes (already done/possible via different loggers
>like XmlLogger)
>* logging that suppresses output unless a task fails - and will then log
>all output of said task (I am not sure if anything was done about this)
>* emacs-friendly output (ie never decided upon method)
>* logging to file/mail/whatever
>* logs sent to email on fail

         These are very interesting ideas for me; something I think I am 
definitely interested in looking into (especially the emacs-compliant 
logger. Not being emacs compliant is a big sign saying "FIX ME FIX ME" to 
me every time I fire up ant :) That said, I would really like to look into 
implementing some of these after the release.
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+
| Jimmy Sieben <> jimmys@utdallas.edu <> EvlG@IRC <> Young Game Designer |
| ICQ UIN: 650255 <> Most things suck, thats what makes some things rock |
| Homepage: http://www.utdallas.edu/~jimmys/                             |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=+


RE: Spurious Output

Posted by Peter Donald <do...@mad.scientist.com>.
At 11:02  17/7/00 +1000, you wrote:
>Conor,
>
>I must have missed the initial discussion about task level logging.
>Could you explain how you envisioned it working in the scenario I
>outlined?
>ie (Could it)/(how would it) redirect/quench any output from some task?

I don't believe there was any final decision on logging as such but I
believe the following features were requested (and thus will probably make
it).

* task specific logging (like what you want)
* task output format changes (already done/possible via different loggers
like XmlLogger)
* logging that suppresses output unless a task fails - and will then log
all output of said task (I am not sure if anything was done about this)
* emacs-friendly output (ie never decided upon method)
* logging to file/mail/whatever
* logs sent to email on fail 

...
hmmm I believe there was more requests but my memory fails me :P




Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

RE: Spurious Output

Posted by William Ferguson <wi...@mincom.com>.
Conor,

I must have missed the initial discussion about task level logging.
Could you explain how you envisioned it working in the scenario I
outlined?
ie (Could it)/(how would it) redirect/quench any output from some task?

William Ferguson

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this E-mail are the
opinion of the writer only and are not endorsed by Mincom Limited unless
expressly stated otherwise.


> -----Original Message-----
> From: Conor MacNeill [mailto:conor@cortexebusiness.com.au]
> Sent: Friday, 14 July 2000 9:32
> To: ant-dev@jakarta.apache.org
> Subject: RE: Spurious Output
>
>
> > -----Original Message-----
> > From: William Ferguson [mailto:williamf@mincom.com]
> > Sent: Friday, 14 July 2000 9:11
> > To: ant-dev@jakarta.apache.org
> > Subject: Spurious Output
> >
> >
> > Hi all,
> >
> > I was wondering what is the typical approach to removing
> spurious output
> > from the build?
> > Ie If I have a Task that generates lots of output (and I
> can't hack the
> > Task) how do people quench/redirect that output?
> >
> > In our case we have a 3rd party java class that generates classes to
> > read xml, but it generates hugs amounts of typically uninteresting
> > output.
> >
>
> I am considering introducing task level and/or target level logging.
> Something like
>
> <noisytask loglevel="quiet" ...>
>
> What do people think about that?
>
> Conor
>


RE: Spurious Output

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
> -----Original Message-----
> From: William Ferguson [mailto:williamf@mincom.com]
> Sent: Friday, 14 July 2000 9:11
> To: ant-dev@jakarta.apache.org
> Subject: Spurious Output
>
>
> Hi all,
>
> I was wondering what is the typical approach to removing spurious output
> from the build?
> Ie If I have a Task that generates lots of output (and I can't hack the
> Task) how do people quench/redirect that output?
>
> In our case we have a 3rd party java class that generates classes to
> read xml, but it generates hugs amounts of typically uninteresting
> output.
>

I am considering introducing task level and/or target level logging.
Something like

<noisytask loglevel="quiet" ...>

What do people think about that?

Conor