Don't delete uploaded logs (#3540)
This commit is contained in:
committed by
GitHub
parent
bb11bc5494
commit
12948b147d
@@ -114,7 +114,6 @@ class DefaultBugReporter @Inject constructor(
|
||||
else -> compressFile(file)
|
||||
}
|
||||
}
|
||||
files.deleteAllExceptMostRecent()
|
||||
}
|
||||
if (withCrashLogs || withDevicesLogs) {
|
||||
saveLogCat()
|
||||
@@ -316,20 +315,6 @@ class DefaultBugReporter @Inject constructor(
|
||||
}.orEmpty()
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all the log files except the most recent one.
|
||||
*/
|
||||
private fun List<File>.deleteAllExceptMostRecent() {
|
||||
if (size > 1) {
|
||||
val mostRecentFile = maxByOrNull { it.lastModified() }
|
||||
forEach { file ->
|
||||
if (file != mostRecentFile) {
|
||||
file.safeDelete()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ==============================================================================================================
|
||||
// Logcat management
|
||||
// ==============================================================================================================
|
||||
|
||||
Reference in New Issue
Block a user