|
© 2002 - Lorne Brinkman www.TheObjectGuy.com Lorne@TheObjectGuy.com |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--com.bitfactoryinc.logging.Logger
|
+--com.bitfactoryinc.logging.MemoryLogger
Instances of this class keep track of LogEntries in memory. The LogEntries can be dumped out to another Logger at any time, if desired. The capacity instance variable represents the maximum number of LogEntries to retain.
| Field Summary | |
private int |
capacity
|
private java.util.LinkedList |
logEntries
|
| Fields inherited from class com.bitfactoryinc.logging.Logger |
application,
defaultFilterClass,
defaultFormatterClass,
enabled,
filter,
formatter |
| Constructor Summary | |
MemoryLogger()
|
|
MemoryLogger(int aCapacity)
|
|
MemoryLogger(MemoryLogger aMemoryLogger)
This is a copy constructor. |
|
| Method Summary | |
void |
clear()
Clear all the LogEntries |
MemoryLogger |
copy()
a convenience method that just calls the copy constructor |
protected boolean |
doLog(LogEntry aLogEntry)
If my capacity has been reached, remove the oldest entry. |
int |
getCapacity()
|
LogEntry[] |
getLog()
Return an Array of LogEntries |
protected java.util.LinkedList |
getLogEntries()
|
void |
logAllTo(Logger aLogger)
Dump all the LogEntries to aLogger |
void |
setCapacity(int newCapacity)
|
protected void |
setLogEntries(java.util.LinkedList newLogEntries)
|
int |
size()
Return the number of LogEntries currently held |
boolean |
transferTo(Logger aLogger)
This differs from logAllTo in that successfully logged entries are removed from me. |
| Methods inherited from class com.bitfactoryinc.logging.Logger |
getApplication,
getDefaultFilterClass,
getDefaultFormatterClass,
getFilter,
getFormatter,
getSeverityThreshold,
isEnabled,
log,
log,
log,
logCritical,
logCritical,
logDebug,
logDebug,
logError,
logError,
logFatal,
logFatal,
logInfo,
logInfo,
logStatus,
logStatus,
logWarning,
logWarning,
setApplication,
setDefaultFilter,
setDefaultFilterClass,
setDefaultFormatter,
setDefaultFormatterClass,
setEnabled,
setFilter,
setFormatter,
setSeverityThreshold,
shouldLog,
writeToLog |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private int capacity
private java.util.LinkedList logEntries
| Constructor Detail |
public MemoryLogger()
public MemoryLogger(int aCapacity)
public MemoryLogger(MemoryLogger aMemoryLogger)
| Method Detail |
public void clear()
public MemoryLogger copy()
protected boolean doLog(LogEntry aLogEntry)
public int getCapacity()
public LogEntry[] getLog()
protected java.util.LinkedList getLogEntries()
public void logAllTo(Logger aLogger)
public void setCapacity(int newCapacity)
protected void setLogEntries(java.util.LinkedList newLogEntries)
public int size()
public boolean transferTo(Logger aLogger)
|
© 2002 - Lorne Brinkman www.TheObjectGuy.com Lorne@TheObjectGuy.com |
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||