|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.schmant.report.FileReportFactory
public class FileReportFactory
This is a ReportFactory
that creates FileReport
Report
:s.
The file name for created reporters are schmantlog_[identifier].log
.
Thus it is important that all Report
:s have unique identifiers.
Constructor Summary | |
---|---|
FileReportFactory()
|
Method Summary | |
---|---|
protected String |
getLogFileName(String identifier)
Get the name of the log file for the specified identifier. |
protected File |
getLoggingDirectory()
Get the directory where the log files are stored. |
protected boolean |
isAppend()
Should existing log files be appended? This implementation returns true (a safe default). |
Report |
newReport(String identifier)
Create a new Report instance. |
void |
setReportLineFormatter(ReportLineFormatter llf)
Set the ReportLineFormatter to use for Report objects
created from this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileReportFactory()
Method Detail |
---|
public void setReportLineFormatter(ReportLineFormatter llf)
ReportFactory
ReportLineFormatter
to use for Report
objects
created from this factory. This must be set before any Report
:s
are created.
All ReportFactory
implementations are required to use a default
ReportLineFormatter
(probably the
SimpleReportLineFormatter
) if no other formatter is set.
setReportLineFormatter
in interface ReportFactory
llf
- The new log line formatter.protected File getLoggingDirectory()
protected String getLogFileName(String identifier)
schmantlog_[identifier].log
. Override this
method to change that behavior.
identifier
- The Report
identifier.
protected boolean isAppend()
true
(a safe default). Override to change that behavior.
true
if existing log files should be appended to.public Report newReport(String identifier)
ReportFactory
Report
instance.
newReport
in interface ReportFactory
identifier
- A unique identifier for the instance (for identifying
messages logged from different execution threads), or null
for no
identifier.
Report
instance.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |