Skip to content

Commit 0b2200d

Browse files
author
Brett Hazen
committed
Change redbug log message and have command-line override the config file
1 parent 64d9f8c commit 0b2200d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/rt_redbug.erl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,17 @@
3131
-export([trace/2, trace/3]).
3232

3333
set_tracing_applied(TracingApplied) when is_boolean(TracingApplied) ->
34-
%% If this flag is set on the command line, but not in the config file
35-
%% then switch it on.
36-
Enabled = case rt_config:get(apply_traces, undefined) of
37-
undefined -> TracingApplied;
38-
ConfigValue -> ConfigValue
34+
%% Enable redbug tracing if enabled via command-line or config file
35+
Enabled = case TracingApplied of
36+
true -> TracingApplied;
37+
_ -> rt_config:get(apply_traces, false)
38+
end,
39+
case Enabled of
40+
true ->
41+
lager:warning("Will enable any redbug traces contained in the test");
42+
_ ->
43+
lager:warning("Will not enable any redbug traces contained in the test")
3944
end,
40-
lager:info("Setting apply tracing to ~p", [Enabled]),
4145
rt_config:set(apply_traces, Enabled).
4246

4347
is_tracing_applied() ->

0 commit comments

Comments
 (0)