Aurum: Gets meaningful log from lib and fix build error on 64bit system 04/261004/1 accepted/tizen/unified/20210709.081216 submit/tizen/20210708.081050
authorWoochanlee <wc0917.lee@samsung.com>
Thu, 8 Jul 2021 08:07:03 +0000 (17:07 +0900)
committerWoochanlee <wc0917.lee@samsung.com>
Thu, 8 Jul 2021 08:07:03 +0000 (17:07 +0900)
Change-Id: I0824512b64b32034e8f6db5ef683cb33bb5f2aac

libaurum/src/Accessibility/AccessibleWatcher.cc
libaurum/src/Comparer.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc
libaurum/src/UiDevice.cc
org.tizen.aurum-bootstrap/src/ObjectMapper.cc

index 4ff9548..b41044b 100644 (file)
@@ -19,22 +19,6 @@ AccessibleWatcher::~AccessibleWatcher()
 {
 }
 
-/*
-void AccessibleWatcher::printDbgInformation() const
-{
-    LOG_SCOPE_F(INFO, "%d %d", mActivatedWindowList.size(),  mWindowSet.size());
-
-    for (auto iter = mActivatedWindowList.begin(); iter != mActivatedWindowList.end(); ++iter) {
-        LOG_F(INFO, "%p", *iter);
-    }
-        LOG_F(INFO, "-----------");
-
-    for (auto iter = mWindowSet.begin(); iter != mWindowSet.end(); ++iter) {
-        LOG_F(INFO, "%p", *iter);
-    }
-}
-*/
-
 AccessibleWatcher *AccessibleWatcher::getInstance(AccessibleWatcher *watcherImpl)
 {
     static AccessibleWatcher *mInstance = nullptr;
@@ -57,17 +41,15 @@ AccessibleWatcher *AccessibleWatcher::getInstance(AccessibleWatcher *watcherImpl
 
 std::vector<std::shared_ptr<AccessibleApplication>> AccessibleWatcher::getActiveApplications(void) const
 {
-    LOGI("getActiveApplications for this(%p)", this);
-
     std::vector<std::shared_ptr<AccessibleApplication>> ret{};
     auto apps = this->getApplications();
-    LOGI("apps size %d", apps.size());
+    LOGI("available app process size %d", (int)apps.size());
 
     apps.erase(std::remove_if(apps.begin(), apps.end(), [](auto app){
         return !app->isActive();
     }), apps.end());
 
-    LOGI("active apps size %d", apps.size());
+    LOGI("active apps size %d", (int)apps.size());
 
     return apps;
 }
index 37ee045..f7300ce 100644 (file)
@@ -45,7 +45,7 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(const std::sh
 {
     std::list<std::shared_ptr<PartialMatch>> partialList{};
     std::vector<std::shared_ptr<AccessibleNode>> ret = findObjects(root, 0, 0, partialList);
-    LOGI("%d object(s) found", ret.size());
+    LOGI("%d object(s) found", (int)ret.size());
     return ret;
 }
 
index a2aaa49..04b21b1 100644 (file)
@@ -253,7 +253,6 @@ std::shared_ptr<AccessibleApplication> AtspiAccessibleWatcher::getApplicationAt(
 std::vector<std::shared_ptr<AccessibleApplication>> AtspiAccessibleWatcher::getApplications(void) const
 {
     AtspiWrapper::lock();
-    LOGI("getApplications for this(%p)", this);
     std::vector<std::shared_ptr<AccessibleApplication>> ret{};
     AtspiAccessible *root = AtspiWrapper::Atspi_get_desktop(0);
     int nchild = AtspiWrapper::Atspi_accessible_get_child_count(root, NULL);
index 3250661..23b78ce 100644 (file)
@@ -55,6 +55,7 @@ std::vector<std::shared_ptr<AccessibleNode>> UiDevice::getWindowRoot() const
         auto activeWindows = app->getActiveWindows();
         std::transform(activeWindows.begin(), activeWindows.end(), std::back_inserter(ret),
             [&](std::shared_ptr<AccessibleWindow> window){
+                LOGI("Active pkg: %s, window: %s", window->getAccessibleNode()->getPkg().c_str(), window->getTitle().c_str());
                 return window->getAccessibleNode();
             }
         );
index fb741ef..0e7b7b6 100644 (file)
@@ -77,26 +77,19 @@ void ObjectMapper::cleanUp()
     std::stringstream ss{};
 
     LOGI("clean up object map");
-    ss << "mObjectMapReverse: ";
     for(auto iter = mObjectMapReverse.begin(); iter != mObjectMapReverse.end(); ) {
        auto obj = mObjectMap[iter->second];
         if (obj && !obj->isValid()) {
             iter = mObjectMapReverse.erase(iter);
         } else {
-            ss << "(" << iter->first << "," << iter->second << ") ";
             ++iter;
         }
     }
-    ss << std::endl;
-    ss << "mObjectMap: ";
     for(auto iter = mObjectMap.begin(); iter != mObjectMap.end(); ) {
         if (!iter->second->isValid()) {
             iter = mObjectMap.erase(iter);
         } else {
-            ss << "(" << iter->first << "," << iter->second.get() << ") ";
             ++iter;
         }
     }
-    ss << std::endl;
-    LOGI("%s", ss.str().c_str());
 }