1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Prefix lines with the pid and write a full line at a time to keep the output clear

This commit is contained in:
Evan Phoenix 2015-04-10 23:01:06 -07:00
parent 5fadbc8d9f
commit d3bf7fea4b

View file

@ -744,14 +744,15 @@ module Puma
threads = Thread.list
total = threads.size
$stdout.puts "=== Begin thread backtrace dump ==="
pid = Process.pid
$stdout.syswrite "#{pid}: === Begin thread backtrace dump ===\n"
threads.each_with_index do |t,i|
$stdout.puts "Thread #{i+1}/#{total}: #{t.inspect}"
$stdout.puts(*t.backtrace)
$stdout.puts ""
$stdout.syswrite "#{pid}: Thread #{i+1}/#{total}: #{t.inspect}\n"
$stdout.syswrite "#{pid}: #{t.backtrace.join("\n#{pid}: ")}\n\n"
end
$stdout.puts "=== End thread backtrace dump ==="
$stdout.syswrite "#{pid}: === End thread backtrace dump ===\n"
end
if @options[:drain_on_shutdown]