public final class HierarchicalLogger extends Object implements IDisposable
HierarchicalLogger.push()
) can log simultaneously from different threads and the output will be
serialized in the log file.Constructor and Description |
---|
HierarchicalLogger(String fileName)
Initializes a new instance to log to a specified file.
|
HierarchicalLogger(Writer writer)
Initializes a new instance to log to a specified
Writer . |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Finishes logging for this sub-task and writes its output to either the
log file or its parent sub-task.
|
boolean |
getReportFunctionExplorerDetails()
Gets a value indicating whether to report details from the Function Explorers as well.
|
HierarchicalLogger |
pop()
Finishes logging for this sub-task and writes its output to either the
log file or its parent sub-task.
|
HierarchicalLogger |
push()
Begins a new sub-task.
|
void |
setReportFunctionExplorerDetails(boolean value)
Sets a value indicating whether to report details from the Function Explorers as well.
|
void |
writeLine(String line)
Writes a line of text to the log.
|
void |
writeLine(String line,
Object... arg)
Writes a line of text to the log.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public HierarchicalLogger(@Nonnull String fileName)
fileName
- The name of the file to which to log.public final void dispose()
dispose
in interface IDisposable
public final HierarchicalLogger push()
HierarchicalLogger.pop()
or IDisposable.close()
on the returned
instance when the sub-task completes.public final HierarchicalLogger pop()
public final void writeLine(String line)
line
- The line to write to the log.public final void writeLine(String line, Object... arg)
line
- The line to write to the log, is the dame format as string.Format() would take.arg
- List of arguments agreeing with the formatting in line
.public final boolean getReportFunctionExplorerDetails()
public final void setReportFunctionExplorerDetails(boolean value)