|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.ui.LogInterface
General purpose log interface.
This is an abstraction for all log events : it defines how to select the log level, to conditionnally log a new message,
or to disable logging.
The effective way log messages are displayed is not defined in this abstract
but rather in its subclasses.
UserInterface
Constructor Summary | |
protected |
LogInterface()
|
Method Summary | |
void |
disable()
Disables any logging. |
void |
enable()
Enables logging again. |
static void |
flush()
Flushes any pending log message. |
protected int |
getLevel()
Gets the current log level upper limit. |
void |
log(int level,
java.lang.Class clazz,
java.lang.String message)
Logs a new event. |
protected abstract void |
log(java.lang.String logMessage)
Actually handles a log message. |
protected static void |
post(java.lang.String logMessage)
Posts a new log message Message processing is asynchronous |
void |
setLevel(int level)
Sets the log level upper limit. |
static void |
start()
Starts logging. |
static void |
stop()
Stops logging. |
void |
test()
Simple test code. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected LogInterface()
Method Detail |
protected int getLevel()
public void setLevel(int level)
level
- the desired log level for subsequent calls
which can not be greater than Settings.Defaults.MAXIMUM_LOG_LEVEL
public void disable()
enable()
getLevel()
public void enable()
setLevel
had been made before then that log level is reset back.
Otherwise all log events are unconditionnally allowed until a call to
either setLevel()
or to disable()
getLevel()
public void log(int level, java.lang.Class clazz, java.lang.String message)
Note that the Class
parameter is not used in this implementation, although
it is meant to control the logging authorizations on a per-class basis
level
- the log level of this event, higher meaning lower priorityclazz
- the class issuing this log evengmessage
- the log messageprotected abstract void log(java.lang.String logMessage)
protected static void post(java.lang.String logMessage)
start()
,
stop()
public static void start()
UserInterface
used to handle log messages
may vary according to calls made to UserInterface.set
UserInterface.set(java.lang.String)
public static void flush()
start()
was previously made.
public static void stop()
flush()
public void test()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |