sdsu.logging
Class LoggerImplementation

java.lang.Object
  |
  +--sdsu.logging.LoggerImplementation
Direct Known Subclasses:
NullLogger, SelectiveLogger

public abstract class LoggerImplementation
extends java.lang.Object

This is the abstract class for all logging classes in sdsu.logging. It defines a system for logging usage of programs. The only reason to use this class is to create a new logger implementation. To create a new logger implementation you need to: implement the public static method register() and the protected method processLogRequest( LoggerMessage ). The register method needs to create an instance of the logger, register it with the class Logger by calling Logger.register(), and return the logger instance. The processLogRequest method handles the actual processing of the message. You can overload this method based on the type of message. Note that Logger calls the method log( LoggerMessage ), which calls processLogRequest. This level of indirection is used by SelectiveLogger to filter log requests before they get to the actual logger.

The logging system is based on the logging pattern by Neil Harrison in Pattern Languages of Program Design 3 Eds Martin, Riehle, Buschman, 1998, pp 277-289.

Version:
1.0 18 January 1998
Author:
Roger Whitney (whitney@cs.sdsu.edu)
See Also:
LogMessage, , ,

Constructor Summary
LoggerImplementation()
           
 
Method Summary
 void log(LoggerMessage message)
          Add the LoggerMessage object to the log.
static LoggerImplementation register()
          All subclass must implement this method.
 void reset()
          Resets logger.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerImplementation

public LoggerImplementation()
Method Detail

register

public static LoggerImplementation register()
All subclass must implement this method. The method should create an instance, register it with the Logger class by using Logger.register( ). Note the compiler does not force you to implement this method, but still do so.

log

public void log(LoggerMessage message)
Add the LoggerMessage object to the log.

reset

public void reset()
Resets logger. Suclasses define what this means. Not normally part of a logging system. This will allow log servers to rest log files for students that may not have direct access to the log file.