Rotate logs only when there are actual operations

Currently it rotates the log files every time it boots into the recovery
mode. We lose useful logs after ten times. This CL changes the rotation
condition so that it will rotate only if it performs some actual
operations that modify the flash (installs, wipes, sideloads and etc).

Bug: 19695622
Change-Id: Ie708ad955ef31aa500b6590c65faa72391705940
This commit is contained in:
Tao Bao
2015-04-07 22:02:27 -07:00
parent 6896f9d47d
commit 682c34bbc3
4 changed files with 33 additions and 9 deletions
+2
View File
@@ -256,6 +256,8 @@ int
install_package(const char* path, bool* wipe_cache, const char* install_file,
bool needs_mount)
{
modified_flash = true;
FILE* install_log = fopen_path(install_file, "w");
if (install_log) {
fputs(path, install_log);