diff options
author | Tianjie Xu <xunchang@google.com> | 2016-09-02 01:04:37 +0200 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-09-02 01:04:37 +0200 |
commit | 61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca (patch) | |
tree | b2d7cdcf7b401978c739d0449c76f92982d918a8 /update_verifier | |
parent | Merge "Check an edge case when read(2) returns 0" (diff) | |
parent | Switch recovery to libbase logging (diff) | |
download | android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar.gz android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar.bz2 android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar.lz android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar.xz android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.tar.zst android_bootable_recovery-61590bbf0d140ffa071eb14b17ae4c3dbc2be5ca.zip |
Diffstat (limited to 'update_verifier')
-rw-r--r-- | update_verifier/Android.mk | 2 | ||||
-rw-r--r-- | update_verifier/update_verifier.cpp | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/update_verifier/Android.mk b/update_verifier/Android.mk index 7f28bcedc..ed61c7bcc 100644 --- a/update_verifier/Android.mk +++ b/update_verifier/Android.mk @@ -19,6 +19,6 @@ include $(CLEAR_VARS) LOCAL_CLANG := true LOCAL_SRC_FILES := update_verifier.cpp LOCAL_MODULE := update_verifier -LOCAL_SHARED_LIBRARIES := libhardware liblog +LOCAL_SHARED_LIBRARIES := libhardware libbase include $(BUILD_EXECUTABLE) diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp index be70cec7f..0a040c564 100644 --- a/update_verifier/update_verifier.cpp +++ b/update_verifier/update_verifier.cpp @@ -35,19 +35,17 @@ #include <string.h> +#include <android-base/logging.h> #include <hardware/boot_control.h> -#define LOG_TAG "update_verifier" -#include <log/log.h> - int main(int argc, char** argv) { for (int i = 1; i < argc; i++) { - SLOGI("Started with arg %d: %s\n", i, argv[i]); + LOG(INFO) << "Started with arg " << i << ": " << argv[i]; } const hw_module_t* hw_module; if (hw_get_module("bootctrl", &hw_module) != 0) { - SLOGE("Error getting bootctrl module.\n"); + LOG(ERROR) << "Error getting bootctrl module."; return -1; } @@ -57,7 +55,7 @@ int main(int argc, char** argv) { unsigned current_slot = module->getCurrentSlot(module); int is_successful= module->isSlotMarkedSuccessful(module, current_slot); - SLOGI("Booting slot %u: isSlotMarkedSuccessful=%d\n", current_slot, is_successful); + LOG(INFO) << "Booting slot " << current_slot << ": isSlotMarkedSuccessful=" << is_successful; if (is_successful == 0) { // The current slot has not booted successfully. @@ -70,12 +68,12 @@ int main(int argc, char** argv) { int ret = module->markBootSuccessful(module); if (ret != 0) { - SLOGE("Error marking booted successfully: %s\n", strerror(-ret)); + LOG(ERROR) << "Error marking booted successfully: " << strerror(-ret); return -1; } - SLOGI("Marked slot %u as booted successfully.\n", current_slot); + LOG(INFO) << "Marked slot " << current_slot << " as booted successfully."; } - SLOGI("Leaving update_verifier.\n"); + LOG(INFO) << "Leaving update_verifier."; return 0; } |