public class StatLogger extends Object
| Constructor and Description |
|---|
StatLogger(File logdir,
String filename,
String fileext,
int filecount,
int rowcount)
StatLogger is used to write to a log file that contain a header followed
by a set of data rows.
|
| Modifier and Type | Method and Description |
|---|---|
void |
log(String val)
log writes the string to the log file.
|
void |
logDelta(String val)
logDelta writes the string if the string is different
than the last written log record.
|
void |
setFileCount(int filecount)
Set the maximum number of log files to keep after rotation.
|
void |
setHeader(String val)
Sets the log file header.
|
void |
setRowCount(int rowcount)
Sets the maximum log file row count.
|
public StatLogger(File logdir, String filename, String fileext, int filecount, int rowcount) throws IOException
logdir - Log file directory.filename - Name of the log file.fileext - Extent of the log file.filecount - Maximum number of rotating log files to be saved.rowcount - Maximum number of rows in a log file.IOException - if log file or directory cannot be accessed.IllegalArgumentException - if the log directory is not
a directory or if the log file is not a file.public void setRowCount(int rowcount)
rowcount - The maximum number of rows per log file.public void setFileCount(int filecount)
filecount - The maximum number of log files to keep.public void setHeader(String val) throws IOException
val - Header row data.IOExceptionpublic void log(String val) throws IOException
val - Value to write to the log.IOExceptionpublic void logDelta(String val) throws IOException
val - value write to the log.IOExceptionCopyright © 2024. All rights reserved.