|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.ProjectComponent | +--org.apache.tools.ant.types.DataType | +--org.apache.anteater.test.BaseDataType | +--org.apache.anteater.test.log.LoggerFactory
A LoggerFactory corresponds to a <logger> element in Anteater. It provides a facility for the creation of Logger instances.
It's lifecycle is as follows:
ActionTask
createLogger()
method to create a Logger
instance
The type of Logger this LoggerFactory will produce is determined at runtime,
by setting the setType(org.apache.anteater.test.log.LoggerFactory.TypeAttribute)
and setClassname(java.lang.String)
methods.
All Loggers produced by a LoggerFactory share a common group
. This allows one to group
Nested Class Summary | |
static class |
LoggerFactory.TypeAttribute
Enumerated attribute with the values "plain" and "xml". |
Field Summary |
Fields inherited from class org.apache.anteater.test.BaseDataType |
debug, debugWasSet |
Fields inherited from class org.apache.tools.ant.types.DataType |
checked, description, ref |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
LoggerFactory()
|
Method Summary | |
Logger |
createLogger()
ActionTasks that wish to log should request a Log via this method. |
void |
setClassname(String classname)
Set name of class to be used as the formatter. |
void |
setExtension(String extension)
|
void |
setFilenameFormat(String filenameFormat)
|
void |
setGroup(Group group)
Sets the group that this task belongs to. |
void |
setGroup(String group)
Sets the group that this task belongs to. |
void |
setOverwrite(Boolean overwrite)
|
void |
setTodir(File destDir)
Sets the directory to which log files will be written. |
void |
setType(LoggerFactory.TypeAttribute type)
Quick way to use a standard formatter. |
void |
setUseFile(boolean useFile)
|
Methods inherited from class org.apache.anteater.test.BaseDataType |
debug, getDataTypeName, getDebug, getGroup, getRef, print, println, setDebug, setRefid |
Methods inherited from class org.apache.tools.ant.types.DataType |
circularReference, dieOnCircularReference, getCheckedRef, getDescription, isReference, noChildrenAllowed, setDescription, tooManyAttributes |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject, log, log, setProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LoggerFactory()
Method Detail |
public void setGroup(String group)
BaseDataType
setGroup
in interface Groupable
setGroup
in class BaseDataType
group
- String id of an existing group.public void setGroup(Group group)
BaseDataType
setGroup
in interface Groupable
setGroup
in class BaseDataType
group
- Group object to add this task to.public void setClassname(String classname)
Set name of class to be used as the formatter.
This class must implement Logger
public void setType(LoggerFactory.TypeAttribute type)
Quick way to use a standard formatter.
At the moment, there are three supported standard formatters.
xml
type uses an XMLLogger
.
plain
type (the default) uses a TextLogger
.
Sets classname
attribute - so you can't use that attribute if you use this one.
public void setTodir(File destDir)
public void setUseFile(boolean useFile)
public void setFilenameFormat(String filenameFormat)
public void setOverwrite(Boolean overwrite)
public void setExtension(String extension)
public Logger createLogger()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |