Modify change missing output log's timestamp file name to UTC time file name

This commit is contained in:
2022-10-03 08:04:13 +08:00
parent 2472f8b7e5
commit 777af500d4
3 changed files with 3 additions and 3 deletions

View File

@@ -108,7 +108,7 @@ data class AppErrorsInfoBean(
* 获取异常本地化 UTC 时间
* @return [String]
*/
private val utcTime get() = timestamp.toUtcTime()
val utcTime get() = timestamp.toUtcTime()
/**
* 获取异常本地化经过时间

View File

@@ -74,7 +74,7 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
startActivityForResult(Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
addCategory(Intent.CATEGORY_OPENABLE)
type = "*/application"
putExtra(Intent.EXTRA_TITLE, "${appErrorsInfo.packageName}_${appErrorsInfo.timestamp}.log")
putExtra(Intent.EXTRA_TITLE, "${appErrorsInfo.packageName}_${appErrorsInfo.utcTime}.log")
}, WRITE_REQUEST_CODE)
}.onFailure { toast(msg = "Start Android SAF failed") }
}

View File

@@ -168,7 +168,7 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
("${cacheDir.absolutePath}/temp").also { path ->
File(path).mkdirs()
listData.takeIf { it.isNotEmpty() }?.forEach {
File("$path/${it.packageName}_${it.timestamp.toUtcTime()}.log").writeText(it.stackOutputFileContent)
File("$path/${it.packageName}_${it.utcTime}.log").writeText(it.stackOutputFileContent)
}
outPutFilePath = "${cacheDir.absolutePath}/temp_${System.currentTimeMillis()}.zip"
ZipFileTool.zipMultiFile(path, outPutFilePath)