File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -211,10 +211,6 @@ parse_command_line_tests(ParsedArgs) ->
211211 [] -> [undefined ];
212212 UpgradeList -> UpgradeList
213213 end ,
214- % % this is a little ugly, the process that creates the ets table to store
215- % % the tracing state cannot shutdown or the table will be gc'ed, so create
216- % % a dummy proc that doens't die
217- rt_redbug :new (),
218214 rt_redbug :set_tracing_applied (proplists :is_defined (apply_traces , ParsedArgs )),
219215 % % Parse Command Line Tests
220216 {CodePaths , SpecificTests } =
Original file line number Diff line number Diff line change 2626-module (rt_redbug ).
2727
2828-export ([is_tracing_applied /0 ]).
29- -export ([new /0 ]).
3029-export ([set_tracing_applied /1 ]).
3130-export ([stop /1 ]).
3231-export ([trace /2 , trace /3 ]).
3332
34- % % Create a new ets to store globally whether we're tracing or not.
35- new () ->
36- ok .
37-
3833set_tracing_applied (TracingApplied ) when is_boolean (TracingApplied ) ->
39- lager :info (" Setting apply tracing to ~p " , [TracingApplied ]),
40- rt_config :set (apply_traces , TracingApplied ).
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" )
44+ end ,
45+ rt_config :set (apply_traces , Enabled ).
4146
4247is_tracing_applied () ->
43- rt_config :get (apply_traces ).
48+ rt_config :get (apply_traces , false ).
4449
4550% % Apply traces to one or more nodes using redbug tracing and syntax.
4651% %
You can’t perform that action at this time.
0 commit comments