Improve fastboot verbose output.
Move some verbose messages so they're only output with -v.
Remove some misleading verbose messages altogether (such as "wiping
userdata...").
Properly log all the commands sent and responses received. Example:
$ fastboot -v flashall
...
Sending sparse 'system' 2/2 (443712 KB)
fastboot: verbose: sending command "download:1b1500d0"
fastboot: verbose: received DATA 1b1500d0
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (165596160 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (267762688 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (20978688 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (7168 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (3072 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (3072 bytes)
fastboot: verbose: sending data (1024 bytes)
fastboot: verbose: sending data (3072 bytes)
fastboot: verbose: sending data (208 bytes)
fastboot: verbose: received OKAY
OKAY [ 13.871s]
Writing sparse 'system' 2/2
fastboot: verbose: sending command "flash:system"
fastboot: verbose: received OKAY
OKAY [ 3.228s]
Rebooting
fastboot: verbose: sending command "reboot"
fastboot: verbose: received OKAY
Finished. Total time: 36.939s
Bug: http://b/30953083
Bug: http://b/74444116
Test: `fastboot -v flashall`
Change-Id: I2cca198daa062fd1fb732218343263803b111e38
diff --git a/fastboot/fastboot.h b/fastboot/fastboot.h
index a31057a..005ba5a 100644
--- a/fastboot/fastboot.h
+++ b/fastboot/fastboot.h
@@ -75,6 +75,7 @@
/* util stuff */
double now();
char* xstrdup(const char*);
+void set_verbose();
// These printf-like functions are implemented in terms of vsnprintf, so they
// use the same attribute for compile-time format string checking. On Windows,
@@ -90,6 +91,7 @@
#endif
void die(const char* fmt, ...) __attribute__((__noreturn__))
__attribute__((__format__(FASTBOOT_FORMAT_ARCHETYPE, 1, 2)));
+void verbose(const char* fmt, ...) __attribute__((__format__(FASTBOOT_FORMAT_ARCHETYPE, 1, 2)));
#undef FASTBOOT_FORMAT_ARCHETYPE
/* Current product */