public class MemoryLogger extends Object implements LogListener
| Modifier and Type | Field and Description |
|---|---|
static int |
DEF_SIZE
The default size of the message cache, 32.
|
| Constructor and Description |
|---|
MemoryLogger()
Create a memory logger.
|
MemoryLogger(int size)
Create a memory logger.
|
| Modifier and Type | Method and Description |
|---|---|
List |
getMessages()
Get the list of messages logged so far.
|
int |
getSize()
Get the maximum size of the cache.
|
void |
messageLogged(LogEvent event)
A message got logged.
|
void |
propertyChange(PropertyChangeEvent ignore) |
void |
setSize(int size)
Set the maximum size of the cache.
|
void |
streamStarted(LogEvent ignore)
A stream got started.
|
void |
streamStopped(LogEvent ignore)
A stream was stopped.
|
public static final int DEF_SIZE
public MemoryLogger()
org.apache.oodt.commons.util.MemoryLogger.size,
or DEF_SIZE if that property isn't specified.public MemoryLogger(int size)
size - Size of the message cache.public List getMessages()
Strings in time order.public int getSize()
public void setSize(int size)
size - The new maximum cache size.public void streamStarted(LogEvent ignore)
LogListenerLogEvent.getStream().LogEvent.getTimestamp()EventObject.getSource() (always a String).streamStarted in interface LogListenerignore - The logging event.public void streamStopped(LogEvent ignore)
LogListenerLogEvent.getStream() or EventObject.getSource()
(always a String).streamStopped in interface LogListenerignore - The logging event.public void propertyChange(PropertyChangeEvent ignore)
propertyChange in interface PropertyChangeListenerpublic void messageLogged(LogEvent event)
LogListenerLogEvent.getTimestamp().EventObject.getSource(), which is always
a String.LogEvent.getCategory().LogEvent.getMessage().messageLogged in interface LogListenerevent - The logging event.Copyright © 1999–2017 Apache OODT. All rights reserved.