org.apache.anteater.test.log
Class LoggerFactory

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
All Implemented Interfaces:
Groupable

public class LoggerFactory
extends BaseDataType

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:

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

Since:
June 15, 2002
Version:
$Revision: 1.13 $ $Date: 2003/03/09 15:33:12 $
Author:
Jeff Turner

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

LoggerFactory

public LoggerFactory()
Method Detail

setGroup

public void setGroup(String group)
Description copied from class: BaseDataType
Sets the group that this task belongs to.

Specified by:
setGroup in interface Groupable
Overrides:
setGroup in class BaseDataType
Parameters:
group - String id of an existing group.

setGroup

public void setGroup(Group group)
Description copied from class: BaseDataType
Sets the group that this task belongs to.

Specified by:
setGroup in interface Groupable
Overrides:
setGroup in class BaseDataType
Parameters:
group - Group object to add this task to.

setClassname

public void setClassname(String classname)

Set name of class to be used as the formatter.

This class must implement Logger


setType

public void setType(LoggerFactory.TypeAttribute type)

Quick way to use a standard formatter.

At the moment, there are three supported standard formatters.

Sets classname attribute - so you can't use that attribute if you use this one.


setTodir

public void setTodir(File destDir)
Sets the directory to which log files will be written. If this doesn't exist, it will be created when needed.


setUseFile

public void setUseFile(boolean useFile)

setFilenameFormat

public void setFilenameFormat(String filenameFormat)

setOverwrite

public void setOverwrite(Boolean overwrite)

setExtension

public void setExtension(String extension)

createLogger

public Logger createLogger()
ActionTasks that wish to log should request a Log via this method.



Ant Functional Tester -- see Project home page for details