/*
 *  Copyright (c) 2012 Malhar, Inc.
 *  All Rights Reserved.
 */
package com.malhartech.lib.io;

import com.malhartech.annotation.NodeAnnotation;
import com.malhartech.annotation.PortAnnotation;
import com.malhartech.annotation.PortAnnotation.PortType;
import com.malhartech.dag.AbstractNode;

/**
 *
 * Writes tuples to stdout of the container<p>
 * <br>
 * Mainly to be used for debugging. Users should be careful to not have this node listen to a high throughput stream<br>
 * <br>
 *
 */
@NodeAnnotation(
    ports = {
        @PortAnnotation(name = ConsoleOutputNode.INPUT, type = PortType.INPUT)
    }
)
public class ConsoleOutputNode extends AbstractNode
{
  /**
   *
   * @param t the value of t
   */
  @Override
  public void process(Object t)
  {
    System.out.println(t);
  }

}

@@ -93,16 +93,74 @@
 ib.io;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 import c
@@ -724,126 +724,920 @@
 %7B%0A  
-/**%0A   *%0A   * @param t the value of t%0A   */%0A  @Override%0A  public void process(Object t)%0A  %7B%0A    System.out.println(t);
+private static final Logger LOG = LoggerFactory.getLogger(ConsoleOutputNode.class);%0A%0A  /**%0A   * When set to true, tuples are also logged at INFO level.%0A   */%0A  public static final String P_DEBUG = %22debug%22;%0A%0A  /**%0A   * A formatter for %7B@link String#format%7D%0A   */%0A  public static final String P_STRING_FORMAT = %22stringFormat%22;%0A%0A  private boolean debug;%0A  private String stringFormat;%0A%0A  public boolean isDebug() %7B%0A    return debug;%0A  %7D%0A%0A  public void setDebug(boolean debug) %7B%0A    this.debug = debug;%0A  %7D%0A%0A  public String getStringFormat() %7B%0A    return stringFormat;%0A  %7D%0A%0A  public void setStringFormat(String stringFormat) %7B%0A    this.stringFormat = stringFormat;%0A  %7D%0A%0A  /**%0A   *%0A   * @param t the value of t%0A   */%0A  @Override%0A  public void process(Object t)%0A  %7B%0A    if (stringFormat != null) %7B%0A      t = String.format(stringFormat, t);%0A    %7D%0A    System.out.println(t);%0A    if (debug) %7B%0A       LOG.info(%22%22+t);%0A    %7D
 %0A  %7D

add debug support to console node