01: package net.javacoding.jspider.core.logging.impl;
02:
03: import net.javacoding.jspider.core.logging.Log;
04:
05: /**
06: * Base implementation of a logger. It contains a template method
07: * that allows concrete subclasses to do the real logging work.
08: *
09: * $Id: BaseLogImpl.java,v 1.2 2003/03/27 17:44:04 vanrogu Exp $
10: *
11: * @author Günther Van Roey
12: */
13: public abstract class BaseLogImpl implements Log {
14:
15: /**
16: * Log method.
17: * @param type the type of logging
18: * @param message the message to be logged
19: */
20: public void log(int type, String message) {
21: doLog("[LOG] " + message);
22: }
23:
24: /**
25: * Logs a message.
26: * @param type type of the log
27: * @param object object of which the toString ( ) will be logged
28: */
29: public void log(int type, Object object) {
30: log(type, "" + object);
31: }
32:
33: /**
34: * Worker method that will do the real logging.
35: * @param message formatted message to be logged
36: */
37: public abstract void doLog(String message);
38:
39: }
|