restructure to be a littel more flexible
[lwes-erlang/github-mirror.git] / src / lwes_emitter_stdout.erl
blob22935f043fc5a937876bf6c5acd4bdcd3d000680
1 -module (lwes_emitter_stdout).
3 -behaviour (lwes_emitter).
5 -export ([ new/1,
6 id/1,
7 prep/1,
8 emit/2,
9 close/1
10 ]).
12 -record (lwes_emitter_stdout, {config}).
14 new (Config) ->
15 #lwes_emitter_stdout { config = Config }.
17 id(#lwes_emitter_stdout {config = [{label,B}]}) ->
20 prep (Event) ->
21 lwes_event:to_binary(Event).
23 emit (L, Event) when is_list(L) ->
24 [ emit(E, Event) || E <- L ];
25 emit (#lwes_emitter_stdout {}, E) ->
26 io:format("Emit event ~p for ~p~n",[E,?MODULE]),
27 ok.
29 close (#lwes_emitter_stdout {}) ->
30 ok.