Update vold to log only debug or higher level messages.
This will allow adding lots of verbose logs which can be enabled
only during local testing/debugging. Update the existing verbose
level logs to debug level since we want those to be logged by
default.
Test: manual
Change-Id: Ib05e2b6efa71308458d49affb6ed81d3975b28ab
diff --git a/Benchmark.cpp b/Benchmark.cpp
index 7fbf92e..b0a3b85 100644
--- a/Benchmark.cpp
+++ b/Benchmark.cpp
@@ -137,12 +137,12 @@
// Only drop when we haven't aborted
if (res == OK) {
android::base::Timer timer;
- LOG(VERBOSE) << "Before drop_caches";
+ LOG(DEBUG) << "Before drop_caches";
if (!WriteStringToFile("3", "/proc/sys/vm/drop_caches")) {
PLOG(ERROR) << "Failed to drop_caches";
res = -1;
}
- LOG(VERBOSE) << "After drop_caches";
+ LOG(DEBUG) << "After drop_caches";
sync();
if (res == OK) extras->putLong(String16("drop"), timer.duration().count());
}
diff --git a/Devmapper.cpp b/Devmapper.cpp
index e5c7e37..b42467c 100644
--- a/Devmapper.cpp
+++ b/Devmapper.cpp
@@ -252,7 +252,7 @@
}
}
} else {
- LOG(VERBOSE) << "Found unmanaged dm device named " << name;
+ LOG(DEBUG) << "Found unmanaged dm device named " << name;
}
nxt = n->next;
} while (nxt);
diff --git a/EncryptInplace.cpp b/EncryptInplace.cpp
index 7f0d770..d559bff 100644
--- a/EncryptInplace.cpp
+++ b/EncryptInplace.cpp
@@ -145,7 +145,7 @@
return 0;
}
- LOG(VERBOSE) << "Copying " << data->count << " blocks at offset " << data->offset;
+ LOG(DEBUG) << "Copying " << data->count << " blocks at offset " << data->offset;
if (pread64(data->realfd, data->buffer, info.block_size * data->count, data->offset) <= 0) {
LOG(ERROR) << "Error reading real_blkdev " << data->real_blkdev << " for inplace encrypt";
diff --git a/Loop.cpp b/Loop.cpp
index 92f1e97..4926ea8 100644
--- a/Loop.cpp
+++ b/Loop.cpp
@@ -146,7 +146,7 @@
PLOG(WARNING) << "Failed to LOOP_CLR_FD " << path;
}
} else {
- LOG(VERBOSE) << "Found unmanaged loop device at " << path << " named " << id;
+ LOG(DEBUG) << "Found unmanaged loop device at " << path << " named " << id;
}
}
diff --git a/Utils.cpp b/Utils.cpp
index f085c22..f202ef9 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -265,9 +265,9 @@
for (size_t i = 0; i < argc; i++) {
argv[i] = (char*)args[i].c_str();
if (i == 0) {
- LOG(VERBOSE) << args[i];
+ LOG(DEBUG) << args[i];
} else {
- LOG(VERBOSE) << " " << args[i];
+ LOG(DEBUG) << " " << args[i];
}
}
@@ -300,9 +300,9 @@
for (size_t i = 0; i < args.size(); i++) {
cmd += args[i] + " ";
if (i == 0) {
- LOG(VERBOSE) << args[i];
+ LOG(DEBUG) << args[i];
} else {
- LOG(VERBOSE) << " " << args[i];
+ LOG(DEBUG) << " " << args[i];
}
}
output.clear();
@@ -327,7 +327,7 @@
}
char line[1024];
while (fgets(line, sizeof(line), fp) != nullptr) {
- LOG(VERBOSE) << line;
+ LOG(DEBUG) << line;
output.push_back(std::string(line));
}
if (pclose(fp) != 0) {
@@ -344,9 +344,9 @@
for (size_t i = 0; i < argc; i++) {
argv[i] = (char*)args[i].c_str();
if (i == 0) {
- LOG(VERBOSE) << args[i];
+ LOG(DEBUG) << args[i];
} else {
- LOG(VERBOSE) << " " << args[i];
+ LOG(DEBUG) << " " << args[i];
}
}
@@ -686,7 +686,7 @@
}
status_t RestoreconRecursive(const std::string& path) {
- LOG(VERBOSE) << "Starting restorecon of " << path;
+ LOG(DEBUG) << "Starting restorecon of " << path;
static constexpr const char* kRestoreconString = "selinux.restorecon_recursive";
@@ -695,7 +695,7 @@
android::base::WaitForProperty(kRestoreconString, path);
- LOG(VERBOSE) << "Finished restorecon of " << path;
+ LOG(DEBUG) << "Finished restorecon of " << path;
return OK;
}
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index f0b742e..53380af 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -176,8 +176,8 @@
std::lock_guard<std::mutex> lock(mLock);
if (mDebug) {
- LOG(VERBOSE) << "----------------";
- LOG(VERBOSE) << "handleBlockEvent with action " << (int)evt->getAction();
+ LOG(DEBUG) << "----------------";
+ LOG(DEBUG) << "handleBlockEvent with action " << (int)evt->getAction();
evt->dump();
}
diff --git a/main.cpp b/main.cpp
index 52abf20..e1f8404 100644
--- a/main.cpp
+++ b/main.cpp
@@ -53,17 +53,17 @@
int main(int argc, char** argv) {
atrace_set_tracing_enabled(false);
- setenv("ANDROID_LOG_TAGS", "*:v", 1);
+ setenv("ANDROID_LOG_TAGS", "*:d", 1);
android::base::InitLogging(argv, android::base::LogdLogger(android::base::SYSTEM));
LOG(INFO) << "Vold 3.0 (the awakening) firing up";
ATRACE_BEGIN("main");
- LOG(VERBOSE) << "Detected support for:"
- << (android::vold::IsFilesystemSupported("ext4") ? " ext4" : "")
- << (android::vold::IsFilesystemSupported("f2fs") ? " f2fs" : "")
- << (android::vold::IsFilesystemSupported("vfat") ? " vfat" : "");
+ LOG(DEBUG) << "Detected support for:"
+ << (android::vold::IsFilesystemSupported("ext4") ? " ext4" : "")
+ << (android::vold::IsFilesystemSupported("f2fs") ? " f2fs" : "")
+ << (android::vold::IsFilesystemSupported("vfat") ? " vfat" : "");
VolumeManager* vm;
NetlinkManager* nm;
diff --git a/model/EmulatedVolume.cpp b/model/EmulatedVolume.cpp
index 7ec109c..8d9ac74 100644
--- a/model/EmulatedVolume.cpp
+++ b/model/EmulatedVolume.cpp
@@ -105,7 +105,7 @@
nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME);
while (before == GetDevice(mFuseWrite)) {
- LOG(VERBOSE) << "Waiting for FUSE to spin up...";
+ LOG(DEBUG) << "Waiting for FUSE to spin up...";
usleep(50000); // 50ms
nsecs_t now = systemTime(SYSTEM_TIME_BOOTTIME);
diff --git a/model/PublicVolume.cpp b/model/PublicVolume.cpp
index 7420c79..dc7c3c1 100644
--- a/model/PublicVolume.cpp
+++ b/model/PublicVolume.cpp
@@ -202,7 +202,7 @@
nsecs_t start = systemTime(SYSTEM_TIME_BOOTTIME);
while (before == GetDevice(mFuseWrite)) {
- LOG(VERBOSE) << "Waiting for FUSE to spin up...";
+ LOG(DEBUG) << "Waiting for FUSE to spin up...";
usleep(50000); // 50ms
nsecs_t now = systemTime(SYSTEM_TIME_BOOTTIME);