Skip to content

Commit 85eb17d

Browse files
committed
Disable debug logging
1 parent 5748de7 commit 85eb17d

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

Diff for: big_tests/tests/service_domain_db_SUITE.erl

+3-16
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,12 @@ init_per_suite(Config) ->
206206
erase_database(mim()),
207207
Config2 = ejabberd_node_utils:init(mim(), Config1),
208208
mongoose_helper:inject_module(?MODULE),
209-
enable_logging(),
209+
%% If there are CI issues, use this to debug SQL queries:
210+
% mim_loglevel:enable_logging([mim, mim2, mim3], [{mongoose_domain_sql, debug}]),
210211
escalus:init_per_suite([{service_setup, per_testcase} | Config2]).
211212

212213
end_per_suite(Config) ->
213-
disable_logging(),
214+
% mim_loglevel:disable_logging([mim, mim2, mim3], [{mongoose_domain_sql, debug}]),
214215
[restart_domain_core(Node) || Node <- all_nodes()],
215216
dynamic_services:restore_services(Config),
216217
domain_helper:insert_configured_domains(),
@@ -1273,17 +1274,3 @@ dummy_auth_host_type() ->
12731274
random_domain_name() ->
12741275
Prefix = integer_to_binary(erlang:unique_integer([positive])),
12751276
<<Prefix/binary, ".example.db">>.
1276-
1277-
%% -----------------------------------------------------------------------
1278-
%% Custom log levels for domain modules during the tests
1279-
1280-
enable_logging() ->
1281-
mim_loglevel:enable_logging(test_hosts(), custom_loglevels()).
1282-
1283-
disable_logging() ->
1284-
mim_loglevel:disable_logging(test_hosts(), custom_loglevels()).
1285-
1286-
custom_loglevels() ->
1287-
[{mongoose_domain_sql, debug}].
1288-
1289-
test_hosts() -> [mim, mim2, mim3].

Diff for: src/domain/mongoose_domain_sql.erl

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,11 @@ transaction(F, Tries, Errors) when Tries > 0 ->
384384
Result = rdbms_queries:sql_transaction(Pool, fun() -> F(Pool) end),
385385
case Result of
386386
{aborted, _} -> %% Restart any rolled back transaction
387-
put(last_transaction_error, Result),
387+
put(debug_last_transaction_error, Result),
388388
timer:sleep(100), %% Small break before retry
389389
transaction(F, Tries - 1, [Result|Errors]);
390390
_ ->
391-
erase(last_transaction_error),
391+
erase(debug_last_transaction_error),
392392
simple_result(Result)
393393
end.
394394

0 commit comments

Comments
 (0)