RbUtils 0.13

org.ktc.rbutils.rb
Class LoggerCreator

java.lang.Object
  extended by org.ktc.rbutils.rb.LoggerCreator

public class LoggerCreator
extends Object

Utility class that helps for logger creation.

All RbUtils loggers can be created with this class according to a taskname.

Since:
RbUtils 0.9.3.3
Version:
$Revision: 1.1 $
Author:
moishi

Constructor Summary
LoggerCreator()
          Instanciates a new Logger.
 
Method Summary
 Logger createLogger(String taskname)
          Creates a logger according to a task.
 LoggerType getLoggerType()
          Returns the type of this logger.
 File getOutputFile()
          Returns the output file of this ant logger.
 void setLoggerType(LoggerType loggertype)
          Set the type of the logger.
 void setLoggerType(String loggertype)
          Sets the type of logger.
 void setOutputFile(File theOutputFile)
          Set the file to output to.
 void setOutputFile(String path2File)
          Set the file to output to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerCreator

public LoggerCreator()
Instanciates a new Logger.

Method Detail

getLoggerType

public LoggerType getLoggerType()
Returns the type of this logger.

Returns:
the type of the ant logger.

setLoggerType

public void setLoggerType(LoggerType loggertype)
Set the type of the logger.

Parameters:
loggertype - the type of the logger.

setLoggerType

public void setLoggerType(String loggertype)
Sets the type of logger.

Parameters:
loggertype - the type of logger to be set.
Throws:
RbUtilsRuntimeException - if the provided String does not represent a logger type.

getOutputFile

public File getOutputFile()
Returns the output file of this ant logger.

Returns:
the output file of this ant logger.

setOutputFile

public void setOutputFile(File theOutputFile)
Set the file to output to.

Parameters:
theOutputFile - the file to output to.

setOutputFile

public void setOutputFile(String path2File)
Set the file to output to. If path2File is null, the file is not set.

Parameters:
path2File - the full path to the file.

createLogger

public Logger createLogger(String taskname)
                    throws IOException,
                           UnSpecifiedFileException
Creates a logger according to a task. TODO Javadoc - to be improved.

Parameters:
taskname - the task to be associated to the logger.
Returns:
a logger according to the task.
Throws:
IOException - if the logger relies on a file and this file cannot be created.
UnknownTaskException - if the task is not supported.
UnSpecifiedFileException - if the outputFile is not set and the the task relies on xml logging.

Back to the RbUtils Home Page

Copyright © 2005-2009 RbUtils Project. All Rights Reserved.