org.schmant.support.io
Class LoggingProcessOutputStrategy

java.lang.Object
  extended by org.schmant.support.io.LoggingProcessOutputStrategy
All Implemented Interfaces:
ProcessOutputStrategy

public class LoggingProcessOutputStrategy
extends Object
implements ProcessOutputStrategy

This is a ProcessOutputStrategy that logs the output of the monitored process to the current log Report with a configurable log level.

Since:
0.5
Author:
Karl Gustafsson

Constructor Summary
LoggingProcessOutputStrategy(Level l)
          Create a logging process output strategy that will log output to the supplied Level.
LoggingProcessOutputStrategy(Level l, long pollInterval)
          Create a logging process output strategy that will log output to the supplied Level.
 
Method Summary
 Level getLevel()
          Get the log level.
 ProcessOutputListener getOutputListener()
          Create a new process output listener for listening to a process.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggingProcessOutputStrategy

public LoggingProcessOutputStrategy(Level l)
Create a logging process output strategy that will log output to the supplied Level. The monitored process is monitored for output with the default polling interval. (see AbstractProcessOutputListener)

Parameters:
l - The log level.

LoggingProcessOutputStrategy

public LoggingProcessOutputStrategy(Level l,
                                    long pollInterval)
Create a logging process output strategy that will log output to the supplied Level. The monitored process is monitored for output with the provided polling interval.

Parameters:
l - The log level.
pollInterval - The polling interval in milliseconds.
Method Detail

getLevel

public Level getLevel()
Get the log level.

Returns:
The log level.

getOutputListener

public ProcessOutputListener getOutputListener()
Description copied from interface: ProcessOutputStrategy
Create a new process output listener for listening to a process.

Specified by:
getOutputListener in interface ProcessOutputStrategy
Returns:
A new process output listener.

toString

public String toString()
Overrides:
toString in class Object