mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 18:55:31 +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("\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(Logger.getStackTracesMarkdownString("Stacktrace", Logger.getStackTracesStringArray(throwable)));
|
||||
|
||||
|
@@ -34,7 +34,7 @@ public class ReportInfo implements Serializable {
|
||||
this.reportString = reportString;
|
||||
this.reportStringSuffix = reportStringSuffix;
|
||||
this.addReportInfoToMarkdown = addReportInfoToMarkdown;
|
||||
this.reportTimestamp = AndroidUtils.getCurrentTimeStamp();
|
||||
this.reportTimestamp = AndroidUtils.getCurrentMilliSecondUTCTimeStamp();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -182,6 +182,13 @@ public class AndroidUtils {
|
||||
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() {
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
final SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss.SSS");
|
||||
|
Reference in New Issue
Block a user