All Packages Class Hierarchy This Package Previous Next Index
Class sdsu.logging.LoggerMessage
java.lang.Object
|
+----sdsu.logging.LoggerMessage
- public abstract class LoggerMessage
- extends Object
- implements Stringizable, Serializable
LoggerMessage and its subclasses are used by sdsu.logging.Logger.
You only need to use this class directly when you are adding
a new type of message to the logger. To create a new message type
create a new subclass of this class. Pass the actual text of the
message as an argument to the constructor of this class. Subclasses must
implement the method getMessageType(). You also
may wish to override the displayString saveString methods
if you wish a different
display output for your new message type.
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 3 January 1998
- Author:
- Roger Whitney
(whitney@cs.sdsu.edu)
- See Also:
- Logger, DebugMessage
-
LoggerMessage(String)
-
-
displayString()
- Displays a string to be displayed on the screen for this message.
-
fromString(String)
- Converts a string to an object.
-
getMessageType()
- Returns the type of the message.
-
getMetaData()
- MetaData for Message contains key-value pair
"class=objectClassName".
-
logString()
- Displays a string to be saved in a log for this message.
-
setMetaData(LabeledData)
- Required by Stringizable.
-
toString()
- Used in sending message to remote loggers.
-
toString(String)
- Converts the object to a string with given header information.
LoggerMessage
public LoggerMessage(String message)
getMessageType
public abstract String getMessageType()
- Returns the type of the message.
fromString
public void fromString(String objectString) throws ConversionException
- Converts a string to an object. Used in sending message
to remote loggers.
- Throws: ConversionException
- If there is a problem
converting to object.
setMetaData
public void setMetaData(LabeledData metaData)
- Required by Stringizable. Messages does not require
metadata internally.
getMetaData
public LabeledData getMetaData()
- MetaData for Message contains key-value pair
"class=objectClassName".
Used to recreate proper message object by remote loggers.
toString
public String toString()
- Used in sending message to remote loggers.
- Overrides:
- toString in class Object
toString
public String toString(String header)
- Converts the object to a string with given header information.
Used in sending message to remote loggers.
displayString
public String displayString()
- Displays a string to be displayed on the screen for this message.
logString
public String logString()
- Displays a string to be saved in a log for this message.
All Packages Class Hierarchy This Package Previous Next Index