Merge "Log a copy of recovery log to kernel logs" am: 7c4d5accbf am: a53fa18a23 am: 6fcc0ac1f3 am: a7b67eeac5
Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/2070207
Change-Id: I9d4dba2f024de939b89d437b986801268a5266e2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 80cba61..9a358ab 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -73,12 +73,12 @@
return "orange" == android::base::GetProperty("ro.boot.verifiedbootstate", "");
}
-static void UiLogger(android::base::LogId /* id */, android::base::LogSeverity severity,
- const char* /* tag */, const char* /* file */, unsigned int /* line */,
- const char* message) {
- static constexpr char log_characters[] = "VDIWEF";
+static void UiLogger(android::base::LogId log_buffer_id, android::base::LogSeverity severity,
+ const char* tag, const char* file, unsigned int line, const char* message) {
+ android::base::KernelLogger(log_buffer_id, severity, tag, file, line, message);
+ static constexpr auto&& log_characters = "VDIWEF";
if (severity >= android::base::ERROR && ui != nullptr) {
- ui->Print("E:%s\n", message);
+ ui->Print("ERROR: %10s: %s\n", tag, message);
} else {
fprintf(stdout, "%c:%s\n", log_characters[severity], message);
}