|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.generic.Log
org.peace_tools.generic.UserLog
public class UserLog
Top-level logging class for creating user logs.
The UserLog provides a convenient mechanism the GUI system to log relevant information at various levels of severity. This log is essentially used to provide the user with useful information. Note that this class is a centralized class for merely recording the logs (and not viewing/seeing) the logs. The logs are viewed/shown by the UserLogPane which constitutes the "View" as in the Model-View-Controller (MVC) pattern. This class represents the "Model" in the MVC pattern while the top-level frame that contains the UserLogPane serves as the controller.
Since the UserLog serves as an centralized location for cutting logs relevant/useful to the user, there is only one unique instance of this class in the GUI system. In order to enforce this property, this class has been designed as a Singleton pattern -- that is, this class cannot be directly instantiated. Instead the getLog() static method must be used to refer to the globally unique instance of this class. On the other the convenient, static log() method can be used to directly cut log entries.Note:Logs for programming aids and debugging (that would be pertinent for a programmer to view and understand) must be generated in the free form ProgrammerLog and not in the UserLog.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.peace_tools.generic.Log |
---|
Log.LogLevel |
Field Summary | |
---|---|
private javax.swing.table.DefaultTableModel |
logEntries
This instance variable holds all the user logs that have been generated thus far via the log() method in this class. |
private static UserLog |
userLog
The globally unique instance of the UserLog. |
Fields inherited from class org.peace_tools.generic.Log |
---|
currentLogLevel, listeners, logFile, logFileName |
Constructor Summary | |
---|---|
private |
UserLog()
The default (and only) constructor. |
Method Summary | |
---|---|
static UserLog |
getLog()
Obtain reference to the globally unique instance of the UserLog. |
javax.swing.table.DefaultTableModel |
getLogEntries()
Obtain the set of log entries contained in the user logs. |
static boolean |
log(Log.LogLevel level,
java.lang.String component,
java.lang.String text)
This method logs the specified message at the given level. |
Methods inherited from class org.peace_tools.generic.Log |
---|
addLogListener, clearLog, decode, encode, getFileName, getLevel, isWritingLogs, notifyViews, parseLevel, removeLogListener, setFileName, setLevel, toggleLogWriting |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private javax.swing.table.DefaultTableModel logEntries
private static final UserLog userLog
Constructor Detail |
---|
private UserLog()
Method Detail |
---|
public static UserLog getLog()
public static boolean log(Log.LogLevel level, java.lang.String component, java.lang.String text)
level
- The level of the log to be cut.component
- The component or subsystem that is generating the log message.text
- The text or actual log message.
public javax.swing.table.DefaultTableModel getLogEntries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |