1717-module (rabbit_control ).
1818-include (" rabbit.hrl" ).
1919
20- -export ([start /0 , stop /0 , action /5 , diagnostics /1 , log_action / 3 ]).
20+ -export ([start /0 , stop /0 , action /5 , diagnostics /1 ]).
2121
2222-define (RPC_TIMEOUT , infinity ).
2323
5050 -> 'ok' ).
5151-spec (diagnostics / 1 :: (node ()) -> [{string (), [any ()]}]).
5252-spec (usage / 0 :: () -> no_return ()).
53- -spec (log_action / 3 :: (node (), string (), [term ()]) -> ok ).
5453
5554-endif .
5655
@@ -73,7 +72,6 @@ start() ->
7372 Command = list_to_atom (Command0 ),
7473 Quiet = proplists :get_bool (? QUIET_OPT , Opts1 ),
7574 Node = proplists :get_value (? NODE_OPT , Opts1 ),
76- rpc_call (Node , rabbit_control , log_action , [node (), Command0 , Args ]),
7775 Inform = case Quiet of
7876 true -> fun (_Format , _Args1 ) -> ok end ;
7977 false -> fun (Format , Args1 ) ->
@@ -521,22 +519,3 @@ quit(Status) ->
521519 {unix , _ } -> halt (Status );
522520 {win32 , _ } -> init :stop (Status )
523521 end .
524-
525- log_action (Node , Command , Args ) ->
526- rabbit_misc :with_local_io (
527- fun () ->
528- error_logger :info_msg (" ~p executing~n rabbitmqctl ~s ~s~n " ,
529- [Node , Command ,
530- format_args (mask_args (Command , Args ))])
531- end ).
532-
533- % % Mask passwords and other sensitive info before logging.
534- mask_args (" add_user" , [Name , _Password | Args ]) ->
535- [Name , " ****" | Args ];
536- mask_args (" change_password" , [Name , _Password | Args ]) ->
537- [Name , " ****" | Args ];
538- mask_args (_ , Args ) ->
539- Args .
540-
541- format_args (Args ) ->
542- string :join ([io_lib :format (" ~p " , [A ]) || A <- Args ], " " ).
0 commit comments