package nl.github.martijn9612.fishy;

import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by martijn on 17-9-15.
 */
public class ActionLogger {
    private static FileWriter fileWriter;
    private static SimpleDateFormat dateFormat = new SimpleDateFormat();

    ActionLogger() {
        try {
            fileWriter = new FileWriter("log.txt", false);
        } catch (Exception e) {
            System.out.println(e.toString());
        }
    }

    public void logLine(String text, String className) {
        try {
            fileWriter.write("[ " + getTimeStamp() + "] - " + text + " - " + className + "\n");
        } catch (IOException e) {
            System.out.println("Unable to log to file!");
            e.printStackTrace();
        }
    }

    public void logLine(String text, String className, boolean isError) {
        try {
            if (isError) {
                fileWriter.write("[ERROR!][ " + getTimeStamp() + "] - " + text + " - " + className + "\n");
            } else {
                logLine(text, className);
            }
        } catch (IOException e) {
            System.out.println("Unable to log to file!");
            e.printStackTrace();
        }
    }

    public void close() {
        try {
            fileWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private String getTimeStamp() {
        return dateFormat.format(new Date());
    }
}

@@ -156,38 +156,71 @@
 %0A * 
-Created by martijn on 17-9-15.
+This class logs to a file to observe the behaviour of a program
 %0A */
@@ -360,16 +360,41 @@
 eFormat(
+%22yyyy-MM-dd HH:mm:ss.SSS%22
 );%0A%0A    
@@ -570,32 +570,170 @@
        %7D%0A    %7D%0A%0A
+    /**%0A     * Logs one line to file to log in.%0A     * @param text Text to log%0A     * @param className Class the log is called in%0A     */%0A
     public void 
@@ -1017,32 +1017,234 @@
        %7D%0A    %7D%0A%0A
+    /**%0A     * Logs one line to file to log in.%0A     * @param text Text to log%0A     * @param className Class the log is called in%0A     * @param isError Adds additional error text if set to true%0A     */%0A
     public void 
@@ -1665,24 +1665,133 @@
    %7D%0A    %7D%0A%0A
+    /**%0A     * Closes the filewriter so that the lines are written, otherwise all the logs are lost.%0A     */%0A
     public v
@@ -1930,24 +1930,153 @@
    %7D%0A    %7D%0A%0A
+    /**%0A     * Gets the current time to specify the moment the log was made.%0A     * @return String with the current time%0A     */%0A
     private 

Add Logging With Seconds & Add Documentation <feature,documentation