Include the number of omitted logs (if > 0) in the bug report.
This commit is contained in:
parent
b89e165dd6
commit
de8d3aa695
1 changed files with 10 additions and 4 deletions
|
|
@ -147,14 +147,19 @@ class DefaultBugReporter(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val gzippedFiles = mutableListOf<File>()
|
val gzippedFiles = mutableListOf<File>()
|
||||||
|
var filesTooBig = 0
|
||||||
if (withDevicesLogs) {
|
if (withDevicesLogs) {
|
||||||
val files = getLogFiles().sortedByDescending { it.lastModified() }
|
val files = getLogFiles().sortedByDescending { it.lastModified() }
|
||||||
files.mapNotNullTo(gzippedFiles) { file ->
|
val filesBySize = files.groupBy {
|
||||||
|
it.length() < RageshakeConfig.MAX_LOG_CONTENT_SIZE
|
||||||
|
}
|
||||||
|
filesBySize[true].orEmpty().mapNotNullTo(gzippedFiles) { file ->
|
||||||
when {
|
when {
|
||||||
file.extension == "gz" -> file
|
file.extension == "gz" -> file
|
||||||
else -> compressFile(file)
|
else -> compressFile(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
filesTooBig = filesBySize[false].orEmpty().size
|
||||||
}
|
}
|
||||||
if (withCrashLogs || withDevicesLogs) {
|
if (withCrashLogs || withDevicesLogs) {
|
||||||
saveLogCat()
|
saveLogCat()
|
||||||
|
|
@ -192,7 +197,9 @@ class DefaultBugReporter(
|
||||||
.addFormDataPart("label", buildMeta.versionName)
|
.addFormDataPart("label", buildMeta.versionName)
|
||||||
.addFormDataPart("label", buildMeta.flavorDescription)
|
.addFormDataPart("label", buildMeta.flavorDescription)
|
||||||
.addFormDataPart("branch_name", buildMeta.gitBranchName)
|
.addFormDataPart("branch_name", buildMeta.gitBranchName)
|
||||||
|
if (filesTooBig > 0) {
|
||||||
|
builder.addFormDataPart("omitted_logs", filesTooBig.toString())
|
||||||
|
}
|
||||||
userId?.let {
|
userId?.let {
|
||||||
matrixClientProvider.getOrNull(it)?.let { client ->
|
matrixClientProvider.getOrNull(it)?.let { client ->
|
||||||
val curveKey = client.encryptionService.deviceCurve25519()
|
val curveKey = client.encryptionService.deviceCurve25519()
|
||||||
|
|
@ -394,8 +401,7 @@ class DefaultBugReporter(
|
||||||
logDirectory.listFiles()
|
logDirectory.listFiles()
|
||||||
?.filter {
|
?.filter {
|
||||||
it.isFile &&
|
it.isFile &&
|
||||||
!it.name.endsWith(LOG_CAT_FILENAME) &&
|
!it.name.endsWith(LOG_CAT_FILENAME)
|
||||||
it.length() < RageshakeConfig.MAX_LOG_CONTENT_SIZE
|
|
||||||
}
|
}
|
||||||
}.orEmpty()
|
}.orEmpty()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue