Fix log messages about app request 77/273877/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 15 Apr 2022 04:50:36 +0000 (13:50 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 15 Apr 2022 04:50:36 +0000 (13:50 +0900)
The log format is changed. The string of the cmd is added for readability.

Change-Id: Ibae30cd6b9560eb77b0a21125f838e69a6200df2
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app_request.cc

index e2001a5..afba803 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "app_request.h"
+
 #include <bundle_internal.h>
 #include <ctype.h>
 #include <dirent.h>
 #include <memory>
 #include <utility>
 
-#include "app_request.h"
-#include "app_signal.h"
-#include "aul_api.h"
-#include "aul_app_com.h"
+#include "aul_cmd.h"
 #include "aul_error.h"
+#include "aul_sock.h"
 #include "aul_util.h"
 #include "key.h"
 #include "launch.h"
@@ -98,8 +98,8 @@ AppRequest& AppRequest::SetPid(pid_t pid) {
 int AppRequest::Send(int opt) {
   traceBegin(TTRACE_TAG_APPLICATION_MANAGER, "AUL:REQ_TO_PAD");
   std::string appid = bundle_.GetString(AUL_K_APPID);
-  _W("Request cmd(%d): appid(%s), target_uid(%u)",
-      cmd_, appid.c_str(), uid_);
+  _W("Request cmd(%d:%s): appid(%s), target_uid(%u)",
+      cmd_, aul_cmd_convert_to_string(cmd_), appid.c_str(), uid_);
 
   SetTime();
   switch (cmd_) {
@@ -114,7 +114,8 @@ int AppRequest::Send(int opt) {
       bundle_.GetHandle(), opt);
   if (ret < 0)
     ret = aul_error_convert(ret);
-  _W("Request cmd(%d): result(%d)", cmd_, ret);
+  _W("Request cmd(%d:%s): result(%d)",
+      cmd_, aul_cmd_convert_to_string(cmd_), ret);
   if (ret == AUL_R_LOCAL)
     ret = app_request_local(cmd_, bundle_.GetHandle());
   traceEnd(TTRACE_TAG_APPLICATION_MANAGER);
@@ -122,19 +123,23 @@ int AppRequest::Send(int opt) {
 }
 
 int AppRequest::SendSimply(int opt) {
-  _W("Request cmd(%d): target_uid(%u)", cmd_, uid_);
+  _W("Request cmd(%d:%s): target_uid(%u)",
+      cmd_, aul_cmd_convert_to_string(cmd_), uid_);
   int ret = aul_sock_send_bundle(AUL_UTIL_PID, uid_, cmd_,
       bundle_.GetHandle(), opt);
   if (ret < 0)
     ret = aul_error_convert(ret);
-  _W("Request cmd(%d): result(%d)", cmd_, ret);
+  _W("Request cmd(%d:%s): result(%d)",
+      cmd_, aul_cmd_convert_to_string(cmd_), ret);
   return ret;
 }
 
 int AppRequest::SendCmdOnly(int opt) {
-  _W("Request cmd(%d): target_uid(%u)", cmd_, uid_);
+  _W("Request cmd(%d:%s): target_uid(%u)",
+      cmd_, aul_cmd_convert_to_string(cmd_), uid_);
   int ret = aul_sock_send_raw(AUL_UTIL_PID, uid_, cmd_, nullptr, 0, opt);
-  _W("Request cmd(%d): result(%d)", cmd_, ret);
+  _W("Request cmd(%d:%s): result(%d)",
+      cmd_, aul_cmd_convert_to_string(cmd_), ret);
   return ret;
 }