ILogger


package comp314.interfaces;

import java.io.IOException;

/** Interface for logging classes.
 * 
 * @author David Goodwin, Daniel Buchanan
 */
public interface ILogger {

    /** The log entries severity level.
     * 
     */
    public enum Severity {Notice, Debug, Warning, Error, Failure};
    
    /** Opens the log file for input.
     * @param filename The output file for logging.
     */
    void open(String filename) throws IOException;
    
    /** Closes any open log files.
     */
    void close() throws IOException;
    
    /** Writes a message to the log file using the Notice severity.
     * @param message The message to write to the log file.
     */
    void writeLine(String message);
    
    /** Writes an entry to the log file using the specified severity. This can
     * throw exceptions
     * @param sv Log entry severity
     * @param message Log message
     */
    void writeLineE(Severity sv, String message) throws IOException;

    /** Performs the same job as WriteLineE except does not throw any exceptions.
     * 
     * @param sv Severity Level
     * @param message Log Message
     */
    void writeLine(Severity sv, String message);
    
    /** Returns the String representation of the specified Severity Level. This
     * is the String representation used by the log output.
     * @param sv The severity level
     * @return The string representation of the given Severity Level.
     */
    String svToString(Severity sv);
}



David Goodwin 2008-10-21