Just thinking ... - redirecting output of exec into logfiles <exec ex="comp1" output="comp1.out" error="comp1.err"/> - maybe appending the program name to logfiles <echo message="Log from comp1" append="true" file="comp1.out"/> <echo message="Log from comp1" append="true" file="comp1.err"/> - copying logfiles with error into extra directory <copy><selector><contains> - merging the logfiles <concat> ???
Jan >-----Ursprüngliche Nachricht----- >Von: James Oltmans [mailto:[EMAIL PROTECTED] >Gesendet: Mittwoch, 20. Juni 2007 00:14 >An: user@ant.apache.org >Betreff: Processing Ant log files > >Hello all, > > > >I have a problem that I am not sure if ant has a built in method for >handling. I would like to process log files for errors, warnings and >possible system levels messages. The log is being generated by ant but >the echoed output is produced by a legacy system (hence why I >can't just >use a premade task to find all these errors). The errors and warnings >can be 1-50 lines in length. I believe it would be best to parse for >these errors using regexes. It appears that filterchain filters are >geared towards single line applications only. > > > >For example I would like to take the following: > > [exec] >------------------------------------------------------------ > > [exec] COMPILE PROGRAM_A > > > > [exec] Compiling PROGRAM_A > > [exec] compilation finished > > [exec] SUCCESS compiling PROGRAM_A > > [exec] >------------------------------------------------------------ > > > > > > [exec] >------------------------------------------------------------ > > [exec] COMPILE PROGRAM_B > > > > [exec] Compiling PROGRAM_B > > [exec] main program: syntax error at or before > > [exec] <line 23> ...PWR = "This program, dependent files and >dependent facilities is" > > [exec] >--------------------------------------------------------------- >------^Ex >pecting: end-of-file,END > > > > [exec] compilation failed > > [exec] FAILURE compiling PROGRAM_B > > [exec] >------------------------------------------------------------ > > > >And take just the second compilation's output and create a report of >build failures/warnings. > > > >I would like to grab all the compilation failures and other system >failures that occur in the build and include them in a build report >email. Here is my desired output for inclusion in the build report >email: > >Compile failures: > > Compiling PROGRAM_B > > main program: syntax error at or before > > <line 23> ...PWR = "This program, dependent files and dependent >facilities is" > > >--------------------------------------------------------------- >------^Ex >pecting: end-of-file,END > > compilation failed > > > >In order to do this I would have to capture all or most of the text >between the two [exec] ---------------------------------------------- >lines (also note that the errors could be any length so any assumptions >about the number of lines would be insufficient). Is there an >ant native >function or a 3rd party open-source or 3rd party products that can >process log files in this way or should I consider creating a custom >task or custom filterreader? > > > >If your recommendation is a filterreader, what's a good example to >follow? > > > >James Oltmans >SCM Administrator > >Bolo Systems, Inc. >[EMAIL PROTECTED] > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]