PrintStreamStepMonitor.java

  1. package org.jbehave.core.steps;

  2. import java.io.PrintStream;

  3. import org.jbehave.core.reporters.Format;

  4. /**
  5.  * StepMonitor that prints to a {@link PrintStream}, defaulting to {@link System#out}.
  6.  */
  7. public class PrintStreamStepMonitor extends PrintingStepMonitor {

  8.     private final PrintStream output;

  9.     public PrintStreamStepMonitor() {
  10.         this(System.out);
  11.     }

  12.     public PrintStreamStepMonitor(PrintStream output) {
  13.         this.output = output;
  14.     }

  15.     @Override
  16.     protected void print(String format, Object... args) {
  17.         Format.println(output, format, args);
  18.     }
  19. }