Beispiel #1
0
  public Logger(String filename) throws FileNotFoundException, IOException {
    // ps = new PrintStream(new FileOutputStream(new File(filename)));
    File f = new File(filename);
    fos = new FileOutputStream(f);
    ps = new PrintStream(fos);
    ps.println("Logging started");
    ps.flush();

    sw = new Stopwatch();
    sw.reset();
  }
Beispiel #2
0
 public void log(String s) {
   ps.println(sw.elapsed() + ": " + s);
   ps.flush();
 }
Beispiel #3
0
 public void close() throws IOException {
   ps.flush();
   ps.close();
   fos.flush();
   fos.close();
 }