From 34bf1a7d6cd6b5e4175d48f33b3b7a464457e1ee Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 5 May 2019 21:33:53 +0200 Subject: [PATCH] mod_spam_filter: Add some debug output Log a [debug] line when the spam dump file is opened or closed. --- mod_spam_filter/src/mod_spam_filter.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod_spam_filter/src/mod_spam_filter.erl b/mod_spam_filter/src/mod_spam_filter.erl index 58833f2..12a8442 100644 --- a/mod_spam_filter/src/mod_spam_filter.erl +++ b/mod_spam_filter/src/mod_spam_filter.erl @@ -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.