diff options
author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-08-03 13:12:51 +0100 |
---|---|---|
committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-08-03 13:12:51 +0100 |
commit | 6ea01578cabe462c32dda4479b40785e1a593230 (patch) | |
tree | 2e4aaef0600d0889b4be89619de039b5953e3cc5 /src/rabbit_control.erl | |
parent | 72c0a4b10d13e02c27235ecdc94d887d13d187dd (diff) | |
download | rabbitmq-server-6ea01578cabe462c32dda4479b40785e1a593230.tar.gz |
refactor mask_args
Diffstat (limited to 'src/rabbit_control.erl')
-rw-r--r-- | src/rabbit_control.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_control.erl b/src/rabbit_control.erl index ad0b6d0c..bb42efb6 100644 --- a/src/rabbit_control.erl +++ b/src/rabbit_control.erl @@ -75,8 +75,8 @@ start() -> Quiet = proplists:get_bool(?QUIET_OPT, Opts1), Node = proplists:get_value(?NODE_OPT, Opts1), rpc_call(Node, rabbit_control, log_anytime, - ["~p executing~nrabbitmqctl ~p~n", - [node(), mask_args([Command0 | Args])]]), + ["~p executing~nrabbitmqctl ~p ~p~n", + [node(), Command0, mask_args(Command0, Args)]]), Inform = case Quiet of true -> fun (_Format, _Args1) -> ok end; false -> fun (Format, Args1) -> @@ -488,11 +488,9 @@ quit(Status) -> end. %% Mask passwords and other sensitive info before logging. -mask_args([]) -> - []; -mask_args(["add_user", Name, Password | Args]) -> - ["add_user", Name, "****" | mask_args(Args)]; -mask_args(["change_password", Name, Password | Args]) -> - ["change_password", Name, "****" | mask_args(Args)]; -mask_args([Arg | Args]) -> - [Arg | mask_args(Args)]. +mask_args("add_user", [Name, Password | Args]) -> + [Name, "****" | Args]; +mask_args("change_password", [Name, Password | Args]) -> + [Name, "****" | Args]; +mask_args(_, Args) -> + Args. |