public void writeLn(String line){
        try {
            writer.println(line);
            writer.flush();
        } catch (Exception e){
            log.writeErr("Could not write to file.\nFile: " + file.getAbsolutePath() + "\nError was: " + e);
            //close();
        }
    }