summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2011-05-19 20:10:27 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2011-05-19 20:10:27 +0100
commit51c608f6bc85959559b94eebb3bf02c6e91fd138 (patch)
treeaeb5abf70a5f699535973db921f6aea8d3427ac6
parentc86418efd720f04ceaa2ee3b208688e179039929 (diff)
downloadrabbitmq-server-51c608f6bc85959559b94eebb3bf02c6e91fd138.tar.gz
cosmetic
-rw-r--r--src/rabbit_trace.erl34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/rabbit_trace.erl b/src/rabbit_trace.erl
index 9543f8de..267b1d40 100644
--- a/src/rabbit_trace.erl
+++ b/src/rabbit_trace.erl
@@ -38,35 +38,35 @@
init(VHost) ->
case application:get_env(rabbit, trace_exchanges) of
undefined -> none;
- {ok, Xs} -> case proplists:get_value(VHost, Xs, none) of
+ {ok, XNs} -> case proplists:get_value(VHost, XNs, none) of
none -> none;
- XN -> rabbit_misc:r(VHost, exchange, XN)
+ Name -> rabbit_misc:r(VHost, exchange, Name)
end
end.
-tap_trace_in(Msg, TraceX) ->
- maybe_trace(Msg, TraceX, <<"publish">>, xname(Msg), []).
+tap_trace_in(Msg, TraceXN) ->
+ maybe_trace(Msg, TraceXN, <<"publish">>, xname(Msg), []).
tap_trace_out({#resource{name = QName}, _QPid, _QMsgId, Redelivered, Msg},
- TraceX) ->
+ TraceXN) ->
RedeliveredNum = case Redelivered of true -> 1; false -> 0 end,
- maybe_trace(Msg, TraceX, <<"deliver">>, QName,
+ maybe_trace(Msg, TraceXN, <<"deliver">>, QName,
[{<<"redelivered">>, signedint, RedeliveredNum}]).
maybe_trace(_Msg, none, _RKPrefix, _RKSuffix, _Extra) ->
ok;
-maybe_trace(Msg, X, RKPrefix, RKSuffix, Extra) ->
+maybe_trace(Msg, XN, RKPrefix, RKSuffix, Extra) ->
case xname(Msg) of
- X -> ok;
- _ -> case rabbit_basic:publish(
- X,
- <<RKPrefix/binary, ".", RKSuffix/binary>>,
- #'P_basic'{headers = msg_to_table(Msg) ++ Extra},
- payload(Msg)) of
- {ok, _, _} -> ok;
- {error, not_found} -> rabbit_log:info("trace ~s not found~n",
- [rabbit_misc:rs(X)])
- end
+ XN -> ok;
+ _ -> case rabbit_basic:publish(
+ XN,
+ <<RKPrefix/binary, ".", RKSuffix/binary>>,
+ #'P_basic'{headers = msg_to_table(Msg) ++ Extra},
+ payload(Msg)) of
+ {ok, _, _} -> ok;
+ {error, not_found} -> rabbit_log:info("trace ~s not found~n",
+ [rabbit_misc:rs(XN)])
+ end
end.
xname(#basic_message{exchange_name = #resource{name = XName}}) -> XName.