recovery: turn on text display for install errors in debug builds

Hopefully this will reduce the number of OTA "bugs" reported that are
really just someone having changed their system partition,
invalidating future incremental OTAs.

Also fixes a longstanding TODO about putting LOGE() output in the
on-screen display.

Change-Id: I44e5be65b2dee7ebce2cce28ccd920dc3d6e522e
diff --git a/common.h b/common.h
index 3587a31..768f499 100644
--- a/common.h
+++ b/common.h
@@ -18,13 +18,13 @@
 #define RECOVERY_COMMON_H
 
 #include <stdio.h>
+#include <stdarg.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-// TODO: restore ui_print for LOGE
-#define LOGE(...) fprintf(stdout, "E:" __VA_ARGS__)
+#define LOGE(...) ui_print("E:" __VA_ARGS__)
 #define LOGW(...) fprintf(stdout, "W:" __VA_ARGS__)
 #define LOGI(...) fprintf(stdout, "I:" __VA_ARGS__)
 
@@ -44,6 +44,8 @@
 // fopen a file, mounting volumes and making parent dirs as necessary.
 FILE* fopen_path(const char *path, const char *mode);
 
+void ui_print(const char* format, ...);
+
 #ifdef __cplusplus
 }
 #endif