show log file contents when verification fails

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163408 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-02-24 05:39:31 +00:00
parent ec28b6ed8f
commit d11e81173b
1 changed files with 23 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Writer;
import java.net.URL;
@ -370,6 +371,26 @@ public class Verifier
}
}
private void displayLogFile()
{
System.out.println( "Log file contents:" );
try
{
BufferedReader reader = new BufferedReader( new FileReader( new File( basedir, "log.txt" ) ) );
String line = reader.readLine();
while ( line != null )
{
System.out.println( line );
line = reader.readLine();
}
reader.close();
}
catch ( IOException e )
{
System.err.println( "Error: " + e );
}
}
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
@ -434,6 +455,8 @@ public class Verifier
e.printStackTrace();
verifier.displayLogFile();
exitCode = 1;
}
}