From: Sergey Kitov Date: Tue, 20 Mar 2018 08:46:19 +0000 (+0200) Subject: imap: Replace "if(mail_debug){i_debug}" with "e_debug" X-Git-Tag: 2.3.3.rc1~176 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79ecdaea8890b3757b9ff3a5941c6a234289f199;p=thirdparty%2Fdovecot%2Fcore.git imap: Replace "if(mail_debug){i_debug}" with "e_debug" --- diff --git a/src/imap/cmd-urlfetch.c b/src/imap/cmd-urlfetch.c index 0e9e92261f..65e50bf1a4 100644 --- a/src/imap/cmd-urlfetch.c +++ b/src/imap/cmd-urlfetch.c @@ -68,10 +68,9 @@ static bool cmd_urlfetch_cancel(struct client_command_context *cmd) return FALSE; if (ctx->ufetch != NULL) { - if (cmd->client->user->mail_debug) { - i_debug("URLFETCH: Canceling command; " - "aborting URLAUTH fetch requests prematurely"); - } + e_debug(cmd->client->event, + "URLFETCH: Canceling command; " + "aborting URLAUTH fetch requests prematurely"); imap_urlauth_fetch_deinit(&ctx->ufetch); } return TRUE; diff --git a/src/imap/imap-client-hibernate.c b/src/imap/imap-client-hibernate.c index 2e36f38b76..d85bad0d78 100644 --- a/src/imap/imap-client-hibernate.c +++ b/src/imap/imap-client-hibernate.c @@ -212,8 +212,8 @@ bool imap_client_hibernate(struct client **_client) "Couldn't export state: %s (mailbox=%s)", error, client->mailbox == NULL ? "" : mailbox_get_vname(client->mailbox)); - } else if (ret == 0 && client->user->mail_debug) { - i_debug("Couldn't hibernate imap client: " + } else if (ret == 0) { + e_debug(client->event, "Couldn't hibernate imap client: " "Couldn't export state: %s (mailbox=%s)", error, client->mailbox == NULL ? "" : mailbox_get_vname(client->mailbox)); @@ -222,11 +222,9 @@ bool imap_client_hibernate(struct client **_client) fd_notify = mailbox_watch_extract_notify_fd(client->mailbox, &error); if (fd_notify == -1) { - if (client->user->mail_debug) { - i_debug("Couldn't hibernate imap client: " - "Couldn't extract notifications fd: %s", - error); - } + e_debug(client->event, "Couldn't hibernate imap client: " + "Couldn't extract notifications fd: %s", + error); ret = -1; } } @@ -238,11 +236,10 @@ bool imap_client_hibernate(struct client **_client) if (ret > 0) { /* hide the disconnect log message, because the client didn't actually log out */ - if (client->user->mail_debug) { - i_debug("Successfully hibernated imap client in mailbox %s", - client->mailbox == NULL ? "" : - mailbox_get_vname(client->mailbox)); - } + e_debug(client->event, + "Successfully hibernated imap client in mailbox %s", + client->mailbox == NULL ? "" : + mailbox_get_vname(client->mailbox)); client->disconnected = TRUE; client->hibernated = TRUE; client_destroy(client, NULL); diff --git a/src/imap/imap-master-client.c b/src/imap/imap-master-client.c index 0f5b4020dc..8a65780d50 100644 --- a/src/imap/imap-master-client.c +++ b/src/imap/imap-master-client.c @@ -258,13 +258,15 @@ imap_master_client_input_args(struct connection *conn, const char *const *args, master_input.state_import_bad_idle_done; imap_client->state_import_idle_continue = master_input.state_import_idle_continue; - if (imap_client->user->mail_debug) { - if (imap_client->state_import_bad_idle_done) - i_debug("imap-master: Unhibernated because IDLE was stopped with BAD command"); - else if (imap_client->state_import_idle_continue) - i_debug("imap-master: Unhibernated to send mailbox changes"); - else - i_debug("imap-master: Unhibernated because IDLE was stopped with DONE"); + if (imap_client->state_import_bad_idle_done) { + e_debug(imap_client->event, + "imap-master: Unhibernated because IDLE was stopped with BAD command"); + } else if (imap_client->state_import_idle_continue) { + e_debug(imap_client->event, + "imap-master: Unhibernated to send mailbox changes"); + } else { + e_debug(imap_client->event, + "imap-master: Unhibernated because IDLE was stopped with DONE"); } ret = imap_state_import_internal(imap_client, master_input.state->data, @@ -281,10 +283,9 @@ imap_master_client_input_args(struct connection *conn, const char *const *args, /* make sure all pending input gets handled */ i_assert(imap_client->to_delayed_input == NULL); if (master_input.client_input->used > 0) { - if (imap_client->user->mail_debug) { - i_debug("imap-master: Pending client input: '%s'", - str_sanitize(str_c(master_input.client_input), 128)); - } + e_debug(imap_client->event, + "imap-master: Pending client input: '%s'", + str_sanitize(str_c(master_input.client_input), 128)); imap_client->to_delayed_input = timeout_add(0, client_input, imap_client); } diff --git a/src/imap/imap-state.c b/src/imap/imap-state.c index e2df34e586..edb6c15a2f 100644 --- a/src/imap/imap-state.c +++ b/src/imap/imap-state.c @@ -686,11 +686,10 @@ import_state_mailbox_open(struct client *client, status.highest_modseq)); client->sync_last_full_modseq = status.highest_modseq; } - if (client->user->mail_debug) { - i_debug("Unhibernation sync: %u expunges, %u new messages, %u flag changes, %"PRIu64" modseq changes", - expunge_count, new_mails_count, flag_change_count, - status.highest_modseq - state->highest_modseq); - } + e_debug(client->event, + "Unhibernation sync: %u expunges, %u new messages, %u flag changes, %"PRIu64" modseq changes", + expunge_count, new_mails_count, flag_change_count, + status.highest_modseq - state->highest_modseq); return 0; }