Move init to libbase logging.
Change-Id: Ibfbefeff587a69e948978a037c555fd12a5ade6a
diff --git a/init/keychords.cpp b/init/keychords.cpp
index 7a7838d..1cfdd80 100644
--- a/init/keychords.cpp
+++ b/init/keychords.cpp
@@ -43,7 +43,7 @@
size = sizeof(*keychord) + svc->keycodes().size() * sizeof(keychord->keycodes[0]);
keychords = (input_keychord*) realloc(keychords, keychords_length + size);
if (!keychords) {
- ERROR("could not allocate keychords\n");
+ PLOG(ERROR) << "could not allocate keychords";
keychords_length = 0;
keychords_count = 0;
return;
@@ -69,7 +69,7 @@
ret = read(keychord_fd, &id, sizeof(id));
if (ret != sizeof(id)) {
- ERROR("could not read keychord id\n");
+ PLOG(ERROR) << "could not read keychord id";
return;
}
@@ -78,10 +78,10 @@
if (adb_enabled == "running") {
Service* svc = ServiceManager::GetInstance().FindServiceByKeychord(id);
if (svc) {
- INFO("Starting service %s from keychord\n", svc->name().c_str());
+ LOG(INFO) << "Starting service " << svc->name() << " from keychord...";
svc->Start();
} else {
- ERROR("service for keychord %d not found\n", id);
+ LOG(ERROR) << "service for keychord " << id << " not found";
}
}
}
@@ -96,13 +96,13 @@
keychord_fd = TEMP_FAILURE_RETRY(open("/dev/keychord", O_RDWR | O_CLOEXEC));
if (keychord_fd == -1) {
- ERROR("could not open /dev/keychord: %s\n", strerror(errno));
+ PLOG(ERROR) << "could not open /dev/keychord";
return;
}
int ret = write(keychord_fd, keychords, keychords_length);
if (ret != keychords_length) {
- ERROR("could not configure /dev/keychord %d: %s\n", ret, strerror(errno));
+ PLOG(ERROR) << "could not configure /dev/keychord " << ret;
close(keychord_fd);
}