diff --git a/src/pgo_connection.erl b/src/pgo_connection.erl index 565cc24..dae4bfb 100644 --- a/src/pgo_connection.erl +++ b/src/pgo_connection.erl @@ -18,6 +18,7 @@ disconnected/3, enqueued/3, dequeued/3, + format_status/1, terminate/3]). -include("pgo_internal.hrl"). @@ -188,6 +189,13 @@ handle_event(info, {'EXIT', _, _Reason}, _Data) -> handle_event(info, {ssl_closed, _}, _Data) -> keep_state_and_data. +format_status(Status) -> + maps:map(fun(data, Data=#data{pool_config=PoolConfig}) -> + Data#data{pool_config=PoolConfig#{password => "*"}}; + (_, Value) -> + Value + end, Status). + %% @private terminate(_Reason, _, #data{conn=undefined}) -> ok; diff --git a/src/pgo_notifications.erl b/src/pgo_notifications.erl index 77ac015..8702c1a 100644 --- a/src/pgo_notifications.erl +++ b/src/pgo_notifications.erl @@ -12,6 +12,7 @@ callback_mode/0, connected/3, disconnected/3, + format_status/1, terminate/3]). -include("pgo_internal.hrl"). @@ -171,6 +172,13 @@ handle_event(info, {ssl_closed, _}, _Data) -> handle_event(_, _, _) -> keep_state_and_data. +format_status(Status) -> + maps:map(fun(data, Data=#data{config=PoolConfig}) -> + Data#data{config=PoolConfig#{password => "*"}}; + (_, Value) -> + Value + end, Status). + terminate(_Reason, _, #data{conn=undefined}) -> ok; terminate(_Reason, _, #data{conn=Conn}) ->