Generate backtrace on error/crash

This commit is contained in:
kotyara 2022-03-08 03:00:15 +05:00 • committed by GitHub
parent 299b610a1e
commit df7f5e60bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -431,6 +431,11 @@ class PocketMinecraftServer{
$dump .= "[".($l + 1)."] ".@$file[$l]."\r\n";
}
$dump .= "\r\n\r\n";
$dump .= "Backtrace: \r\n";
foreach(getTrace() as $line){
$dump .= "$line\r\n";
}
$dump .= "\r\n\r\n";
$version = new VersionString();
$dump .= "NostalgiaCore version: ".$version." #".$version->getNumber()." [Protocol ".ProtocolInfo::CURRENT_PROTOCOL."; API ".CURRENT_API_VERSION."]\r\n";
$dump .= "Git commit: ".GIT_COMMIT."\r\n";