|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectLogger
public class Logger
Simple logging facility, which displays messages in a console window, and/or appends the messages to a specified log file. The logger determines which messages to display by comparing the level of the message against the level of the Logger object. if the message level is greater than the Logger level, the message is not displayed. The level can be any value, but should be positive or zero for simplicity. Use the lowest message level of zero in messages that must be displayed, such as error messages. Use a higher level for warnings, and higher levels still for debugging messages. You can then control which messages display by using the appropriate Logger level.
Field Summary | |
---|---|
private static boolean |
append
|
private static int |
level
|
private static java.lang.String |
logName
|
Constructor Summary | |
---|---|
Logger()
|
Method Summary | |
---|---|
static int |
getLevel()
Get the logging level. |
static void |
initialize(int _level,
java.lang.String _logName)
This method combines the setLevel and setLogName. |
static boolean |
log(boolean _return,
int _level,
java.lang.String _message)
Log the specified message if the specified level is less than or equal to the member level. |
static boolean |
log(boolean _return,
int _level,
java.lang.String _message,
java.lang.Throwable _e)
Log the specified message if the specified level is less than or equal to the member level. |
static boolean |
log(boolean _return,
int _level,
java.lang.Throwable _e)
Log the specified exception and its initial cause(es) if the specified level is less than or equal to the member level. |
static void |
setLevel(int _level)
Set the logging level. |
static void |
setLogName(java.lang.String _logName)
Set the name of the file to which to write messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static boolean append
private static int level
private static java.lang.String logName
Constructor Detail |
---|
public Logger()
Method Detail |
---|
public static void setLevel(int _level)
_level
- is the new Logger level.public static int getLevel()
public static void setLogName(java.lang.String _logName)
_logName
- is the name of the logging file.public static void initialize(int _level, java.lang.String _logName)
_level
- is the new Logger level._logName
- is the name of the logging file.public static boolean log(boolean _return, int _level, java.lang.String _message)
_return
- is the value to return to the caller._level
- is the level of the message to check against the
Logger level._message
- is the message to display or log.public static boolean log(boolean _return, int _level, java.lang.Throwable _e)
_return
- is the value to return to the caller._level
- is the level of the message to check against the
Logger level._e
- is the exception to display or log.public static boolean log(boolean _return, int _level, java.lang.String _message, java.lang.Throwable _e)
_return
- is the value to return to the caller._level
- is the level of the message to check against the
Logger level._message
- is the message to display or log._e
- is the exception to display or log.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |