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:
Holger Weiss 2019-05-05 21:33:53 +02:00
parent 0bf94ba446
commit 34bf1a7d6c
1 changed files with 2 additions and 1 deletions

View File

@ -568,6 +568,7 @@ open_dump_file(Name, State) ->
Modes = [append, raw, binary, delayed_write],
case file:open(Name, Modes) of
{ok, Fd} ->
?DEBUG("Opened ~s", [Name]),
State#state{dump_fd = Fd};
{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}) ->
case file:close(Fd) of
ok ->
ok;
?DEBUG("Closed ~s", [Name]);
{error, Reason} ->
?ERROR_MSG("Cannot close ~s: ~s", [Name, file:format_error(Reason)])
end.