Skip to content

Commit

Permalink
log: Avoid unnecessary global log prefix changes
Browse files Browse the repository at this point in the history
If the context specifies a log prefix, the global prefix isn't going to be
used.
  • Loading branch information
sirainen authored and villesavolainen committed Sep 7, 2018
1 parent f39897d commit 8019654
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/log/log-connection.c
Expand Up @@ -144,9 +144,13 @@ client_log_ctx(struct log_connection *log,
log_error_buffer_add(log->errorbuf, &err);
break;
}
i_set_failure_prefix("%s", prefix);
/* log_prefix overrides the global prefix. Don't bother changing the
global prefix in that case. */
if (ctx->log_prefix == NULL)
i_set_failure_prefix("%s", prefix);
i_log_type(ctx, "%s", text);
i_set_failure_prefix("%s", global_log_prefix);
if (ctx->log_prefix == NULL)
i_set_failure_prefix("%s", global_log_prefix);
}

static void
Expand Down

0 comments on commit 8019654

Please sign in to comment.