summaryrefslogtreecommitdiff
path: root/futility/updater.h
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2018-11-21 10:35:42 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-20 04:47:41 +0000
commite88d638b5b2b20cdd5d78e522f43f84a513bb652 (patch)
tree1fa42e453c187756de69cf30c7acde2f29eb0a64 /futility/updater.h
parentf5578866e2c1b6acc7ae493db7f0657c4aa4a589 (diff)
downloadvboot-factory-grunt-11164.135.B.tar.gz
futility: updater: Revise output messages for debug logsfactory-grunt-11164.Bfactory-grunt-11164.135.Bfactory-11164.135.B
In auto update and recovery, the firmware updater was executed with both stdout and stderr logged. However, the logs usually comes with all stderr first then all stdout. This makes it harder to debug because the messages logged in out of order. TO solve that, few macros are introduced: INFO: for useful information. STATUS: the most common information, usually comes with a prefix code. And all messages should now go to stderr except the final execution result (and those output commands, for example --manifest). BUG=chromium:875551 TEST=TEST=make futil; tests/futility/run_test_scripts.sh $(pwd)/build/futility CQ-DEPEND=CL:1345250 BRANCH=None Change-Id: Ie0dc6594ece10e7e15caf9c36353e2b3ec8754c5 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1345611 Reviewed-by: Youcheng Syu <youcheng@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1694203 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2306633 Reviewed-by: Cheng-Han Yang <chenghan@chromium.org> Commit-Queue: Cheng-Han Yang <chenghan@chromium.org> Tested-by: Cheng-Han Yang <chenghan@chromium.org>
Diffstat (limited to 'futility/updater.h')
-rw-r--r--futility/updater.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/futility/updater.h b/futility/updater.h
index 9c8502b1..c65e9a0a 100644
--- a/futility/updater.h
+++ b/futility/updater.h
@@ -17,6 +17,10 @@ extern int debugging_enabled;
"DEBUG: %s: " format "\n", __FUNCTION__, ##__VA_ARGS__); } while (0)
#define ERROR(format, ...) fprintf(stderr, \
"ERROR: %s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
+#define WARN(format, ...) fprintf(stderr, \
+ "WARNING: " format "\n", ##__VA_ARGS__)
+#define INFO(format, ...) fprintf(stderr, "INFO: " format "\n", ##__VA_ARGS__)
+#define STATUS(format, ...) fprintf(stderr, ">> " format "\n", ##__VA_ARGS__)
#define ASPRINTF(strp, ...) do { if (asprintf(strp, __VA_ARGS__) >= 0) break; \
ERROR("Failed to allocate memory, abort."); exit(1); } while (0)