From 9800ad839a6c8f851cc0fdfba488ed604ed371c1 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Wed, 28 Aug 2019 18:34:24 -0700 Subject: [PATCH] init: -1 log for control message error paths. Fixes: 140136969 Test: check logs Change-Id: Id80f59927b44d1026c6e3389c80ca96baf0733c4 --- init/init.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/init/init.cpp b/init/init.cpp index cf04a2eba..ce898dee0 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -305,9 +305,6 @@ bool HandleControlMessage(const std::string& msg, const std::string& name, pid_t process_cmdline = "unknown process"; } - LOG(INFO) << "Received control message '" << msg << "' for '" << name << "' from pid: " << pid - << " (" << process_cmdline << ")"; - const ControlMessageFunction& function = it->second; Service* svc = nullptr; @@ -320,20 +317,25 @@ bool HandleControlMessage(const std::string& msg, const std::string& name, pid_t svc = ServiceList::GetInstance().FindInterface(name); break; default: - LOG(ERROR) << "Invalid function target from static map key '" << msg << "': " + LOG(ERROR) << "Invalid function target from static map key ctl." << msg << ": " << static_cast::type>(function.target); return false; } if (svc == nullptr) { - LOG(ERROR) << "Could not find '" << name << "' for ctl." << msg; + LOG(ERROR) << "Control message: Could not find '" << name << "' for ctl." << msg + << " from pid: " << pid << " (" << process_cmdline << ")"; return false; } if (auto result = function.action(svc); !result) { - LOG(ERROR) << "Could not ctl." << msg << " for '" << name << "': " << result.error(); + LOG(ERROR) << "Control message: Could not ctl." << msg << " for '" << name + << "' from pid: " << pid << " (" << process_cmdline << "): " << result.error(); return false; } + + LOG(INFO) << "Control message: Processed ctl." << msg << " for '" << name + << "' from pid: " << pid << " (" << process_cmdline << ")"; return true; }