Add standard Android logging to aidl
This greatly helps understanding the code by enabling instrumenting
with debug logging statements. To use:
ANDROID_LOG_TAGS=*:v aidl ....
Will cause the logging to log at the verbose level. See base/logging.h
for more tricks.
Change-Id: I44ec26374419ca9d575f14b65c422444d17fcc66
Test: Ran the example command saw verbose logging.
diff --git a/main.cpp b/main.cpp
index 7fc4193..f4c1911 100644
--- a/main.cpp
+++ b/main.cpp
@@ -18,11 +18,14 @@
#include <memory>
#include "aidl.h"
+#include "logging.h"
#include "options.h"
using android::aidl::Options;
-int main(int argc, const char** argv) {
+int main(int argc, char** argv) {
+ android::base::InitLogging(argv);
+ LOG(DEBUG) << "aidl starting";
std::unique_ptr<Options> options = Options::ParseOptions(argc, argv);
if (!options) {
return 1;