Log lines as list instead of binary
This commit is contained in:
parent
1e26998649
commit
d5136c731c
1
TODO.md
1
TODO.md
|
@ -1,6 +1,5 @@
|
|||
TODO
|
||||
=====
|
||||
|
||||
- gatherer.erl:29 Error on ++.
|
||||
- Limit number of emails that can be sent in a period of time.
|
||||
- gen_fsm for gatherer?
|
||||
|
|
|
@ -26,9 +26,9 @@ handle_info({log_line, Text}, [on, Log = #log{error_regex = ErrorRegex}, Error,
|
|||
true ->
|
||||
timer:cancel(Timer),
|
||||
{ok, NewTimer} = timer:send_after(1000, {timeout}),
|
||||
{noreply, [on, Log, Error ++ "\n" ++ Text, NewTimer, SafeTimer]};
|
||||
{noreply, [on, Log, Error ++ Text, NewTimer, SafeTimer]};
|
||||
false ->
|
||||
{noreply, [on, Log, Error ++ "\n" ++ Text, Timer, SafeTimer]}
|
||||
{noreply, [on, Log, Error ++ Text, Timer, SafeTimer]}
|
||||
end;
|
||||
handle_info({timeout}, [on, Log = #log{file = File}, Error, Timer, SafeTimer]) ->
|
||||
timer:cancel(Timer),
|
||||
|
|
|
@ -19,7 +19,7 @@ handle_info(Msg, [File, SupPid, Port]) ->
|
|||
case Msg of
|
||||
{Port, {data, Text}} ->
|
||||
GathererPid = gatherer_pid(SupPid),
|
||||
GathererPid ! {log_line, Text},
|
||||
GathererPid ! {log_line, binary_to_list(Text)},
|
||||
{noreply, [File, SupPid, Port]};
|
||||
{Port, {exit_status, _Status}} ->
|
||||
{stop, tail_exit, [File]}
|
||||
|
|
Loading…
Reference in New Issue
Block a user