net.cafebabe.sat.ant
Class ConsoleLogger

java.lang.Object
  |
  +--net.cafebabe.sat.ant.ConsoleLogger
All Implemented Interfaces:
org.apache.tools.ant.BuildListener, org.apache.tools.ant.BuildLogger, java.util.EventListener

public class ConsoleLogger
extends java.lang.Object
implements org.apache.tools.ant.BuildLogger

Writes build events to a PrintStream.

Author:
Michel Casabianca

Constructor Summary
ConsoleLogger()
          Empty constructor.
ConsoleLogger(java.io.PrintStream out, java.io.PrintStream err, int level)
          Constructor with streams and logging level.
 
Method Summary
 void buildFinished(org.apache.tools.ant.BuildEvent event)
           
 void buildStarted(org.apache.tools.ant.BuildEvent event)
           
 void messageLogged(org.apache.tools.ant.BuildEvent event)
          Logs a message, if the priority is suitable.
 void setEmacsMode(boolean emacsMode)
           
 void setErrorPrintStream(java.io.PrintStream err)
          Sets the output stream to which this logger is to send error messages.
 void setMessageOutputLevel(int level)
          Sets the highest level of message this logger should respond to.
 void setOutputPrintStream(java.io.PrintStream output)
          Sets the output stream to which this logger is to send its output.
 void targetFinished(org.apache.tools.ant.BuildEvent event)
           
 void targetStarted(org.apache.tools.ant.BuildEvent event)
          Logs a message to say that the target has started if this logger allows information-level messages.
 void taskFinished(org.apache.tools.ant.BuildEvent event)
           
 void taskStarted(org.apache.tools.ant.BuildEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleLogger

public ConsoleLogger()
Empty constructor.


ConsoleLogger

public ConsoleLogger(java.io.PrintStream out,
                     java.io.PrintStream err,
                     int level)
Constructor with streams and logging level.

Parameters:
out - The standard output stream as a PrintStream
err - The error output stream as a PrintStream
level - Ouput message logging level as an int
Method Detail

setMessageOutputLevel

public void setMessageOutputLevel(int level)
Sets the highest level of message this logger should respond to.

Specified by:
setMessageOutputLevel in interface org.apache.tools.ant.BuildLogger
Parameters:
level - the logging level for the logger.

setOutputPrintStream

public void setOutputPrintStream(java.io.PrintStream output)
Sets the output stream to which this logger is to send its output.

Specified by:
setOutputPrintStream in interface org.apache.tools.ant.BuildLogger
Parameters:
output - The output stream for the logger.

setErrorPrintStream

public void setErrorPrintStream(java.io.PrintStream err)
Sets the output stream to which this logger is to send error messages.

Specified by:
setErrorPrintStream in interface org.apache.tools.ant.BuildLogger
Parameters:
err - The error stream for the logger.

targetStarted

public void targetStarted(org.apache.tools.ant.BuildEvent event)
Logs a message to say that the target has started if this logger allows information-level messages.

Specified by:
targetStarted in interface org.apache.tools.ant.BuildListener
Parameters:
event - An event with any relevant extra information. Must not be null.

messageLogged

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

Specified by:
messageLogged in interface org.apache.tools.ant.BuildListener
Parameters:
event - A BuildEvent containing message information.

setEmacsMode

public void setEmacsMode(boolean emacsMode)
Specified by:
setEmacsMode in interface org.apache.tools.ant.BuildLogger

buildStarted

public void buildStarted(org.apache.tools.ant.BuildEvent event)
Specified by:
buildStarted in interface org.apache.tools.ant.BuildListener

buildFinished

public void buildFinished(org.apache.tools.ant.BuildEvent event)
Specified by:
buildFinished in interface org.apache.tools.ant.BuildListener

targetFinished

public void targetFinished(org.apache.tools.ant.BuildEvent event)
Specified by:
targetFinished in interface org.apache.tools.ant.BuildListener

taskStarted

public void taskStarted(org.apache.tools.ant.BuildEvent event)
Specified by:
taskStarted in interface org.apache.tools.ant.BuildListener

taskFinished

public void taskFinished(org.apache.tools.ant.BuildEvent event)
Specified by:
taskFinished in interface org.apache.tools.ant.BuildListener