|
|||||||||
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(java.util.logging.Level level,
java.lang.String text,
long duration)
Create log event that will last for some time. |
static LogEventMark |
createSingleLengthEvent(java.util.logging.Level level,
java.lang.String text)
Create single event. |
static LogEventMark |
createVariableLengthEvent(java.util.logging.Level level,
java.lang.String text)
Create log event that will last until notified it should stop. |
boolean |
equals(java.lang.Object otherObject)
|
long |
getDuration()
|
LogEventMark |
getEndMark()
Get ending mark for variable length event. |
int |
getId()
Get unique id of event. |
java.util.logging.Level |
getLevel()
What is level of this event? |
java.lang.String |
getText()
|
long |
getTime()
|
LogEventMark.Type |
getType()
|
int |
hashCode()
|
java.lang.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(java.util.logging.Level level, java.lang.String text)
level
- level of log event, should be same as carrying LogRecord
.text
- text of single event
public static LogEventMark createFixedLengthEvent(java.util.logging.Level level, java.lang.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(java.util.logging.Level level, java.lang.String text)
getEndMark()
.
level
- level of log event, should be same as carrying LogRecord
.text
- text of event.
public java.lang.String toString()
toString
in class java.lang.Object
public int getId()
public java.util.logging.Level getLevel()
public java.lang.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).
java.lang.IllegalStateException
- if type
of mark is not
start
or end
.public boolean equals(java.lang.Object otherObject)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |