@@ -0,0 +1,1285 @@
+package com.binghamton.jhelp.util;%0A%0Aimport java.io.File;%0Aimport java.io.FileNotFoundException;%0Aimport java.io.FileWriter;%0Aimport java.io.PrintWriter;%0A%0A/**%0A * A utility class providing static method for logging to file%0A */%0Apublic class Logger %7B%0A    private static String logName = %22log.txt%22;%0A    private static PrintWriter writer;%0A%0A    static %7B%0A        try %7B%0A            writer = new PrintWriter(new File(logName));%0A        %7D catch(FileNotFoundException e) %7B%0A            System.err.println(%22could not initialize log file, exiting...%22);%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A    /**%0A     * Logs a message to the log file%0A     * @param msg the message to log%0A     */%0A    public static void log(String msg) %7B%0A        writer.write(msg);%0A    %7D%0A%0A    /**%0A     * Logs a message and a newline to the log file%0A     * @param msg the message to log%0A     */%0A    public static void logln(String msg) %7B%0A        writer.write(msg);%0A        writer.write(%22%5Cn%22);%0A    %7D%0A%0A    /**%0A     * Logs an Exception's stack trace to the log file%0A     * @param e the Exception to log%0A     */%0A    public static void log(Exception e) %7B%0A        e.printStackTrace(writer);%0A    %7D%0A%0A    /**%0A     * Closes the log file%0A     */%0A    public static void close() %7B%0A        writer.flush();%0A        writer.close();%0A    %7D%0A%7D%0A

add logger