Skip to content

Commit f07b9b7

Browse files
committed
fix log level
WARN: should be known messages INFO: informative messages DEBUG: only for debug debug.gem
1 parent b95ad7a commit f07b9b7

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

lib/debug/breakpoint.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def activate iseq, event, line
205205
enable
206206

207207
if @pending && !@oneshot
208-
DEBUGGER__.warn "#{self} is activated."
208+
DEBUGGER__.info "#{self} is activated."
209209
end
210210
end
211211

@@ -509,7 +509,7 @@ def try_enable added: false
509509
retried = false
510510

511511
@tp.enable(target: @method)
512-
DEBUGGER__.warn "#{self} is activated." if added
512+
DEBUGGER__.info "#{self} is activated." if added
513513

514514
if @sig_op == '#'
515515
@cond_class = @klass if @method.owner != @klass

lib/debug/server.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,17 @@ def greeting
175175

176176
def process
177177
while true
178-
DEBUGGER__.info "sleep IO.select"
178+
DEBUGGER__.debug{ "sleep IO.select" }
179179
r = IO.select([@sock])
180-
DEBUGGER__.info "wakeup IO.select"
180+
DEBUGGER__.debug{ "wakeup IO.select" }
181181

182182
line = @session.process_group.sync do
183183
unless IO.select([@sock], nil, nil, 0)
184-
DEBUGGER__.info "UI_Server can not read"
184+
DEBUGGER__.debug{ "UI_Server can not read" }
185185
break :can_not_read
186186
end
187187
@sock.gets&.chomp.tap{|line|
188-
DEBUGGER__.info "UI_Server received: #{line}"
188+
DEBUGGER__.debug{ "UI_Server received: #{line}" }
189189
}
190190
end
191191

@@ -341,12 +341,12 @@ def readline prompt
341341
if @repl
342342
raise "not in subsession, but received: #{line.inspect}" unless @session.in_subsession?
343343
line = "input #{Process.pid}"
344-
DEBUGGER__.info "send: #{line}"
344+
DEBUGGER__.debug{ "send: #{line}" }
345345
s.puts line
346346
end
347347
sleep 0.01 until @q_msg
348348
@q_msg.pop.tap{|msg|
349-
DEBUGGER__.info "readline: #{msg.inspect}"
349+
DEBUGGER__.debug{ "readline: #{msg.inspect}" }
350350
}
351351
end || 'continue')
352352

@@ -430,7 +430,7 @@ def accept
430430
DEBUGGER__.warn "Port is saved into #{@port_save_file}"
431431
end
432432

433-
DEBUGGER__.info <<~EOS
433+
DEBUGGER__.warn <<~EOS
434434
With rdbg, use the following command line:
435435
#
436436
# #{rdbg} --attach #{@local_addr.ip_address} #{@local_addr.ip_port}

lib/debug/session.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -1651,9 +1651,9 @@ def get_thread_client th = Thread.current
16511651
private def enter_subsession
16521652
@subsession_id += 1
16531653
if !@subsession_stack.empty?
1654-
DEBUGGER__.info "Enter subsession (nested #{@subsession_stack.size})"
1654+
DEBUGGER__.debug{ "Enter subsession (nested #{@subsession_stack.size})" }
16551655
else
1656-
DEBUGGER__.info "Enter subsession"
1656+
DEBUGGER__.debug{ "Enter subsession" }
16571657
stop_all_threads
16581658
@process_group.lock
16591659
end
@@ -1666,11 +1666,11 @@ def get_thread_client th = Thread.current
16661666
@subsession_stack.pop
16671667

16681668
if @subsession_stack.empty?
1669-
DEBUGGER__.info "Leave subsession"
1669+
DEBUGGER__.debug{ "Leave subsession" }
16701670
@process_group.unlock
16711671
restart_all_threads
16721672
else
1673-
DEBUGGER__.info "Leave subsession (nested #{@subsession_stack.size})"
1673+
DEBUGGER__.debug{ "Leave subsession (nested #{@subsession_stack.size})" }
16741674
end
16751675

16761676
request_tc type if type
@@ -1998,7 +1998,7 @@ def info msg
19981998
end
19991999

20002000
def locked?
2001-
# DEBUGGER__.info "locked? #{@lock_level}"
2001+
# DEBUGGER__.debug{ "locked? #{@lock_level}" }
20022002
@lock_level > 0
20032003
end
20042004

@@ -2402,19 +2402,19 @@ def fork(&given_block)
24022402
# Do nothing
24032403
}
24042404
child_hook = -> {
2405-
DEBUGGER__.warn "Detaching after fork from child process #{Process.pid}"
2405+
DEBUGGER__.info "Detaching after fork from child process #{Process.pid}"
24062406
SESSION.deactivate
24072407
}
24082408
when :child
24092409
SESSION.before_fork false
24102410

24112411
parent_hook = -> child_pid {
2412-
DEBUGGER__.warn "Detaching after fork from parent process #{Process.pid}"
2412+
DEBUGGER__.info "Detaching after fork from parent process #{Process.pid}"
24132413
SESSION.after_fork_parent
24142414
SESSION.deactivate
24152415
}
24162416
child_hook = -> {
2417-
DEBUGGER__.warn "Attaching after process #{parent_pid} fork to child process #{Process.pid}"
2417+
DEBUGGER__.info "Attaching after process #{parent_pid} fork to child process #{Process.pid}"
24182418
SESSION.activate on_fork: true
24192419
}
24202420
when :both
@@ -2425,7 +2425,7 @@ def fork(&given_block)
24252425
SESSION.after_fork_parent
24262426
}
24272427
child_hook = -> {
2428-
DEBUGGER__.warn "Attaching after process #{parent_pid} fork to child process #{Process.pid}"
2428+
DEBUGGER__.info "Attaching after process #{parent_pid} fork to child process #{Process.pid}"
24292429
SESSION.process_group.after_fork child: true
24302430
SESSION.activate on_fork: true
24312431
}

0 commit comments

Comments
 (0)