You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tennis Smith <te...@tripit.com> on 2009/07/27 21:47:35 UTC

Logging Errors From Text Files

Hi,

I have some tests that send output to plain text files.  Its easy to spot
errors in the files by simply doing something like:
        <fileset id="error.files"
                 dir="${build.results}"
                 includes="**/*.txt">
            <or>
                <contains text="Fatal error" casesensitive="yes"/>
                <contains text="SQLException" casesensitive="yes"/>
            </or>
        </fileset>

What I cannot figure out, is how to log something that would identify
exactly what the error is, and where it was found.
For example, assuming the string "Fatal error" is found, how can I generate
a message in the log like:
ERROR: Fatal error found in file foo.txt line 20!

Tks,
-T