summaryrefslogtreecommitdiff
path: root/partition_tools
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2019-03-28 10:42:05 -0700
committerYifan Hong <elsk@google.com>2019-03-28 10:48:38 -0700
commit9960b987b2e2d13e99136a7f8195378d4c987d95 (patch)
treeac52597f6d315817c109d454cdfee008c4e193b2 /partition_tools
parent384833d0af49dd921038b4da08c181bf4d86f524 (diff)
downloadextras-9960b987b2e2d13e99136a7f8195378d4c987d95.tar.gz
lpdump: log warning message.
Warning messages were placed in the output stream as well. Put them in logcat so that stdout is always a valid JSON string. Test: lpdump --json on walleye Bug: 126233777 Change-Id: If313eeaee9c347c498818f53decdf092328f142c
Diffstat (limited to 'partition_tools')
-rw-r--r--partition_tools/lpdumpd.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/partition_tools/lpdumpd.cc b/partition_tools/lpdumpd.cc
index 83ec60ed..6110f337 100644
--- a/partition_tools/lpdumpd.cc
+++ b/partition_tools/lpdumpd.cc
@@ -50,12 +50,17 @@ class Lpdump : public BnLpdump {
}
LOG(DEBUG) << "Dumping with args: " << base::Join(args, " ");
std::stringstream output;
- int ret = LpdumpMain((int)m_args.size(), argv, output, output);
+ std::stringstream error;
+ int ret = LpdumpMain((int)m_args.size(), argv, output, error);
+ std::string error_str = error.str();
if (ret == 0) {
+ if (!error_str.empty()) {
+ LOG(WARNING) << error_str;
+ }
*aidl_return = output.str();
return Status::ok();
} else {
- return Status::fromServiceSpecificError(ret, output.str().c_str());
+ return Status::fromServiceSpecificError(ret, error_str.c_str());
}
}
};