[skip ci] Replace logger: calls is LOG_ macros
This commit is contained in:
parent
175ba70e8c
commit
b6b766cac7
|
@ -12,6 +12,7 @@
|
|||
-include("amqp10_client_internal.hrl").
|
||||
-include_lib("amqp10_common/include/amqp10_framing.hrl").
|
||||
-include_lib("amqp10_common/include/amqp10_types.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
%% public API
|
||||
-export([open/1,
|
||||
|
@ -247,7 +248,7 @@ hdr_sent(_EvtType, {protocol_header_received, 0, 1, 0, 0}, State) ->
|
|||
end;
|
||||
hdr_sent(_EvtType, {protocol_header_received, Protocol, Maj, Min,
|
||||
Rev}, State) ->
|
||||
logger:warning("Unsupported protocol version: ~b ~b.~b.~b",
|
||||
?LOG_WARNING("Unsupported protocol version: ~b ~b.~b.~b",
|
||||
[Protocol, Maj, Min, Rev]),
|
||||
{stop, normal, State};
|
||||
hdr_sent({call, From}, begin_session,
|
||||
|
@ -342,7 +343,7 @@ opened(info, {'DOWN', MRef, process, _, _Info},
|
|||
ok = notify_closed(Config, shutdown),
|
||||
{stop, normal};
|
||||
opened(_EvtType, Frame, State) ->
|
||||
logger:warning("Unexpected connection frame ~tp when in state ~tp ",
|
||||
?LOG_WARNING("Unexpected connection frame ~tp when in state ~tp ",
|
||||
[Frame, State]),
|
||||
keep_state_and_data.
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
-include("amqp10_client_internal.hrl").
|
||||
-include_lib("amqp10_common/include/amqp10_framing.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
@ -141,32 +142,32 @@ handle_event(info, {gun_ws, WsPid, StreamRef, WsFrame}, StateName,
|
|||
{binary, Bin} ->
|
||||
handle_socket_input(Bin, StateName, State);
|
||||
close ->
|
||||
logger:info("peer closed AMQP over WebSocket connection in state '~s'",
|
||||
?LOG_INFO("peer closed AMQP over WebSocket connection in state '~s'",
|
||||
[StateName]),
|
||||
{stop, normal, socket_closed(State)};
|
||||
{close, ReasonStatusCode, ReasonUtf8} ->
|
||||
logger:info("peer closed AMQP over WebSocket connection in state '~s', reason: ~b ~ts",
|
||||
?LOG_INFO("peer closed AMQP over WebSocket connection in state '~s', reason: ~b ~ts",
|
||||
[StateName, ReasonStatusCode, ReasonUtf8]),
|
||||
{stop, {shutdown, {ReasonStatusCode, ReasonUtf8}}, socket_closed(State)}
|
||||
end;
|
||||
handle_event(info, {TcpError, _Sock, Reason}, StateName, State)
|
||||
when TcpError == tcp_error orelse TcpError == ssl_error ->
|
||||
logger:warning("AMQP 1.0 connection socket errored, connection state: '~ts', reason: '~tp'",
|
||||
?LOG_WARNING("AMQP 1.0 connection socket errored, connection state: '~ts', reason: '~tp'",
|
||||
[StateName, Reason]),
|
||||
{stop, {error, Reason}, socket_closed(State)};
|
||||
handle_event(info, {TcpClosed, _}, StateName, State)
|
||||
when TcpClosed == tcp_closed orelse TcpClosed == ssl_closed ->
|
||||
logger:info("AMQP 1.0 connection socket was closed, connection state: '~ts'",
|
||||
?LOG_INFO("AMQP 1.0 connection socket was closed, connection state: '~ts'",
|
||||
[StateName]),
|
||||
{stop, normal, socket_closed(State)};
|
||||
handle_event(info, {gun_down, WsPid, _Proto, Reason, _Streams}, StateName,
|
||||
#state{socket = {ws, WsPid, _StreamRef}} = State) ->
|
||||
logger:warning("AMQP over WebSocket process ~p lost connection in state: '~s': ~p",
|
||||
?LOG_WARNING("AMQP over WebSocket process ~p lost connection in state: '~s': ~p",
|
||||
[WsPid, StateName, Reason]),
|
||||
{stop, Reason, socket_closed(State)};
|
||||
handle_event(info, {'DOWN', _Mref, process, WsPid, Reason}, StateName,
|
||||
#state{socket = {ws, WsPid, _StreamRef}} = State) ->
|
||||
logger:warning("AMQP over WebSocket process ~p terminated in state: '~s': ~p",
|
||||
?LOG_WARNING("AMQP over WebSocket process ~p terminated in state: '~s': ~p",
|
||||
[WsPid, StateName, Reason]),
|
||||
{stop, Reason, socket_closed(State)};
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
% -define(debug, true).
|
||||
-ifdef(debug).
|
||||
-define(DBG(F, A), error_logger:info_msg(F, A)).
|
||||
-define(DBG(F, A), error_?LOG_INFO_msg(F, A)).
|
||||
-else.
|
||||
-define(DBG(F, A), ok).
|
||||
-endif.
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
-include("amqp10_client_internal.hrl").
|
||||
-include_lib("amqp10_common/include/amqp10_framing.hrl").
|
||||
-include_lib("amqp10_common/include/amqp10_types.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
%% Public API.
|
||||
-export(['begin'/1,
|
||||
|
@ -434,7 +435,7 @@ mapped(cast, {Transfer0 = #'v1_0.transfer'{handle = {uint, InHandle}},
|
|||
notify_credit_exhausted(Link3),
|
||||
{keep_state, State};
|
||||
{transfer_limit_exceeded, Link3, State} ->
|
||||
logger:warning("transfer_limit_exceeded for link ~tp", [Link3]),
|
||||
?LOG_WARNING("transfer_limit_exceeded for link ~tp", [Link3]),
|
||||
Link = detach_with_error_cond(Link3,
|
||||
State,
|
||||
?V_1_0_LINK_ERROR_TRANSFER_LIMIT_EXCEEDED,
|
||||
|
@ -446,7 +447,7 @@ mapped(cast, {Transfer0 = #'v1_0.transfer'{handle = {uint, InHandle}},
|
|||
io_lib:format(
|
||||
"~s checksum error: expected ~b, actual ~b",
|
||||
[FooterOpt, Expected, Actual])),
|
||||
logger:warning("deteaching link ~tp due to ~s", [Link2, Description]),
|
||||
?LOG_WARNING("deteaching link ~tp due to ~s", [Link2, Description]),
|
||||
Link = detach_with_error_cond(Link2,
|
||||
State0,
|
||||
?V_1_0_AMQP_ERROR_DECODE_ERROR,
|
||||
|
@ -485,7 +486,7 @@ mapped(cast, #'v1_0.disposition'{role = true,
|
|||
|
||||
{keep_state, State#state{outgoing_unsettled = Unsettled}};
|
||||
mapped(cast, Frame, State) ->
|
||||
logger:warning("Unhandled session frame ~tp in state ~tp",
|
||||
?LOG_WARNING("Unhandled session frame ~tp in state ~tp",
|
||||
[Frame, State]),
|
||||
{keep_state, State};
|
||||
mapped({call, From},
|
||||
|
@ -566,7 +567,7 @@ mapped({call, From}, Msg, State) ->
|
|||
{keep_state, State1, {reply, From, Reply}};
|
||||
|
||||
mapped(_EvtType, Msg, _State) ->
|
||||
logger:warning("amqp10_session: unhandled msg in mapped state ~W",
|
||||
?LOG_WARNING("amqp10_session: unhandled msg in mapped state ~W",
|
||||
[Msg, 10]),
|
||||
keep_state_and_data.
|
||||
|
||||
|
@ -1375,6 +1376,7 @@ format_status(Status = #{data := Data0}) ->
|
|||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
handle_session_flow_test() ->
|
||||
% see spec section: 2.5.6 for logic
|
||||
|
|
|
@ -14,11 +14,6 @@
|
|||
|
||||
-define(MAX_CHANNEL_NUMBER, 65535).
|
||||
|
||||
-define(LOG_DEBUG(Format), error_logger:info_msg(Format)).
|
||||
-define(LOG_INFO(Format, Args), error_logger:info_msg(Format, Args)).
|
||||
-define(LOG_WARN(Format, Args), error_logger:warning_msg(Format, Args)).
|
||||
-define(LOG_ERR(Format, Args), error_logger:error_msg(Format, Args)).
|
||||
|
||||
-define(CLIENT_CAPABILITIES,
|
||||
[{<<"publisher_confirms">>, bool, true},
|
||||
{<<"exchange_exchange_bindings">>, bool, true},
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
-module(amqp_channel).
|
||||
|
||||
-include("amqp_client_internal.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-behaviour(gen_server).
|
||||
|
||||
|
@ -514,7 +515,7 @@ handle_info({bump_credit, Msg}, State) ->
|
|||
{noreply, State};
|
||||
%% @private
|
||||
handle_info(timed_out_flushing_channel, State) ->
|
||||
?LOG_WARN("Channel (~tp) closing: timed out flushing while "
|
||||
?LOG_WARNING("Channel (~tp) closing: timed out flushing while "
|
||||
"connection closing", [self()]),
|
||||
{stop, timed_out_flushing_channel, State};
|
||||
%% @private
|
||||
|
@ -523,7 +524,7 @@ handle_info({'DOWN', _, process, ReturnHandler, shutdown},
|
|||
{noreply, State#state{return_handler = none}};
|
||||
handle_info({'DOWN', _, process, ReturnHandler, Reason},
|
||||
State = #state{return_handler = {ReturnHandler, _Ref}}) ->
|
||||
?LOG_WARN("Channel (~tp): Unregistering return handler ~tp because it died. "
|
||||
?LOG_WARNING("Channel (~tp): Unregistering return handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), ReturnHandler, Reason]),
|
||||
{noreply, State#state{return_handler = none}};
|
||||
%% @private
|
||||
|
@ -532,7 +533,7 @@ handle_info({'DOWN', _, process, ConfirmHandler, shutdown},
|
|||
{noreply, State#state{confirm_handler = none}};
|
||||
handle_info({'DOWN', _, process, ConfirmHandler, Reason},
|
||||
State = #state{confirm_handler = {ConfirmHandler, _Ref}}) ->
|
||||
?LOG_WARN("Channel (~tp): Unregistering confirm handler ~tp because it died. "
|
||||
?LOG_WARNING("Channel (~tp): Unregistering confirm handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), ConfirmHandler, Reason]),
|
||||
{noreply, State#state{confirm_handler = none}};
|
||||
%% @private
|
||||
|
@ -541,7 +542,7 @@ handle_info({'DOWN', _, process, FlowHandler, shutdown},
|
|||
{noreply, State#state{flow_handler = none}};
|
||||
handle_info({'DOWN', _, process, FlowHandler, Reason},
|
||||
State = #state{flow_handler = {FlowHandler, _Ref}}) ->
|
||||
?LOG_WARN("Channel (~tp): Unregistering flow handler ~tp because it died. "
|
||||
?LOG_WARNING("Channel (~tp): Unregistering flow handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), FlowHandler, Reason]),
|
||||
{noreply, State#state{flow_handler = none}};
|
||||
handle_info({'DOWN', _, process, QPid, _Reason}, State) ->
|
||||
|
@ -591,13 +592,13 @@ handle_method_to_server(Method, AmqpMsg, From, Sender, Flow,
|
|||
{noreply, rpc_top_half(Method, build_content(AmqpMsg),
|
||||
From, Sender, Flow, State1)};
|
||||
{ok, none, BlockReply} ->
|
||||
?LOG_WARN("Channel (~tp): discarding method ~tp in cast.~n"
|
||||
?LOG_WARNING("Channel (~tp): discarding method ~tp in cast.~n"
|
||||
"Reason: ~tp", [self(), Method, BlockReply]),
|
||||
{noreply, State};
|
||||
{ok, _, BlockReply} ->
|
||||
{reply, BlockReply, State};
|
||||
{{_, InvalidMethodMessage}, none, _} ->
|
||||
?LOG_WARN("Channel (~tp): ignoring cast of ~tp method. " ++
|
||||
?LOG_WARNING("Channel (~tp): ignoring cast of ~tp method. " ++
|
||||
InvalidMethodMessage ++ "", [self(), Method]),
|
||||
{noreply, State};
|
||||
{{InvalidMethodReply, _}, _, _} ->
|
||||
|
@ -779,7 +780,7 @@ handle_method_from_server1(
|
|||
#'basic.return'{} = BasicReturn, AmqpMsg,
|
||||
State = #state{return_handler = ReturnHandler}) ->
|
||||
_ = case ReturnHandler of
|
||||
none -> ?LOG_WARN("Channel (~tp): received {~tp, ~tp} but there is "
|
||||
none -> ?LOG_WARNING("Channel (~tp): received {~tp, ~tp} but there is "
|
||||
"no return handler registered",
|
||||
[self(), BasicReturn, AmqpMsg]);
|
||||
{Pid, _Ref} -> Pid ! {BasicReturn, AmqpMsg}
|
||||
|
@ -794,7 +795,7 @@ handle_method_from_server1(#'basic.ack'{} = BasicAck, none,
|
|||
{noreply, update_confirm_set(BasicAck, State)};
|
||||
handle_method_from_server1(#'basic.nack'{} = BasicNack, none,
|
||||
#state{confirm_handler = none} = State) ->
|
||||
?LOG_WARN("Channel (~tp): received ~tp but there is no "
|
||||
?LOG_WARNING("Channel (~tp): received ~tp but there is no "
|
||||
"confirm handler registered", [self(), BasicNack]),
|
||||
{noreply, update_confirm_set(BasicNack, State)};
|
||||
handle_method_from_server1(#'basic.nack'{} = BasicNack, none,
|
||||
|
@ -834,7 +835,7 @@ handle_connection_closing(CloseType, Reason,
|
|||
handle_channel_exit(Reason = #amqp_error{name = ErrorName, explanation = Expl},
|
||||
State = #state{connection = Connection, number = Number}) ->
|
||||
%% Sent by rabbit_channel for hard errors in the direct case
|
||||
?LOG_ERR("connection ~tp, channel ~tp - error:~n~tp",
|
||||
?LOG_ERROR("connection ~tp, channel ~tp - error:~n~tp",
|
||||
[Connection, Number, Reason]),
|
||||
{true, Code, _} = ?PROTOCOL:lookup_amqp_exception(ErrorName),
|
||||
ReportedReason = {server_initiated_close, Code, Expl},
|
||||
|
@ -930,7 +931,7 @@ server_misbehaved(#amqp_error{} = AmqpError, State = #state{number = Number}) ->
|
|||
{0, _} ->
|
||||
handle_shutdown({server_misbehaved, AmqpError}, State);
|
||||
{_, Close} ->
|
||||
?LOG_WARN("Channel (~tp) flushing and closing due to soft "
|
||||
?LOG_WARNING("Channel (~tp) flushing and closing due to soft "
|
||||
"error caused by the server ~tp", [self(), AmqpError]),
|
||||
Self = self(),
|
||||
spawn(fun () -> call(Self, Close) end),
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
-module(amqp_channels_manager).
|
||||
|
||||
-include("amqp_client_internal.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-behaviour(gen_server).
|
||||
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
-module(amqp_connection).
|
||||
|
||||
-include("amqp_client_internal.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([open_channel/1, open_channel/2, open_channel/3, register_blocked_handler/2]).
|
||||
-export([start/1, start/2, close/1, close/2, close/3, close/4]).
|
||||
|
@ -427,7 +428,7 @@ maybe_update_call_timeout(BaseTimeout, CallTimeout)
|
|||
ok;
|
||||
maybe_update_call_timeout(BaseTimeout, CallTimeout) ->
|
||||
EffectiveSafeCallTimeout = amqp_util:safe_call_timeout(BaseTimeout),
|
||||
?LOG_WARN("AMQP 0-9-1 client call timeout was ~tp ms, is updated to a safe effective "
|
||||
?LOG_WARNING("AMQP 0-9-1 client call timeout was ~tp ms, is updated to a safe effective "
|
||||
"value of ~tp ms", [CallTimeout, EffectiveSafeCallTimeout]),
|
||||
amqp_util:update_call_timeout(EffectiveSafeCallTimeout),
|
||||
ok.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
-module(amqp_direct_connection).
|
||||
|
||||
-include("amqp_client_internal.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-behaviour(amqp_gen_connection).
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
-module(amqp_gen_connection).
|
||||
|
||||
-include("amqp_client_internal.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-behaviour(gen_server).
|
||||
|
||||
|
@ -191,7 +192,7 @@ handle_cast(channels_terminated, State) ->
|
|||
handle_cast({hard_error_in_channel, _Pid, Reason}, State) ->
|
||||
server_initiated_close(Reason, State);
|
||||
handle_cast({channel_internal_error, Pid, Reason}, State) ->
|
||||
?LOG_WARN("Connection (~tp) closing: internal error in channel (~tp): ~tp",
|
||||
?LOG_WARNING("Connection (~tp) closing: internal error in channel (~tp): ~tp",
|
||||
[self(), Pid, Reason]),
|
||||
internal_error(Pid, Reason, State);
|
||||
handle_cast({server_misbehaved, AmqpError}, State) ->
|
||||
|
@ -205,12 +206,12 @@ handle_cast({register_blocked_handler, HandlerPid}, State) ->
|
|||
%% @private
|
||||
handle_info({'DOWN', _, process, BlockHandler, Reason},
|
||||
State = #state{block_handler = {BlockHandler, _Ref}}) ->
|
||||
?LOG_WARN("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
?LOG_WARNING("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
{noreply, State#state{block_handler = none}};
|
||||
handle_info({'EXIT', BlockHandler, Reason},
|
||||
State = #state{block_handler = {BlockHandler, Ref}}) ->
|
||||
?LOG_WARN("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
?LOG_WARNING("Connection (~tp): Unregistering connection.{blocked,unblocked} handler ~tp because it died. "
|
||||
"Reason: ~tp", [self(), BlockHandler, Reason]),
|
||||
erlang:demonitor(Ref, [flush]),
|
||||
{noreply, State#state{block_handler = none}};
|
||||
|
@ -316,13 +317,13 @@ internal_error(Pid, Reason, State) ->
|
|||
State).
|
||||
|
||||
server_initiated_close(Close, State) ->
|
||||
?LOG_WARN("Connection (~tp) closing: received hard error ~tp "
|
||||
?LOG_WARNING("Connection (~tp) closing: received hard error ~tp "
|
||||
"from server", [self(), Close]),
|
||||
set_closing_state(abrupt, #closing{reason = server_initiated_close,
|
||||
close = Close}, State).
|
||||
|
||||
server_misbehaved_close(AmqpError, State) ->
|
||||
?LOG_WARN("Connection (~tp) closing: server misbehaved: ~tp",
|
||||
?LOG_WARNING("Connection (~tp) closing: server misbehaved: ~tp",
|
||||
[self(), AmqpError]),
|
||||
{0, Close} = rabbit_binary_generator:map_exception(0, AmqpError, ?PROTOCOL),
|
||||
set_closing_state(abrupt, #closing{reason = server_misbehaved,
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
-include("amqp_client_internal.hrl").
|
||||
|
||||
-include_lib("public_key/include/public_key.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([maybe_enhance_ssl_options/1,
|
||||
verify_fun/3]).
|
||||
|
@ -51,7 +52,7 @@ maybe_add_verify1(Options) ->
|
|||
% NB: user has explicitly set 'verify'
|
||||
Options;
|
||||
_ ->
|
||||
?LOG_WARN("Connection (~tp): certificate chain verification is not enabled for this TLS connection. "
|
||||
?LOG_WARNING("Connection (~tp): certificate chain verification is not enabled for this TLS connection. "
|
||||
"Please see https://rabbitmq.com/ssl.html for more information.", [self()]),
|
||||
Options
|
||||
end.
|
||||
|
|
|
@ -1112,7 +1112,7 @@ init([AlarmSet, AlarmClear]) ->
|
|||
end
|
||||
end,
|
||||
ObtainLimit = obtain_limit(Limit),
|
||||
logger:info("Limiting to approx ~tp file handles (~tp sockets)",
|
||||
?LOG_INFO("Limiting to approx ~tp file handles (~tp sockets)",
|
||||
[Limit, ObtainLimit]),
|
||||
Clients = ets:new(?CLIENT_ETS_TABLE, [set, private, {keypos, #cstate.pid}]),
|
||||
Elders = ets:new(?ELDERS_ETS_TABLE, [set, private]),
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
%%
|
||||
-module(pg_local).
|
||||
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([join/2, leave/2, get_members/1, in_group/2]).
|
||||
%% intended for testing only; not part of official API
|
||||
-export([sync/0, clear/0]).
|
||||
|
@ -120,7 +122,7 @@ handle_call(clear, _From, S) ->
|
|||
{reply, ok, S};
|
||||
|
||||
handle_call(Request, From, S) ->
|
||||
error_logger:warning_msg("The pg_local server received an unexpected message:\n"
|
||||
?LOG_WARNING("The pg_local server received an unexpected message:\n"
|
||||
"handle_call(~tp, ~tp, _)\n",
|
||||
[Request, From]),
|
||||
{noreply, S}.
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
-include_lib("kernel/include/logger.hrl").
|
||||
%% Set to true to get an awful lot of debug logs.
|
||||
-if(false).
|
||||
-define(DEBUG(X,Y), logger:debug("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-define(DEBUG(X,Y), ?LOG_DEBUG("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-else.
|
||||
-define(DEBUG(X,Y), _ = X, _ = Y, ok).
|
||||
-endif.
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
%% Set to true to get an awful lot of debug logs.
|
||||
-if(false).
|
||||
-define(DEBUG(X,Y), logger:debug("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-define(DEBUG(X,Y), ?LOG_DEBUG("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-else.
|
||||
-define(DEBUG(X,Y), _ = X, _ = Y, ok).
|
||||
-endif.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include_lib("rabbit_common/include/logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -30,7 +31,7 @@ debug(Format, Args) -> debug(self(), Format, Args).
|
|||
|
||||
-spec debug(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec info(string()) -> 'ok'.
|
||||
|
@ -41,7 +42,7 @@ info(Format, Args) -> info(self(), Format, Args).
|
|||
|
||||
-spec info(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec notice(string()) -> 'ok'.
|
||||
|
@ -52,7 +53,7 @@ notice(Format, Args) -> notice(self(), Format, Args).
|
|||
|
||||
-spec notice(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec warning(string()) -> 'ok'.
|
||||
|
@ -63,7 +64,7 @@ warning(Format, Args) -> warning(self(), Format, Args).
|
|||
|
||||
-spec warning(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec error(string()) -> 'ok'.
|
||||
|
@ -74,7 +75,7 @@ error(Format, Args) -> error(self(), Format, Args).
|
|||
|
||||
-spec error(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec critical(string()) -> 'ok'.
|
||||
|
@ -85,7 +86,7 @@ critical(Format, Args) -> critical(self(), Format, Args).
|
|||
|
||||
-spec critical(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec alert(string()) -> 'ok'.
|
||||
|
@ -96,7 +97,7 @@ alert(Format, Args) -> alert(self(), Format, Args).
|
|||
|
||||
-spec alert(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec emergency(string()) -> 'ok'.
|
||||
|
@ -107,7 +108,7 @@ emergency(Format, Args) -> emergency(self(), Format, Args).
|
|||
|
||||
-spec emergency(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CHAN}).
|
||||
|
||||
-spec none(string()) -> 'ok'.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include_lib("rabbit_common/include/logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -30,7 +31,7 @@ debug(Format, Args) -> debug(self(), Format, Args).
|
|||
|
||||
-spec debug(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec info(string()) -> 'ok'.
|
||||
|
@ -41,7 +42,7 @@ info(Format, Args) -> info(self(), Format, Args).
|
|||
|
||||
-spec info(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec notice(string()) -> 'ok'.
|
||||
|
@ -52,7 +53,7 @@ notice(Format, Args) -> notice(self(), Format, Args).
|
|||
|
||||
-spec notice(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec warning(string()) -> 'ok'.
|
||||
|
@ -63,7 +64,7 @@ warning(Format, Args) -> warning(self(), Format, Args).
|
|||
|
||||
-spec warning(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec error(string()) -> 'ok'.
|
||||
|
@ -74,7 +75,7 @@ error(Format, Args) -> error(self(), Format, Args).
|
|||
|
||||
-spec error(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec critical(string()) -> 'ok'.
|
||||
|
@ -85,7 +86,7 @@ critical(Format, Args) -> critical(self(), Format, Args).
|
|||
|
||||
-spec critical(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec alert(string()) -> 'ok'.
|
||||
|
@ -96,7 +97,7 @@ alert(Format, Args) -> alert(self(), Format, Args).
|
|||
|
||||
-spec alert(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec emergency(string()) -> 'ok'.
|
||||
|
@ -107,7 +108,7 @@ emergency(Format, Args) -> emergency(self(), Format, Args).
|
|||
|
||||
-spec emergency(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_CONN}).
|
||||
|
||||
-spec none(string()) -> 'ok'.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include_lib("rabbit_common/include/logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -32,7 +33,7 @@ debug(Format, Args) -> debug(self(), Format, Args).
|
|||
|
||||
-spec debug(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec info(string()) -> 'ok'.
|
||||
|
@ -43,7 +44,7 @@ info(Format, Args) -> info(self(), Format, Args).
|
|||
|
||||
-spec info(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec notice(string()) -> 'ok'.
|
||||
|
@ -54,7 +55,7 @@ notice(Format, Args) -> notice(self(), Format, Args).
|
|||
|
||||
-spec notice(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec warning(string()) -> 'ok'.
|
||||
|
@ -65,7 +66,7 @@ warning(Format, Args) -> warning(self(), Format, Args).
|
|||
|
||||
-spec warning(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec error(string()) -> 'ok'.
|
||||
|
@ -76,7 +77,7 @@ error(Format, Args) -> error(self(), Format, Args).
|
|||
|
||||
-spec error(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec critical(string()) -> 'ok'.
|
||||
|
@ -87,7 +88,7 @@ critical(Format, Args) -> critical(self(), Format, Args).
|
|||
|
||||
-spec critical(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec alert(string()) -> 'ok'.
|
||||
|
@ -98,7 +99,7 @@ alert(Format, Args) -> alert(self(), Format, Args).
|
|||
|
||||
-spec alert(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec emergency(string()) -> 'ok'.
|
||||
|
@ -109,7 +110,7 @@ emergency(Format, Args) -> emergency(self(), Format, Args).
|
|||
|
||||
-spec emergency(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_MIRRORING}).
|
||||
|
||||
-spec none(string()) -> 'ok'.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include_lib("rabbit_common/include/logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -30,7 +31,7 @@ debug(Format, Args) -> debug(self(), Format, Args).
|
|||
|
||||
-spec debug(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec info(string()) -> 'ok'.
|
||||
|
@ -41,7 +42,7 @@ info(Format, Args) -> info(self(), Format, Args).
|
|||
|
||||
-spec info(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec notice(string()) -> 'ok'.
|
||||
|
@ -52,7 +53,7 @@ notice(Format, Args) -> notice(self(), Format, Args).
|
|||
|
||||
-spec notice(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec warning(string()) -> 'ok'.
|
||||
|
@ -63,7 +64,7 @@ warning(Format, Args) -> warning(self(), Format, Args).
|
|||
|
||||
-spec warning(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec error(string()) -> 'ok'.
|
||||
|
@ -74,7 +75,7 @@ error(Format, Args) -> error(self(), Format, Args).
|
|||
|
||||
-spec error(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec critical(string()) -> 'ok'.
|
||||
|
@ -85,7 +86,7 @@ critical(Format, Args) -> critical(self(), Format, Args).
|
|||
|
||||
-spec critical(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec alert(string()) -> 'ok'.
|
||||
|
@ -96,7 +97,7 @@ alert(Format, Args) -> alert(self(), Format, Args).
|
|||
|
||||
-spec alert(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec emergency(string()) -> 'ok'.
|
||||
|
@ -107,7 +108,7 @@ emergency(Format, Args) -> emergency(self(), Format, Args).
|
|||
|
||||
-spec emergency(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_PRELAUNCH}).
|
||||
|
||||
-spec none(string()) -> 'ok'.
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include_lib("rabbit_common/include/logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -30,7 +31,7 @@ debug(Format, Args) -> debug(self(), Format, Args).
|
|||
|
||||
-spec debug(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec info(string()) -> 'ok'.
|
||||
|
@ -41,7 +42,7 @@ info(Format, Args) -> info(self(), Format, Args).
|
|||
|
||||
-spec info(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec notice(string()) -> 'ok'.
|
||||
|
@ -52,7 +53,7 @@ notice(Format, Args) -> notice(self(), Format, Args).
|
|||
|
||||
-spec notice(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec warning(string()) -> 'ok'.
|
||||
|
@ -63,7 +64,7 @@ warning(Format, Args) -> warning(self(), Format, Args).
|
|||
|
||||
-spec warning(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec error(string()) -> 'ok'.
|
||||
|
@ -74,7 +75,7 @@ error(Format, Args) -> error(self(), Format, Args).
|
|||
|
||||
-spec error(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec critical(string()) -> 'ok'.
|
||||
|
@ -85,7 +86,7 @@ critical(Format, Args) -> critical(self(), Format, Args).
|
|||
|
||||
-spec critical(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec alert(string()) -> 'ok'.
|
||||
|
@ -96,7 +97,7 @@ alert(Format, Args) -> alert(self(), Format, Args).
|
|||
|
||||
-spec alert(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec emergency(string()) -> 'ok'.
|
||||
|
@ -107,7 +108,7 @@ emergency(Format, Args) -> emergency(self(), Format, Args).
|
|||
|
||||
-spec emergency(pid() | [tuple()], string(), [any()]) -> 'ok'.
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_QUEUE}).
|
||||
|
||||
-spec none(string()) -> 'ok'.
|
||||
|
|
|
@ -317,7 +317,7 @@ find_blocked_global_peers() ->
|
|||
Snapshot1 = snapshot_global_dict(),
|
||||
timer:sleep(10_000),
|
||||
Snapshot2 = snapshot_global_dict(),
|
||||
logger:debug("global's sync tags 10s ago: ~p~n"
|
||||
?LOG_DEBUG("global's sync tags 10s ago: ~p~n"
|
||||
"global's sync tags now: ~p",
|
||||
[Snapshot1, Snapshot2]),
|
||||
find_blocked_global_peers1(Snapshot2, Snapshot1).
|
||||
|
@ -344,11 +344,11 @@ unblock_global_peer(PeerNode) ->
|
|||
PeerToThisCid = connection_id(PeerState, ThisNode),
|
||||
ThisToPeerCid = connection_id(ThisState, PeerNode),
|
||||
|
||||
logger:info(
|
||||
?LOG_INFO(
|
||||
"global hang workaround: faking nodedown / nodeup between peer node ~s "
|
||||
"(connection ID to us: ~p) and our node ~s (connection ID to peer: ~p)",
|
||||
[PeerNode, PeerToThisCid, ThisNode, ThisToPeerCid]),
|
||||
logger:debug(
|
||||
?LOG_DEBUG(
|
||||
"peer global state: ~tp~nour global state: ~tp",
|
||||
[erpc:call(PeerNode, sys, get_status, [global_name_server]),
|
||||
sys:get_status(global_name_server)]),
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
%% allowing you to easily figure out what happened.
|
||||
|
||||
-module(rabbit_time_travel_dbg).
|
||||
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile(export_all).
|
||||
-compile(nowarn_export_all).
|
||||
|
||||
|
@ -62,7 +65,7 @@ loop(Q) ->
|
|||
[io_lib:format("~0p~n", [E]) || E <- queue:to_list(Q)]),
|
||||
loop(Q);
|
||||
print ->
|
||||
_ = [logger:error("~0p", [E]) || E <- queue:to_list(Q)],
|
||||
_ = [?LOG_ERROR("~0p", [E]) || E <- queue:to_list(Q)],
|
||||
loop(Q);
|
||||
stop ->
|
||||
ok;
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
-module(tcp_listener).
|
||||
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
|
||||
%% Represents a running TCP listener (a process that listens for inbound
|
||||
%% TCP or TLS connections). Every protocol supported typically has one
|
||||
%% or two listeners, plain TCP and (optionally) TLS, but there can
|
||||
|
@ -65,7 +68,7 @@ start_link(IPAddress, Port,
|
|||
|
||||
init({IPAddress, Port, {M, F, A}, OnShutdown, Label}) ->
|
||||
process_flag(trap_exit, true),
|
||||
logger:info("started ~ts on ~ts:~tp", [Label, rabbit_misc:ntoab(IPAddress), Port]),
|
||||
?LOG_INFO("started ~ts on ~ts:~tp", [Label, rabbit_misc:ntoab(IPAddress), Port]),
|
||||
apply(M, F, A ++ [IPAddress, Port]),
|
||||
State0 = #state{
|
||||
on_shutdown = OnShutdown,
|
||||
|
@ -85,11 +88,11 @@ handle_info(_Info, State) ->
|
|||
{noreply, State}.
|
||||
|
||||
terminate(_Reason, #state{on_shutdown = OnShutdown, label = Label, ip = IPAddress, port = Port}) ->
|
||||
logger:info("stopped ~ts on ~ts:~tp", [Label, rabbit_misc:ntoab(IPAddress), Port]),
|
||||
?LOG_INFO("stopped ~ts on ~ts:~tp", [Label, rabbit_misc:ntoab(IPAddress), Port]),
|
||||
try
|
||||
OnShutdown(IPAddress, Port)
|
||||
catch _:Error ->
|
||||
logger:error("Failed to stop ~ts on ~ts:~tp: ~tp",
|
||||
?LOG_ERROR("Failed to stop ~ts on ~ts:~tp: ~tp",
|
||||
[Label, rabbit_misc:ntoab(IPAddress), Port, Error])
|
||||
end.
|
||||
|
||||
|
|
|
@ -12,13 +12,14 @@
|
|||
|
||||
%% Set to true to get an awful lot of debug logs.
|
||||
-if(false).
|
||||
-define(DEBUG(X,Y), logger:debug("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-define(DEBUG(X,Y), ?LOG_DEBUG("~0p: " ++ X, [?FUNCTION_NAME|Y])).
|
||||
-else.
|
||||
-define(DEBUG(X,Y), _ = X, _ = Y, ok).
|
||||
-endif.
|
||||
|
||||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("proper/include/proper.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-record(cq, {
|
||||
amq = undefined :: amqqueue:amqqueue(),
|
||||
|
@ -202,7 +203,7 @@ on_output_fun() ->
|
|||
fun (".", _) -> ok; % don't print the '.'s on new lines
|
||||
("!", _) -> ok;
|
||||
("~n", _) -> ok; % don't print empty lines; CT adds many to logs already
|
||||
("~w~n", A) -> logger:error("~tp~n", [A]); % make sure this gets sent to the terminal, it's important
|
||||
("~w~n", A) -> ?LOG_ERROR("~tp~n", [A]); % make sure this gets sent to the terminal, it's important
|
||||
(F, A) -> io:format(F, A)
|
||||
end.
|
||||
|
||||
|
@ -220,7 +221,7 @@ prop_common(InitialState) ->
|
|||
?TRAPEXIT(begin
|
||||
{History, State, Result} = run_commands(?MODULE, Commands),
|
||||
cmd_teardown_queue(State),
|
||||
?WHENFAIL(logger:error("History: ~tp~nState: ~tp~nResult: ~tp",
|
||||
?WHENFAIL(?LOG_ERROR("History: ~tp~nState: ~tp~nResult: ~tp",
|
||||
[History, State, Result]),
|
||||
aggregate(command_names(Commands), Result =:= ok))
|
||||
end)
|
||||
|
|
|
@ -1300,7 +1300,7 @@ log_and_return_line(Context, Metadata) ->
|
|||
32,
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"),
|
||||
logger:warning(RandomMsg, Metadata),
|
||||
?LOG_WARNING(RandomMsg, Metadata),
|
||||
|
||||
rabbit_logger_std_h:filesync(rmq_1_file_1),
|
||||
MainFile = main_log_file_in_context(Context),
|
||||
|
|
|
@ -2109,7 +2109,7 @@ setup_dist_for_remote_query(#{from_remote_node := {Remote, _}} = Context,
|
|||
{error, {{already_started, _}, _}} ->
|
||||
Context;
|
||||
Error ->
|
||||
logger:error(
|
||||
?LOG_ERROR(
|
||||
"rabbit_env: Failed to setup distribution (as ~ts) to "
|
||||
"query node ~ts: ~tp",
|
||||
[Nodename, Remote, Error]),
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include("logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -57,49 +58,49 @@
|
|||
debug(Format) -> debug(Format, []).
|
||||
debug(Format, Args) -> debug(self(), Format, Args).
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
info(Format) -> info(Format, []).
|
||||
info(Format, Args) -> info(self(), Format, Args).
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
notice(Format) -> notice(Format, []).
|
||||
notice(Format, Args) -> notice(self(), Format, Args).
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
warning(Format) -> warning(Format, []).
|
||||
warning(Format, Args) -> warning(self(), Format, Args).
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
error(Format) -> error(Format, []).
|
||||
error(Format, Args) -> error(self(), Format, Args).
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
critical(Format) -> critical(Format, []).
|
||||
critical(Format, Args) -> critical(self(), Format, Args).
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
alert(Format) -> alert(Format, []).
|
||||
alert(Format, Args) -> alert(self(), Format, Args).
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
emergency(Format) -> emergency(Format, []).
|
||||
emergency(Format, Args) -> emergency(self(), Format, Args).
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_LDAP}).
|
||||
|
||||
none(_Format) -> ok.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
-export([make_jwk/1, from_pem/1, from_pem_file/1]).
|
||||
|
||||
-include_lib("jose/include/jose_jwk.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-spec make_jwk(binary() | map()) -> {ok, #{binary() => binary()}} | {error, term()}.
|
||||
make_jwk(Json) when is_binary(Json); is_list(Json) ->
|
||||
|
@ -43,7 +44,7 @@ from_pem(Pem) ->
|
|||
case jose_jwk:from_pem(Pem) of
|
||||
#jose_jwk{} = Jwk -> {ok, Jwk};
|
||||
Other ->
|
||||
error_logger:warning_msg("Error parsing jwk from pem: ", [Other]),
|
||||
?LOG_WARNING("Error parsing jwk from pem: ", [Other]),
|
||||
{error, invalid_pem_string}
|
||||
end.
|
||||
|
||||
|
@ -55,7 +56,7 @@ from_pem_file(FileName) ->
|
|||
case jose_jwk:from_pem_file(FileName) of
|
||||
#jose_jwk{} = Jwk -> {ok, Jwk};
|
||||
Other ->
|
||||
error_logger:warning_msg("Error parsing jwk from pem file: ", [Other]),
|
||||
?LOG_WARNING("Error parsing jwk from pem file: ", [Other]),
|
||||
{error, invalid_pem_file}
|
||||
end
|
||||
end.
|
||||
|
|
|
@ -335,7 +335,7 @@ load_credentials(#state{region = Region}) ->
|
|||
security_token = SecurityToken,
|
||||
imdsv2_token = undefined}};
|
||||
{error, Reason} ->
|
||||
error_logger:error_msg("Could not load AWS credentials from environment variables, AWS_CONFIG_FILE, AWS_SHARED_CREDENTIALS_FILE or EC2 metadata endpoint: ~tp. Will depend on config settings to be set~n", [Reason]),
|
||||
?LOG_ERROR("Could not load AWS credentials from environment variables, AWS_CONFIG_FILE, AWS_SHARED_CREDENTIALS_FILE or EC2 metadata endpoint: ~tp. Will depend on config settings to be set~n", [Reason]),
|
||||
{error, #state{region = Region,
|
||||
error = Reason,
|
||||
access_key = undefined,
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
-module(rabbit_federation_pg).
|
||||
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
|
||||
-export([start_scope/1, stop_scope/1]).
|
||||
|
||||
start_scope(Scope) ->
|
||||
|
@ -38,7 +41,7 @@ stop_group(Scope, Group) ->
|
|||
fun(MRef) ->
|
||||
receive
|
||||
{'DOWN', MRef, process, _Member, _Info} ->
|
||||
logger:alert("Member ~p stopped: ~0p", [_Member, _Info]),
|
||||
?LOG_ALERT("Member ~p stopped: ~0p", [_Member, _Info]),
|
||||
ok
|
||||
end
|
||||
end, MRefs),
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include("logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -57,49 +58,49 @@
|
|||
debug(Format) -> debug(Format, []).
|
||||
debug(Format, Args) -> debug(self(), Format, Args).
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
info(Format) -> info(Format, []).
|
||||
info(Format, Args) -> info(self(), Format, Args).
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
notice(Format) -> notice(Format, []).
|
||||
notice(Format, Args) -> notice(self(), Format, Args).
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
warning(Format) -> warning(Format, []).
|
||||
warning(Format, Args) -> warning(self(), Format, Args).
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
error(Format) -> error(Format, []).
|
||||
error(Format, Args) -> error(self(), Format, Args).
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
critical(Format) -> critical(Format, []).
|
||||
critical(Format, Args) -> critical(self(), Format, Args).
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
alert(Format) -> alert(Format, []).
|
||||
alert(Format, Args) -> alert(self(), Format, Args).
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
emergency(Format) -> emergency(Format, []).
|
||||
emergency(Format, Args) -> emergency(self(), Format, Args).
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_FEDERATION}).
|
||||
|
||||
none(_Format) -> ok.
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
-module(rabbit_prelaunch_sighandler).
|
||||
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-behaviour(gen_event).
|
||||
|
||||
-export([setup/0,
|
||||
|
@ -69,12 +72,12 @@ handle_event(Signal, State) ->
|
|||
%% which should stop RabbitMQ.
|
||||
%
|
||||
%#{Signal := stop} ->
|
||||
% logger:info(
|
||||
% ?LOG_INFO(
|
||||
% "~ts received - shutting down",
|
||||
% [string:uppercase(atom_to_list(Signal))]),
|
||||
% ok = init:stop();
|
||||
_ ->
|
||||
logger:info(
|
||||
?LOG_INFO(
|
||||
"~ts received - unhandled signal",
|
||||
[string:uppercase(atom_to_list(Signal))])
|
||||
end,
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
none/1, none/2, none/3]).
|
||||
|
||||
-include("logging.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-compile({no_auto_import, [error/2, error/3]}).
|
||||
|
||||
|
@ -57,49 +58,49 @@
|
|||
debug(Format) -> debug(Format, []).
|
||||
debug(Format, Args) -> debug(self(), Format, Args).
|
||||
debug(Pid, Format, Args) ->
|
||||
logger:debug(Format, Args, #{pid => Pid,
|
||||
?LOG_DEBUG(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
info(Format) -> info(Format, []).
|
||||
info(Format, Args) -> info(self(), Format, Args).
|
||||
info(Pid, Format, Args) ->
|
||||
logger:info(Format, Args, #{pid => Pid,
|
||||
?LOG_INFO(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
notice(Format) -> notice(Format, []).
|
||||
notice(Format, Args) -> notice(self(), Format, Args).
|
||||
notice(Pid, Format, Args) ->
|
||||
logger:notice(Format, Args, #{pid => Pid,
|
||||
?LOG_NOTICE(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
warning(Format) -> warning(Format, []).
|
||||
warning(Format, Args) -> warning(self(), Format, Args).
|
||||
warning(Pid, Format, Args) ->
|
||||
logger:warning(Format, Args, #{pid => Pid,
|
||||
?LOG_WARNING(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
error(Format) -> error(Format, []).
|
||||
error(Format, Args) -> error(self(), Format, Args).
|
||||
error(Pid, Format, Args) ->
|
||||
logger:error(Format, Args, #{pid => Pid,
|
||||
?LOG_ERROR(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
critical(Format) -> critical(Format, []).
|
||||
critical(Format, Args) -> critical(self(), Format, Args).
|
||||
critical(Pid, Format, Args) ->
|
||||
logger:critical(Format, Args, #{pid => Pid,
|
||||
?LOG_CRITICAL(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
alert(Format) -> alert(Format, []).
|
||||
alert(Format, Args) -> alert(self(), Format, Args).
|
||||
alert(Pid, Format, Args) ->
|
||||
logger:alert(Format, Args, #{pid => Pid,
|
||||
?LOG_ALERT(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
emergency(Format) -> emergency(Format, []).
|
||||
emergency(Format, Args) -> emergency(self(), Format, Args).
|
||||
emergency(Pid, Format, Args) ->
|
||||
logger:emergency(Format, Args, #{pid => Pid,
|
||||
?LOG_EMERGENCY(Format, Args, #{pid => Pid,
|
||||
domain => ?RMQLOG_DOMAIN_SHOVEL}).
|
||||
|
||||
none(_Format) -> ok.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
-module(rabbit_stream_core).
|
||||
|
||||
-include("rabbit_stream.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([init/1,
|
||||
incoming_data/2,
|
||||
|
@ -778,7 +779,7 @@ parse_request(<<?REQUEST:1,
|
|||
<<_Count:32, Bin/binary>> ->
|
||||
parse_map(Bin, #{});
|
||||
_ ->
|
||||
logger:warning("Incorrect binary for subscription properties: ~w",
|
||||
?LOG_WARNING("Incorrect binary for subscription properties: ~w",
|
||||
[PropsBin]),
|
||||
#{}
|
||||
end,
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
-module(webmachine_log).
|
||||
|
||||
-include("webmachine_logger.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([add_handler/2,
|
||||
call/2,
|
||||
|
@ -135,7 +136,7 @@ log_access({_, _, _}=LogData) ->
|
|||
%% @doc Close a log file.
|
||||
-spec log_close(atom(), string(), file:io_device()) -> ok | {error, term()}.
|
||||
log_close(Mod, Name, FD) ->
|
||||
logger:info("~tp: closing log file: ~tp", [Mod, Name]),
|
||||
?LOG_INFO("~tp: closing log file: ~tp", [Mod, Name]),
|
||||
file:close(FD).
|
||||
|
||||
%% @doc Open a new log file for writing
|
||||
|
@ -148,7 +149,7 @@ log_open(FileName) ->
|
|||
-spec log_open(string(), datehour()) -> file:io_device().
|
||||
log_open(FileName, DateHour) ->
|
||||
LogName = FileName ++ suffix(DateHour),
|
||||
logger:info("opening log file: ~tp", [LogName]),
|
||||
?LOG_INFO("opening log file: ~tp", [LogName]),
|
||||
_ = filelib:ensure_dir(LogName),
|
||||
{ok, FD} = file:open(LogName, [read, write, raw]),
|
||||
{ok, Location} = file:position(FD, eof),
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
-behaviour(cowboy_handler).
|
||||
|
||||
-include_lib("kernel/include/file.hrl").
|
||||
-include_lib("kernel/include/logger.hrl").
|
||||
|
||||
-export([init/2]).
|
||||
-export([terminate/3]).
|
||||
|
@ -24,7 +25,7 @@ respond(Files, Req, State) ->
|
|||
|
||||
respond_error(Reason, Req, State) ->
|
||||
Error = io_lib:format("Error listing certificates ~tp", [Reason]),
|
||||
logger:log(error, "~ts", [Error]),
|
||||
?LOG_ERROR("~ts", [Error]),
|
||||
Req2 = cowboy_req:reply(500, #{}, iolist_to_binary(Error), Req),
|
||||
{ok, Req2, State}.
|
||||
|
||||
|
|
Loading…
Reference in New Issue