Change the log file suffix to log (#1360)

This commit is contained in:
Howard Wu 2021-11-04 22:05:55 +08:00 committed by GitHub
parent 663c7ec762
commit 6291a848b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -223,15 +223,15 @@ public class LogsFragment extends BaseFragment {
}); });
try (var is = Runtime.getRuntime().exec("getprop").getInputStream()) { try (var is = Runtime.getRuntime().exec("getprop").getInputStream()) {
os.putNextEntry(new ZipEntry("system_props.txt")); os.putNextEntry(new ZipEntry("system_props.log"));
FileUtils.copy(is, os); FileUtils.copy(is, os);
os.closeEntry(); os.closeEntry();
} catch (IOException e) { } catch (IOException e) {
Log.w(TAG, "system_props.txt", e); Log.w(TAG, "system_props.log", e);
} }
var now = LocalDateTime.now(); var now = LocalDateTime.now();
var name = "app_" + now.toString() + ".txt"; var name = "app_" + now.toString() + ".log";
try (var is = Runtime.getRuntime().exec("logcat -d").getInputStream()) { try (var is = Runtime.getRuntime().exec("logcat -d").getInputStream()) {
os.putNextEntry(new ZipEntry(name)); os.putNextEntry(new ZipEntry(name));
FileUtils.copy(is, os); FileUtils.copy(is, os);

View File

@ -157,7 +157,7 @@ public class ConfigFileManager {
} }
private static String getNewLogFileName(String prefix) { private static String getNewLogFileName(String prefix) {
return prefix + "_" + formatter.format(Instant.now()) + ".txt"; return prefix + "_" + formatter.format(Instant.now()) + ".log";
} }
static File getNewVerboseLogPath() throws IOException { static File getNewVerboseLogPath() throws IOException {