|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cz.cuni.amis.pogamut.base.utils.logging.marks.LogEventMark
public class LogEventMark
DO NOT USE THIS CLASS!! Use methods in LogCategory
to add events to the log.
LogRecord
that means some
kind of event has happend to the agent. The handler of log records can do some
nifty stuff when he finds this object as parameter of LogRecord
,
like showing in some GUI.
Under normal circumstances, you create new mark using one of create* methods,
pass it as parameter of some log message, it gets transfered (probably through JMX)
to some handler on the other side (in our particular case to Netbeans plugin
and timeline), where some handler will look for LogRecords
with this object as one of parameters and when it finds it, it shows the mark
in some GUI.
// create an event that with text "Text of event for GUI" that will be
// shown for duration of 2 seconds.
logger.info("Text of event for text logger" , new Object[]{LogEventMark.createFixedLengthEvent(Level.INFO, "Text of event for GUI", null, 2000)});
LogMapMark
,
Serialized FormNested Class Summary | |
---|---|
static class |
LogEventMark.Type
Type of LogEventMark . |
Method Summary | |
---|---|
static LogEventMark |
createFixedLengthEvent(Level level,
String text,
long duration)
Create log event that will last for some time. |
static LogEventMark |
createSingleLengthEvent(Level level,
String text)
Create single event. |
static LogEventMark |
createVariableLengthEvent(Level level,
String text)
Create log event that will last until notified it should stop. |
boolean |
equals(Object otherObject)
|
long |
getDuration()
|
LogEventMark |
getEndMark()
Get ending mark for variable length event. |
int |
getId()
Get unique id of event. |
Level |
getLevel()
What is level of this event? |
String |
getText()
|
long |
getTime()
|
LogEventMark.Type |
getType()
|
int |
hashCode()
|
String |
toString()
Get human readable representation of LogEventMark. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static LogEventMark createSingleLengthEvent(Level level, String text)
level
- level of log event, should be same as carrying LogRecord
.text
- text of single event
public static LogEventMark createFixedLengthEvent(Level level, String text, long duration)
level
- level of log event, should be same as carrying LogRecord
.text
- Text of eventduration
- how long should event last.public static LogEventMark createVariableLengthEvent(Level level, String text)
getEndMark()
.
level
- level of log event, should be same as carrying LogRecord
.text
- text of event.
public String toString()
toString
in class Object
public int getId()
public Level getLevel()
public String getText()
public long getTime()
public LogEventMark.Type getType()
public long getDuration()
public LogEventMark getEndMark()
start mark
, create new end mark,
if this mark is end mark
, return this mark (since we already are end mark).
IllegalStateException
- if type
of mark is not
start
or end
.public boolean equals(Object otherObject)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |