com.dtolabs.rundeck.core.utils
Class ExecToolCommandLogger

java.lang.Object
  extended by org.apache.tools.ant.DefaultLogger
      extended by com.dtolabs.rundeck.core.utils.ExecToolCommandLogger
All Implemented Interfaces:
java.util.EventListener, org.apache.tools.ant.BuildListener, org.apache.tools.ant.BuildLogger

public class ExecToolCommandLogger
extends org.apache.tools.ant.DefaultLogger

ExecToolCommandLogger reformats ant log messages using a Reformatter


Field Summary
 
Fields inherited from class org.apache.tools.ant.DefaultLogger
emacsMode, err, LEFT_COLUMN_SIZE, lSep, msgOutputLevel, out
 
Constructor Summary
ExecToolCommandLogger(Reformatter formatter)
           
 
Method Summary
 int getLevel()
           
static java.lang.String logLevelToString(int level)
          Returns a string representing the specified log level
 void messageLogged(org.apache.tools.ant.BuildEvent event)
          Logs a message, if the priority is suitable.
static java.lang.String retrieveModuleName(org.apache.tools.ant.BuildEvent event)
          Look up the module name value from the project of the build event
static java.lang.String retrieveNodeName(org.apache.tools.ant.BuildEvent event)
          Look up the server name value from the project of the build event
static java.lang.String retrieveUserName(org.apache.tools.ant.BuildEvent event)
          Look up the user name value from the project of the build event
 
Methods inherited from class org.apache.tools.ant.DefaultLogger
buildFinished, buildStarted, extractProjectName, formatTime, getBuildFailedMessage, getBuildSuccessfulMessage, getTimestamp, log, printMessage, setEmacsMode, setErrorPrintStream, setMessageOutputLevel, setOutputPrintStream, targetFinished, targetStarted, taskFinished, taskStarted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecToolCommandLogger

public ExecToolCommandLogger(Reformatter formatter)
Method Detail

messageLogged

public void messageLogged(org.apache.tools.ant.BuildEvent event)
Logs a message, if the priority is suitable.

Overridden to add a prefix string.

Specified by:
messageLogged in interface org.apache.tools.ant.BuildListener
Overrides:
messageLogged in class org.apache.tools.ant.DefaultLogger
Parameters:
event - A BuildEvent containing message information. Must not be null.

retrieveModuleName

public static java.lang.String retrieveModuleName(org.apache.tools.ant.BuildEvent event)
Look up the module name value from the project of the build event

Parameters:
event - the BuildEvent
Returns:
the module name

retrieveNodeName

public static java.lang.String retrieveNodeName(org.apache.tools.ant.BuildEvent event)
Look up the server name value from the project of the build event

Parameters:
event - the BuildEvent
Returns:
the value of framework.server.name

retrieveUserName

public static java.lang.String retrieveUserName(org.apache.tools.ant.BuildEvent event)
Look up the user name value from the project of the build event

Parameters:
event - the BuildEvent
Returns:
the user name

logLevelToString

public static java.lang.String logLevelToString(int level)
Returns a string representing the specified log level

Parameters:
level - Log level
Returns:
log level name in string form

getLevel

public int getLevel()