summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-20 12:01:08 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-20 12:01:08 +0100
commitac28ddf16559b9cb0270c38637d3d5d0136548b7 (patch)
tree7067b5ae08a8c3bd5554a979ecfc5cac48adf46f
parent457221a521edfce0b1599b1d403cd21aa4a56387 (diff)
downloadrabbitmq-server-git-ac28ddf16559b9cb0270c38637d3d5d0136548b7.tar.gz
Make log messages prettier
-rw-r--r--src/rabbit_mirror_queue_coordinator.erl7
-rw-r--r--src/rabbit_mirror_queue_slave.erl12
2 files changed, 11 insertions, 8 deletions
diff --git a/src/rabbit_mirror_queue_coordinator.erl b/src/rabbit_mirror_queue_coordinator.erl
index 729749dc48..8ddda1cd43 100644
--- a/src/rabbit_mirror_queue_coordinator.erl
+++ b/src/rabbit_mirror_queue_coordinator.erl
@@ -256,9 +256,10 @@ handle_call(get_gm, _From, State = #state { gm = GM }) ->
handle_cast({gm_deaths, Deaths},
State = #state { q = #amqqueue { name = QueueName } }) ->
- rabbit_log:info("Master ~p saw deaths ~p for ~s~n",
- [self(), [{Pid, node(Pid)} || Pid <- Deaths],
- rabbit_misc:rs(QueueName)]),
+ rabbit_log:info("Mirrored-queue (~s): Master ~s saw deaths of mirrors ~s~n",
+ [rabbit_misc:rs(QueueName),
+ rabbit_misc:pid_to_string(self()),
+ [[rabbit_misc:pid_to_string(Pid), $ ] || Pid <- Deaths]]),
case rabbit_mirror_queue_misc:remove_from_queue(QueueName, Deaths) of
{ok, Pid} when node(Pid) =:= node() ->
noreply(State);
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl
index da01e0764b..fc50c93294 100644
--- a/src/rabbit_mirror_queue_slave.erl
+++ b/src/rabbit_mirror_queue_slave.erl
@@ -143,9 +143,10 @@ handle_call({gm_deaths, Deaths}, From,
State = #state { q = #amqqueue { name = QueueName },
gm = GM,
master_node = MNode }) ->
- rabbit_log:info("Slave ~p saw deaths ~p for ~s~n",
- [self(), [{Pid, node(Pid)} || Pid <- Deaths],
- rabbit_misc:rs(QueueName)]),
+ rabbit_log:info("Mirrored-queue (~s): Slave ~s saw deaths of mirrors ~s~n",
+ [rabbit_misc:rs(QueueName),
+ rabbit_misc:pid_to_string(self()),
+ [[rabbit_misc:pid_to_string(Pid), $ ] || Pid <- Deaths]]),
%% The GM has told us about deaths, which means we're not going to
%% receive any more messages from GM
case rabbit_mirror_queue_misc:remove_from_queue(QueueName, Deaths) of
@@ -392,8 +393,9 @@ promote_me(From, #state { q = Q,
sender_queues = SQ,
msg_id_ack = MA,
msg_id_status = MS }) ->
- rabbit_log:info("Promoting slave ~p for ~s~n",
- [self(), rabbit_misc:rs(Q #amqqueue.name)]),
+ rabbit_log:info("Mirrored-queue (~s): Promoting slave ~s to master~n",
+ [rabbit_misc:rs(Q #amqqueue.name),
+ rabbit_misc:pid_to_string(self())]),
{ok, CPid} = rabbit_mirror_queue_coordinator:start_link(Q, GM),
true = unlink(GM),
gen_server2:reply(From, {promote, CPid}),