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

Indent SIGINFO thread backtraces (#2071)

Before this commit the SIGINFO thread backtraces looked like:

```
Thread: TID-owjccjjvw puma reactor
/path/to/puma/reactor.rb:136 in 'select'
/path/to/puma/reactor.rb:136 in 'run_internal'
/path/to/puma/reactor.rb:313 in 'run_in_thread'
Thread: TID-owjccjjrg puma threadpool reaper
/path/to/puma/thread_pool.rb:262 in 'sleep'
/path/to/puma/thread_pool.rb:262 in 'block in start!'
```

This format can make it a bit difficult to see where one backtrace ends
and the next begins. This commit indents the backtrace lines for clearer
visual separation.

```
Thread: TID-owjccjjvw puma reactor
  /path/to/puma/reactor.rb:136 in 'select'
  /path/to/puma/reactor.rb:136 in 'run_internal'
  /path/to/puma/reactor.rb:313 in 'run_in_thread'
Thread: TID-owjccjjrg puma threadpool reaper
  /path/to/puma/thread_pool.rb:262 in 'sleep'
  /path/to/puma/thread_pool.rb:262 in 'block in start!'
```
This commit is contained in:
Daniel Colson 2019-11-11 00:29:03 -05:00 committed by Nate Berkopec
parent 629b7adab8
commit 957fd3ac93

View file

@ -455,7 +455,7 @@ module Puma
Signal.trap "SIGINFO" do
thread_status do |name, backtrace|
@events.log name
@events.log backtrace
@events.log backtrace.map { |bt| " #{bt}" }
end
end
rescue Exception