]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Replace "if(mail_debug){i_debug}" with "e_debug"
authorSergey Kitov <sergey.kitov@open-xchange.com>
Tue, 20 Mar 2018 08:46:19 +0000 (10:46 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 7 Aug 2018 11:10:07 +0000 (14:10 +0300)
src/imap/cmd-urlfetch.c
src/imap/imap-client-hibernate.c
src/imap/imap-master-client.c
src/imap/imap-state.c

index 0e9e92261f9f5a6dd123b976c31020eb60749c97..65e50bf1a4ca1f9ab40a7f3e0358f621df7789e0 100644 (file)
@@ -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;
index 2e36f38b7662692224dd2fb524c3707a1c7a93dd..d85bad0d7817eaca0bc1ffa5d8e5012dc9f890f3 100644 (file)
@@ -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 ? "<none>" :
-                               mailbox_get_vname(client->mailbox));
-               }
+               e_debug(client->event,
+                       "Successfully hibernated imap client in mailbox %s",
+                       client->mailbox == NULL ? "<none>" :
+                       mailbox_get_vname(client->mailbox));
                client->disconnected = TRUE;
                client->hibernated = TRUE;
                client_destroy(client, NULL);
index 0f5b4020dc83d90874ed5bd0b2e0869e13df51c1..8a65780d50113d01028e711f541d9367c2783329 100644 (file)
@@ -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);
        }
index e2df34e586c90e0c42e8df860fa8f1e087f80133..edb6c15a2f0330882e4a02e72a656a5985fc5a82 100644 (file)
@@ -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;
 }