/** Returns the log file path. */ File trialOutputFile() { checkOpened(); return file; } }
/** * Logs a line of output to the logger. * * @param source The source of the line (e.g. 'stderr') * @param line The output */ void log(String source, String line) { checkOpened(); writer.printf("[%s] %s%n", source, line); }
/** Prints header information to the file. */ void printHeader() { checkOpened(); // make the file self describing // TODO(lukes): we could print the command line here. The user wouldn't be able to run it again // since there would be no runner sending continue messages, but it might be useful to debug // classpath issues. writer.println("Trial Number: " + trialNumber); writer.println("Trial Id: " + trialId); writer.println("Experiment: " + experiment); writer.println(); }
/** Marks the log file so that it will not be deleted at the end of the benchmark. */ void ensureFileIsSaved() { checkOpened(); outputManager.persistFile(file); }