Dump ynh log if an app script fails #687
While playing with ynh_debug, I thought it's too bad to have to use that helper to know why an app script has crashed.
In case of crash of an app script, print the last 30 lines of the log.
How to test
The current log system is not enough ?
As a reminder, this one displays the command or link to launch to get the end of the log file.
Many users were lost when the logs were displayed. As a result, we stopped displaying logs to users (now we have to use --debug) to prefer this log management system that invites the user to go and see.
I understand in this PR that the objective is to help the debug, in this case this feature should only be activated in a development context, right?
In development context, you can use --debug because you know the script is probably going to fail, or use ynh_debug because you know where the script will fail but want to know why.
This PR is more for "normal" user when a script fail. There's often simple solution, because a file wasn't removed before or other common issues. But the complete log is hard to read if you don't know what to look for.
During my tests, I added an
So the actual error was not shown (Instead, I got lines about helpers being loaded etc).
So to improve the accuracy, in 899d3d4 I propose to add a
(Maybe there's a better trick like using a $ idk)