mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-21 21:28:28 +07:00
Added Android crash logging
This commit is contained in:
@ -19,6 +19,7 @@ import arc.util.serialization.*;
|
|||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.game.Saves.*;
|
import mindustry.game.Saves.*;
|
||||||
import mindustry.io.*;
|
import mindustry.io.*;
|
||||||
|
import mindustry.net.*;
|
||||||
import mindustry.ui.dialogs.*;
|
import mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -145,7 +146,7 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
useImmersiveMode = true;
|
useImmersiveMode = true;
|
||||||
depth = 0;
|
depth = 0;
|
||||||
hideStatusBar = true;
|
hideStatusBar = true;
|
||||||
//errorHandler = ModCrashHandler::handle;
|
errorHandler = CrashSender::log;
|
||||||
}});
|
}});
|
||||||
checkFiles(getIntent());
|
checkFiles(getIntent());
|
||||||
|
|
||||||
|
@ -21,6 +21,18 @@ import static mindustry.Vars.net;
|
|||||||
|
|
||||||
public class CrashSender{
|
public class CrashSender{
|
||||||
|
|
||||||
|
public static void log(Throwable exception){
|
||||||
|
try{
|
||||||
|
Core.settings.getDataDirectory().child("crashes").child("crash_" + System.currentTimeMillis() + ".txt").writeString(Strings.parseException(exception, true));
|
||||||
|
}catch(Throwable ignored){
|
||||||
|
}
|
||||||
|
|
||||||
|
if(exception instanceof RuntimeException){
|
||||||
|
throw (RuntimeException)exception;
|
||||||
|
}
|
||||||
|
throw new RuntimeException(exception);
|
||||||
|
}
|
||||||
|
|
||||||
public static void send(Throwable exception, Cons<File> writeListener){
|
public static void send(Throwable exception, Cons<File> writeListener){
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
Reference in New Issue
Block a user