Package net.i2p.router.util
Class EventLog
java.lang.Object
net.i2p.router.util.EventLog
Simple event logger for occasional events,
with caching for reads.
Does not keep the file open.
- Since:
- 0.9.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringfor convenience, not requiredstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend an event.voidAppend an event.getEvents(long since) All events since a given time.Caches.longgetLastEvent(String event, long since) Timestamp of last event.
-
Field Details
-
ABORTED
for convenience, not required- See Also:
-
BECAME_FLOODFILL
- See Also:
-
CHANGE_IP
- See Also:
-
CHANGE_PORT
- See Also:
-
CLOCK_SHIFT
- See Also:
-
CRASHED
- See Also:
-
CRITICAL
- See Also:
-
DEADLOCK
- See Also:
-
INSTALLED
- See Also:
-
INSTALL_FAILED
- See Also:
-
NETWORK
- See Also:
-
NEW_IDENT
- See Also:
-
NOT_FLOODFILL
- See Also:
-
OOM
- See Also:
-
REACHABILITY
- See Also:
-
REKEYED
- See Also:
-
RESEED
- See Also:
-
SOFT_RESTART
- See Also:
-
STARTED
- See Also:
-
STOPPED
- See Also:
-
UPDATED
- See Also:
-
WATCHDOG
- See Also:
-
-
Constructor Details
-
EventLog
- Parameters:
file- should be absolute
-
-
Method Details
-
addEvent
Append an event. Fails silently.- Parameters:
event- no spaces, e.g. "started"- Throws:
IllegalArgumentException- if event contains a space or newline
-
addEvent
Append an event. Fails silently.- Parameters:
event- no spaces or newlines, e.g. "started"info- no newlines, may be blank or null- Throws:
IllegalArgumentException- if event contains a space or either contains a newline
-
getEvents
Caches. Fails silently.- Parameters:
event- matching this event only, case sensitivesince- since this time, 0 for all- Returns:
- non-null, Map of times to (possibly empty) info strings, sorted, earliest first, unmodifiable
-
getEvents
All events since a given time. Does not cache. Fails silently. Values in the returned map have the format "event[ info]". Events do not contain spaces.- Parameters:
since- since this time, 0 for all- Returns:
- non-null, Map of times to info strings, sorted, earliest first, unmodifiable
- Since:
- 0.9.14
-
getLastEvent
Timestamp of last event.- Parameters:
event- matching this event, case sensitivesince- since this time, 0 for all- Returns:
- last event time, or 0 for none
- Since:
- 0.9.47
-