Skip to content

Commit

Permalink
enhanced output handling ins tatistics output
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinStyk committed May 3, 2016
1 parent 73c5f08 commit 7620465
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,13 @@ public static void toJson(ComparisonResult data, File outputDirectory) {
* Name is specified in parameted
*
* @param data
* @param outputFile file to save output
* @param outputFile directory to save output
*/
public static void toJson(OverallStatistics data, File outputFile) {

if (!outputFile.exists()) {
try {
outputFile.createNewFile();
logger.info("Creating overall stats file " + outputFile.getName());
} catch (IOException e) {
logger.error("Error creating output file");
}

outputFile.mkdirs();
logger.info("Creating overall stats directory " + outputFile.getName());
}
if(outputFile.isDirectory()){
File outputDirectory = outputFile;
Expand All @@ -250,7 +245,7 @@ public static void toJson(OverallStatistics data, File outputFile) {
logger.info("Writting overal statistics to file " + outputFile.getAbsolutePath());

} catch (IOException e) {
logger.error("Error saving file to " + outputFile.getName());
logger.error("Error saving file to " + outputFile.getName() + " " + e.toString());
} finally {
if (writer != null) {
try {
Expand Down

0 comments on commit 7620465

Please sign in to comment.