mod_spam_filter: Add some debug output
Log a [debug] line when the spam dump file is opened or closed.
This commit is contained in:
parent
0bf94ba446
commit
34bf1a7d6c
|
@ -568,6 +568,7 @@ open_dump_file(Name, State) ->
|
||||||
Modes = [append, raw, binary, delayed_write],
|
Modes = [append, raw, binary, delayed_write],
|
||||||
case file:open(Name, Modes) of
|
case file:open(Name, Modes) of
|
||||||
{ok, Fd} ->
|
{ok, Fd} ->
|
||||||
|
?DEBUG("Opened ~s", [Name]),
|
||||||
State#state{dump_fd = Fd};
|
State#state{dump_fd = Fd};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ERROR_MSG("Cannot open ~s: ~s", [Name, file:format_error(Reason)]),
|
?ERROR_MSG("Cannot open ~s: ~s", [Name, file:format_error(Reason)]),
|
||||||
|
@ -586,7 +587,7 @@ close_dump_file(_Name, #state{dump_fd = undefined}) ->
|
||||||
close_dump_file(Name, #state{dump_fd = Fd}) ->
|
close_dump_file(Name, #state{dump_fd = Fd}) ->
|
||||||
case file:close(Fd) of
|
case file:close(Fd) of
|
||||||
ok ->
|
ok ->
|
||||||
ok;
|
?DEBUG("Closed ~s", [Name]);
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
?ERROR_MSG("Cannot close ~s: ~s", [Name, file:format_error(Reason)])
|
?ERROR_MSG("Cannot close ~s: ~s", [Name, file:format_error(Reason)])
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue