11
11
12
12
-include_lib (" amqp_client/include/amqp_client.hrl" ).
13
13
-include_lib (" amqp10_common/include/amqp10_types.hrl" ).
14
+ -include_lib (" kernel/include/logger.hrl" ).
14
15
-include_lib (" rabbit/include/mc.hrl" ).
15
16
-include (" rabbit_shovel.hrl" ).
16
17
@@ -188,12 +189,12 @@ init_source(State = #{source := #{queue := QName0,
188
189
{0 , {error , autodelete }} ->
189
190
exit ({shutdown , autodelete });
190
191
{_Remaining , {error , Reason }} ->
191
- rabbit_log : error (
192
- " Shovel '~ts ' in vhost '~ts ' failed to consume: ~ts " ,
193
- [Name , VHost , Reason ]),
192
+ ? LOG_ERROR (
193
+ " Shovel '~ts ' in vhost '~ts ' failed to consume: ~ts " ,
194
+ [Name , VHost , Reason ]),
194
195
exit ({shutdown , failed_to_consume_from_source });
195
196
{unlimited , {error , not_implemented , Reason , ReasonArgs }} ->
196
- rabbit_log : error (
197
+ ? LOG_ERROR (
197
198
" Shovel '~ts ' in vhost '~ts ' failed to consume: ~ts " ,
198
199
[Name , VHost , io_lib :format (Reason , ReasonArgs )]),
199
200
exit ({shutdown , failed_to_consume_from_source });
@@ -267,8 +268,8 @@ close_source(#{source := #{current := #{queue_states := QStates0,
267
268
{error , not_found } ->
268
269
ok ;
269
270
{error , Reason } ->
270
- rabbit_log : warning (" Local shovel failed to remove consumer ~tp : ~tp " ,
271
- [CTag , Reason ]),
271
+ ? LOG_WARNING (" Local shovel failed to remove consumer ~tp : ~tp " ,
272
+ [CTag , Reason ]),
272
273
ok
273
274
end ;
274
275
close_source (_ ) ->
@@ -421,8 +422,7 @@ handle_queue_actions(Actions, State) ->
421
422
handle_deliver (AckRequired , Msgs , S0 );
422
423
({credit_reply , _ , _ , _ , _ , _ } = Action , S0 ) ->
423
424
handle_credit_reply (Action , S0 );
424
- (Action , S0 ) ->
425
- rabbit_log :warning (" ACTION NOT HANDLED ~p " , [Action ]),
425
+ (_Action , S0 ) ->
426
426
S0
427
427
% % ({queue_down, QRef}, S0) ->
428
428
% % State;
@@ -558,7 +558,7 @@ get_user_vhost_from_amqp_param(Uri) ->
558
558
exit ({shutdown , {access_refused , Username }})
559
559
end ;
560
560
{refused , Username , _Msg , _Module } ->
561
- rabbit_log : error (" Local shovel user ~ts was refused access" ),
561
+ ? LOG_ERROR (" Local shovel user ~ts was refused access" ),
562
562
exit ({shutdown , {access_refused , Username }})
563
563
end .
564
564
@@ -576,8 +576,8 @@ settle(Op, DeliveryTag, Multiple, #{unacked_message_q := UAMQ0,
576
576
unacked_message_q => UAMQ },
577
577
handle_queue_actions (Actions , State );
578
578
{'protocol_error' , Type , Reason , Args } ->
579
- rabbit_log : error (" Shovel failed to settle ~p acknowledgments with ~tp : ~tp " ,
580
- [Op , Type , io_lib :format (Reason , Args )]),
579
+ ? LOG_ERROR (" Shovel failed to settle ~p acknowledgments with ~tp : ~tp " ,
580
+ [Op , Type , io_lib :format (Reason , Args )]),
581
581
exit ({shutdown , {ack_failed , Reason }})
582
582
end .
583
583
0 commit comments