Skip to content

Commit 9e4391f

Browse files
committed
fix(pure-ruby-tracer): use global debug flag
1 parent d82178e commit 9e4391f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gems/pure-ruby-tracer/lib/trace.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def record_call(tp)
161161
method_name_prefix = module_name == 'Object' ? '' : "#{module_name}#"
162162
method_name = "#{method_name_prefix}#{tp.method_id}"
163163

164-
old_puts "call #{method_name} with #{tp.parameters}" if @debug
164+
old_puts "call #{method_name} with #{tp.parameters}" if $tracer.debug
165165

166166
arg_records = prepare_args(tp)
167167

@@ -173,7 +173,7 @@ def record_call(tp)
173173

174174
def record_return(tp)
175175
if self.tracks_call?(tp)
176-
old_puts "return" if @debug
176+
old_puts "return" if $tracer.debug
177177
return_value = to_value(tp.return_value)
178178
@record.register_step(tp.path, tp.lineno)
179179
# return value support inspired by existing IDE-s/envs like
@@ -283,7 +283,7 @@ def load_variables(binding)
283283
begin
284284
Kernel.load(program)
285285
rescue Exception => e
286-
if @debug
286+
if $tracer.debug
287287
old_puts ''
288288
old_puts '==== trace.rb error while tracing program ==='
289289
old_puts 'ERROR'

0 commit comments

Comments
 (0)