public class MemoryInfoLogger
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected class |
MemoryInfoLogger.LoggerRunningThread
Class LoggerRunningThread defines a separate thread used to build and
output the log file entries.
|
Modifier and Type | Field and Description |
---|---|
protected java.io.PrintStream |
altOutputStream |
protected boolean |
closeOnTerminateFlag |
protected int |
intervalSeconds |
protected MemoryInfoLogger.LoggerRunningThread |
loggerRunningThreadObj |
protected int |
logLevelVal |
protected LogFile |
logObj |
protected java.lang.StringBuffer |
stringBufferObj |
Constructor and Description |
---|
MemoryInfoLogger(LogFile logObj,
int intervalSeconds)
Creates a memory information logger object and starts a new
log-message-generation thread.
|
MemoryInfoLogger(java.io.PrintStream stmObj,
int intervalSeconds)
Creates a memory information logger object and starts a new
message-generation thread.
|
MemoryInfoLogger(java.lang.String logFileName,
int intervalSeconds)
Creates a memory information logger object and starts a new
log-message-generation thread.
|
MemoryInfoLogger(java.lang.String logFileName,
int intervalSeconds,
boolean useDateInFnameFlag)
Creates a memory information logger object and starts a new
log-message-generation thread.
|
MemoryInfoLogger(java.lang.String logFileName,
int intervalSeconds,
int maxLogFileAgeDays)
Creates a memory information logger object and starts a new
log-message-generation thread.
|
MemoryInfoLogger(java.lang.String logFileName,
int intervalSeconds,
int maxLogFileAgeDays,
int logFileSwitchIntervalDays)
Creates a memory information logger object and starts a new
log-message-generation thread.
|
Modifier and Type | Method and Description |
---|---|
protected void |
logOutputStr(java.lang.String msgStr)
Sends the given message to the output log file or stream.
|
void |
setCloseLogOnTerminateFlag(boolean flgVal)
Sets whether or not the log file is closed when the logging thread
terminates.
|
void |
setConsoleOutputFlag(boolean flgVal)
Sets the flag to enable console output of log messages.
|
void |
setLogLevelVal(int levelVal)
Sets the log-level value to be used.
|
protected void |
startLoggerThread(int intervalSeconds)
Starts the memory-information-logging thread.
|
void |
terminate()
Terminates the logging thread created by this MemoryInfoLogger.
|
protected final LogFile logObj
protected final java.io.PrintStream altOutputStream
protected int intervalSeconds
protected java.lang.StringBuffer stringBufferObj
protected MemoryInfoLogger.LoggerRunningThread loggerRunningThreadObj
protected int logLevelVal
protected boolean closeOnTerminateFlag
public MemoryInfoLogger(LogFile logObj, int intervalSeconds)
logObj
- the LogFile object to use for output.intervalSeconds
- the number of seconds between log outputs.public MemoryInfoLogger(java.lang.String logFileName, int intervalSeconds)
logFileName
- the name of the log file to be created and used
for output.intervalSeconds
- the number of seconds between log outputs.public MemoryInfoLogger(java.lang.String logFileName, int intervalSeconds, boolean useDateInFnameFlag)
logFileName
- the name of the log file to be created and used
for output.intervalSeconds
- the number of seconds between log outputs.useDateInFnameFlag
- true to use the date in the file name (and
create a new log file every time the date changes).public MemoryInfoLogger(java.lang.String logFileName, int intervalSeconds, int maxLogFileAgeDays)
logFileName
- the name of the log file to be created and used
for output.intervalSeconds
- the number of seconds between log outputs.maxLogFileAgeDays
- the maximum log file age, in days.public MemoryInfoLogger(java.lang.String logFileName, int intervalSeconds, int maxLogFileAgeDays, int logFileSwitchIntervalDays)
logFileName
- the name of the log file to be created and used
for output.intervalSeconds
- the number of seconds between log outputs.maxLogFileAgeDays
- the maximum log file age, in days.logFileSwitchIntervalDays
- the minimum number of days between
log file switches via date changes.public MemoryInfoLogger(java.io.PrintStream stmObj, int intervalSeconds)
stmObj
- the stream object to use for output.intervalSeconds
- the number of seconds between log outputs.protected void startLoggerThread(int intervalSeconds)
intervalSeconds
- the number of seconds between log outputs.public void setConsoleOutputFlag(boolean flgVal)
flgVal
- true to enable console output, false to disable.public void setLogLevelVal(int levelVal)
levelVal
- the log-level value to be used.public void setCloseLogOnTerminateFlag(boolean flgVal)
flgVal
- true to close the log file on terminate, false to not.public void terminate()
protected void logOutputStr(java.lang.String msgStr)
msgStr
- the message string to send.