puma-dev
puma-dev copied to clipboard
Show more than just last logline on a puma error
Following on from https://github.com/puma/puma-dev/pull/147 - which was a super helpful change, I think it would be really helpful to show more than just the last line. The reason is, quite often for me the last log line is:
unexpected exit:
/Users/Mike/.rbenv/versions/2.6.3/bin/puma:23:in `<top (required)>'
Which isn't that helpful, when a line higher up lines gives me a greater hint that I've forgot to bundle/run yarn.
Is it possible to capture the whole error on this page?
The relevant line in the go code is here:
https://github.com/puma/puma-dev/blob/db9ec15c986ec978c2534d628e8694a8e5efc250/dev/app.go#L136-L138
I don't know Go well enough to fix this, but please, for the love of code, someone fix this.
N.B. if you are getting stuck on an "unexpected exit" with a mysterious out of context error, such as:
unexpected exit:
ruby 3.1.4
and if you are on a mac, you can do:
tail -f ~/Library/Logs/puma-dev.log
and then find out the full error message, which in my case was:
theapp-a64698c4[5059]:
theapp-a64698c4[5059]: asdf install ruby 3.0.5
theapp-a64698c4[5059]:
theapp-a64698c4[5059]: or add one of the following versions in your config file at /Users/myusername/.tool-versions
theapp-a64698c4[5059]: ruby 2.7.8
theapp-a64698c4[5059]: ruby 3.0.6
theapp-a64698c4[5059]: ruby 3.1.4 <-- this is the result of "lastline"
Last 5-10 lines would probably be sufficient.