support emitting to stdout or stderr