mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 03:05:18 +08:00
Changed: Use millisecond timestamps for reports
This commit is contained in:
@@ -56,7 +56,7 @@ public class CrashHandler implements Thread.UncaughtExceptionHandler {
|
|||||||
|
|
||||||
reportString.append("## Crash Details\n");
|
reportString.append("## Crash Details\n");
|
||||||
reportString.append("\n").append(MarkdownUtils.getSingleLineMarkdownStringEntry("Crash Thread", thread.toString(), "-"));
|
reportString.append("\n").append(MarkdownUtils.getSingleLineMarkdownStringEntry("Crash Thread", thread.toString(), "-"));
|
||||||
reportString.append("\n").append(MarkdownUtils.getSingleLineMarkdownStringEntry("Crash Timestamp", AndroidUtils.getCurrentTimeStamp(), "-"));
|
reportString.append("\n").append(MarkdownUtils.getSingleLineMarkdownStringEntry("Crash Timestamp", AndroidUtils.getCurrentMilliSecondUTCTimeStamp(), "-"));
|
||||||
reportString.append("\n\n").append(MarkdownUtils.getMultiLineMarkdownStringEntry("Crash Message", throwable.getMessage(), "-"));
|
reportString.append("\n\n").append(MarkdownUtils.getMultiLineMarkdownStringEntry("Crash Message", throwable.getMessage(), "-"));
|
||||||
reportString.append("\n\n").append(Logger.getStackTracesMarkdownString("Stacktrace", Logger.getStackTracesStringArray(throwable)));
|
reportString.append("\n\n").append(Logger.getStackTracesMarkdownString("Stacktrace", Logger.getStackTracesStringArray(throwable)));
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ public class ReportInfo implements Serializable {
|
|||||||
this.reportString = reportString;
|
this.reportString = reportString;
|
||||||
this.reportStringSuffix = reportStringSuffix;
|
this.reportStringSuffix = reportStringSuffix;
|
||||||
this.addReportInfoToMarkdown = addReportInfoToMarkdown;
|
this.addReportInfoToMarkdown = addReportInfoToMarkdown;
|
||||||
this.reportTimestamp = AndroidUtils.getCurrentTimeStamp();
|
this.reportTimestamp = AndroidUtils.getCurrentMilliSecondUTCTimeStamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -182,6 +182,13 @@ public class AndroidUtils {
|
|||||||
return df.format(new Date());
|
return df.format(new Date());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getCurrentMilliSecondUTCTimeStamp() {
|
||||||
|
@SuppressLint("SimpleDateFormat")
|
||||||
|
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z");
|
||||||
|
df.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||||
|
return df.format(new Date());
|
||||||
|
}
|
||||||
|
|
||||||
public static String getCurrentMilliSecondLocalTimeStamp() {
|
public static String getCurrentMilliSecondLocalTimeStamp() {
|
||||||
@SuppressLint("SimpleDateFormat")
|
@SuppressLint("SimpleDateFormat")
|
||||||
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss.SSS");
|
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss.SSS");
|
||||||
|
Reference in New Issue
Block a user