return new SinkBuilder() {
@Override
public EventSink build(Context context, String... args) {
Preconditions.checkArgument(args.length >= 1 && args.length <= 2,
"usage: text(filename[,format])");
OutputFormat fmt = DebugOutputFormat.builder().build();
if (args.length >= 2) {
try {
fmt = FormatFactory.get().getOutputFormat(args[1]);
} catch (FlumeSpecException e) {
LOG.error("Illegal output format " + args[1], e);