]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: test-smtp-server-errors: Add log prefixes for client and server.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 8 Apr 2018 13:24:02 +0000 (15:24 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 27 Apr 2018 10:40:00 +0000 (13:40 +0300)
Makes it easier to distinguish which process is sending a log message while
debugging.

src/lib-smtp/test-smtp-server-errors.c

index 1407242bca5b4d93bfcebe4d680c7765d192ecd1..d1bddbcd9f6a4b5999ac0b0c667d3a2ab56c5fa8 100644 (file)
@@ -1502,6 +1502,8 @@ static void test_run_client_server(
 {
        unsigned int i;
 
+       i_set_failure_prefix("SERVER: ");
+
        client_pids = NULL;
        client_pids_count = 0;
 
@@ -1519,9 +1521,10 @@ static void test_run_client_server(
                        if (client_pids[i] == 0) {
                                client_pids[i] = (pid_t)-1;
                                client_pids_count = 0;
+                               i_set_failure_prefix("CLIENT[%d]: ", i+1);
                                hostpid_init();
                                if (debug)
-                                       i_debug("client[%d]: PID=%s", i+1, my_pid);
+                                       i_debug("PID=%s", my_pid);
                                /* child: client */
                                usleep(100000); /* wait a little for server setup */
                                i_close_fd(&fd_listen);
@@ -1537,7 +1540,7 @@ static void test_run_client_server(
                        }
                }
                if (debug)
-                       i_debug("server: PID=%s", my_pid);
+                       i_debug("PID=%s", my_pid);
        }
 
        /* parent: server */