Skip to content

Commit 6b528e2

Browse files
committed
Replace ct:pal with ct:log in select places
1 parent 8512a44 commit 6b528e2

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed

deps/rabbit/test/amqp_utils.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ web_amqp(Config) ->
6161
flush(Prefix) ->
6262
receive
6363
Msg ->
64-
ct:pal("~p flushed: ~p~n", [Prefix, Msg]),
64+
ct:log("~p flushed: ~p~n", [Prefix, Msg]),
6565
flush(Prefix)
6666
after 1 ->
6767
ok

deps/rabbit/test/peer_discovery_tmp_hidden_node_SUITE.erl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ long_names_work(_Config) ->
8282
ipv6_works(Config) ->
8383
PrivDir = ?config(priv_dir, Config),
8484
InetrcFilename = filename:join(PrivDir, "inetrc-ipv6.erl"),
85-
ct:pal("Inetrc filename:~n~0p", [InetrcFilename]),
85+
ct:log("Inetrc filename:~n~0p", [InetrcFilename]),
8686
Inetrc = [{inet6, true}],
8787
InetrcContent = [io_lib:format("~p.~n", [Param]) || Param <- Inetrc],
88-
ct:pal("Inetrc file content:~n---8<---~n~s---8<---", [InetrcContent]),
88+
ct:log("Inetrc file content:~n---8<---~n~s---8<---", [InetrcContent]),
8989
ok = file:write_file(InetrcFilename, InetrcContent),
9090
InetrcArg = rabbit_misc:format("~0p", [InetrcFilename]),
9191

@@ -106,10 +106,10 @@ inetrc_file_as_atom_works(_Config) ->
106106
%% might not be defined).
107107
TmpDir = os:getenv("TEMP", os:getenv("TMP", os:getenv("TMPDIR", "/tmp"))),
108108
InetrcFilename = filename:join(TmpDir, "inetrc-ipv6.erl"),
109-
ct:pal("Inetrc filename:~n~0p", [InetrcFilename]),
109+
ct:log("Inetrc filename:~n~0p", [InetrcFilename]),
110110
Inetrc = [{inet6, true}],
111111
InetrcContent = [io_lib:format("~p.~n", [Param]) || Param <- Inetrc],
112-
ct:pal("Inetrc file content:~n---8<---~n~s---8<---", [InetrcContent]),
112+
ct:log("Inetrc file content:~n---8<---~n~s---8<---", [InetrcContent]),
113113
ok = file:write_file(InetrcFilename, InetrcContent),
114114
InetrcArg = rabbit_misc:format("~0p", [list_to_atom(InetrcFilename)]),
115115

@@ -138,27 +138,27 @@ tls_dist_works(Config) ->
138138

139139
PrivDir = ?config(priv_dir, Config),
140140
SslOptFilename = filename:join(PrivDir, "ssl-options.erl"),
141-
ct:pal("SSL options filename:~n~0p", [SslOptFilename]),
141+
ct:log("SSL options filename:~n~0p", [SslOptFilename]),
142142
SslOptContent = rabbit_misc:format("~p.~n", [SslOptions]),
143-
ct:pal("SSL options file content:~n---8<---~n~s---8<---", [SslOptContent]),
143+
ct:log("SSL options file content:~n---8<---~n~s---8<---", [SslOptContent]),
144144
ok = file:write_file(SslOptFilename, SslOptContent),
145145

146146
%% We need to read the certificate's Subject ID to see what hostname is
147147
%% used in the certificate and use the same to start the test Erlang nodes.
148148
%% We also need to pay attention if the name is short or long.
149149
{ok, ServerCertBin} = file:read_file(ServerCert),
150-
ct:pal("ServerCertBin = ~p", [ServerCertBin]),
150+
ct:log("ServerCertBin = ~p", [ServerCertBin]),
151151
[DecodedCert] = public_key:pem_decode(ServerCertBin),
152-
ct:pal("DecodedCert = ~p", [DecodedCert]),
152+
ct:log("DecodedCert = ~p", [DecodedCert]),
153153
DecodedCert1 = element(2, DecodedCert),
154154
{_SerialNr, {rdnSequence, IssuerAttrs}} = public_key:pkix_subject_id(
155155
DecodedCert1),
156-
ct:pal("IssuerAttrs = ~p", [IssuerAttrs]),
156+
ct:log("IssuerAttrs = ~p", [IssuerAttrs]),
157157
[ServerName] = [Value
158158
|| [#'AttributeTypeAndValue'{type = {2, 5, 4, 3},
159159
value = {utf8String, Value}}]
160160
<- IssuerAttrs],
161-
ct:pal("ServerName = ~p", [ServerName]),
161+
ct:log("ServerName = ~p", [ServerName]),
162162
UseLongnames = re:run(ServerName, "\\.", [{capture, none}]) =:= match,
163163

164164
PeerOptions = #{host => binary_to_list(ServerName),
@@ -188,7 +188,7 @@ do_test_query_node_props(Peers) ->
188188
NodeAPid,
189189
rabbit_peer_discovery, query_node_props, [[NodeB]],
190190
infinity),
191-
ct:pal("Discovered nodes properties:~n~p", [Ret]),
191+
ct:log("Discovered nodes properties:~n~p", [Ret]),
192192
?assertMatch([{NodeB, [NodeB], _, false}], Ret),
193193

194194
%% Ensure no connection exists after the query.
@@ -236,23 +236,23 @@ start_test_nodes(Testcase, NodeNumber, NodeCount, PeerOptions, Peers)
236236
_ ->
237237
PeerOptions1
238238
end,
239-
ct:pal("Starting peer with options: ~p", [PeerOptions2]),
239+
ct:log("Starting peer with options: ~p", [PeerOptions2]),
240240
case catch peer:start(PeerOptions2) of
241241
{ok, PeerPid, PeerName} ->
242-
ct:pal("Configuring peer '~ts'", [PeerName]),
242+
ct:log("Configuring peer '~ts'", [PeerName]),
243243
setup_test_node(PeerPid, PeerOptions2),
244244
Peers1 = Peers#{PeerName => PeerPid},
245245
start_test_nodes(
246246
Testcase, NodeNumber + 1, NodeCount, PeerOptions, Peers1);
247247
Error ->
248-
ct:pal("Failed to started peer node:~n"
248+
ct:log("Failed to started peer node:~n"
249249
"Options: ~p~n"
250250
"Error: ~p", [PeerOptions2, Error]),
251251
stop_test_nodes(Peers),
252252
erlang:throw(Error)
253253
end;
254254
start_test_nodes(_Testcase, _NodeNumber, _Count, _PeerOptions, Peers) ->
255-
ct:pal("Peers: ~p", [Peers]),
255+
ct:log("Peers: ~p", [Peers]),
256256
Peers.
257257

258258
setup_test_node(PeerPid, PeerOptions) ->

deps/rabbit/test/policy_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ get_messages(Number, Ch, Q) ->
449449
end.
450450

451451
check_policy_value(Server, QName, Value) ->
452-
ct:pal("QUEUES ~p",
452+
ct:log("QUEUES ~p",
453453
[rpc:call(Server, rabbit_amqqueue, list, [])]),
454454
{ok, Q} = rpc:call(Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, QName)]),
455455
case rpc:call(Server, rabbit_policy, effective_definition, [Q]) of

deps/rabbitmq_ct_helpers/src/rabbit_control_helper.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ command_with_output(Command, Node, Args, Opts) ->
4343
Mod = 'Elixir.RabbitMQCtl', %% To silence a Dialyzer warning.
4444
CommandResult = Mod:exec_command(
4545
Formatted, fun(Output,_,_) -> Output end),
46-
ct:pal("Executed command ~tp against node ~tp~nResult: ~tp~n", [Formatted, Node, CommandResult]),
46+
ct:log("Executed command ~tp against node ~tp~nResult: ~tp~n", [Formatted, Node, CommandResult]),
4747
CommandResult.
4848

4949
format_command(Command, Node, Args, Opts) ->

deps/rabbitmq_ct_helpers/src/rabbit_ct_broker_helpers.erl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ does_use_expected_metadata_store(Config, NodeConfig) ->
944944
true -> khepri;
945945
false -> mnesia
946946
end,
947-
ct:pal(
947+
ct:log(
948948
"Metadata store on ~s: expected=~s, used=~s",
949949
[Nodename, ExpectedMetadataStore, UsedMetadataStore]),
950950
{ExpectedMetadataStore, UsedMetadataStore}.
@@ -975,7 +975,7 @@ cluster_nodes(Config, Nodes) when is_list(Nodes) ->
975975
{value, SecNodeConfig} ->
976976
NodeConfigs1 = NodeConfigs -- [SecNodeConfig],
977977
Nodename = ?config(nodename, SecNodeConfig),
978-
ct:pal(
978+
ct:log(
979979
"Using secondary-umbrella-based node ~s as the cluster seed "
980980
"node",
981981
[Nodename]),
@@ -984,7 +984,7 @@ cluster_nodes(Config, Nodes) when is_list(Nodes) ->
984984
case NodeConfigs of
985985
[NodeConfig, SeedNodeConfig | NodeConfigs1] ->
986986
Nodename = ?config(nodename, SeedNodeConfig),
987-
ct:pal(
987+
ct:log(
988988
"Using node ~s as the cluster seed node",
989989
[Nodename]),
990990
cluster_nodes1(
@@ -1184,7 +1184,7 @@ ra_last_applied(ServerId) ->
11841184

11851185
do_nodes_run_same_ra_machine_version(Config, RaMachineMod) ->
11861186
[MacVer1 | MacVerN] = MacVers = rpc_all(Config, RaMachineMod, version, []),
1187-
ct:pal("Ra machine versions of ~s: ~0p", [RaMachineMod, MacVers]),
1187+
ct:log("Ra machine versions of ~s: ~0p", [RaMachineMod, MacVers]),
11881188
is_integer(MacVer1) andalso
11891189
lists:all(fun(MacVer) -> MacVer =:= MacVer1 end, MacVerN).
11901190

@@ -1403,7 +1403,7 @@ capture_gen_server_termination(
14031403
lists:reverse(Acc), Rest, Count, IgnoredCrashes).
14041404

14051405
found_gen_server_termiation(Message, Lines, Count, IgnoredCrashes) ->
1406-
ct:pal("gen_server termination:~n~n~s", [Message]),
1406+
ct:log("gen_server termination:~n~n~s", [Message]),
14071407
count_gen_server_terminations(Lines, Count + 1, IgnoredCrashes).
14081408

14091409
%% -------------------------------------------------------------------

0 commit comments

Comments
 (0)