|
||||||||||
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.ProgrammerLog
public class ProgrammerLog
Top-level logging class for creating programmer logs.
The ProgrammerLog provides a convenient mechanism the GUI system to log relevant information to help programmers debug and troubleshoot problems. This log is essentially used to record information that may be useful for a programmer but not useful for the user.
This class is a centralized class for merely recording the logs (and not viewing/seeing) the logs. The logs are viewed/shown by the Programmer LogPane 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 ProgrammerLogPane serves as the controller.
Since the ProgrammerLog serves as an centralized location for cutting logs relevant/useful to the programmer, 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 user (that would be pertinent for the user to view and take action) must be generated in the UserLog.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.peace_tools.generic.Log |
---|
Log.LogLevel |
Field Summary | |
---|---|
private java.lang.StringBuffer |
logEntries
This instance variable holds all the user logs that have been generated thus far via the log() method in this class. |
private static ProgrammerLog |
programmerLog
The globally unique instance of the UserLog. |
Fields inherited from class org.peace_tools.generic.Log |
---|
currentLogLevel, listeners, logFile, logFileName |
Constructor Summary | |
---|---|
private |
ProgrammerLog()
The default (and only) constructor. |
Method Summary | |
---|---|
static ProgrammerLog |
getLog()
Obtain reference to the globally unique instance of the ProgrammerLog. |
java.lang.StringBuffer |
getLogEntries()
Obtain the set of log entries contained in the user logs. |
static boolean |
log(java.lang.Exception e)
This method logs the specified message in the programmer log. |
static boolean |
log(java.lang.String text)
This method logs the specified message in the programmer log. |
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 java.lang.StringBuffer logEntries
private static final ProgrammerLog programmerLog
Constructor Detail |
---|
private ProgrammerLog()
Method Detail |
---|
public static ProgrammerLog getLog()
public static boolean log(java.lang.String text)
text
- The text or actual log message.
public static boolean log(java.lang.Exception e)
e
- Logs the exception in the programmer log.
public java.lang.StringBuffer getLogEntries()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |