libaurum: Print dlog instead of file write(loguru) 40/260640/1
authorWoochanlee <wc0917.lee@samsung.com>
Wed, 30 Jun 2021 06:11:21 +0000 (15:11 +0900)
committerWoochanlee <wc0917.lee@samsung.com>
Wed, 30 Jun 2021 06:11:21 +0000 (15:11 +0900)
Change-Id: I634bf285fa4551166c9afdd9a1e3c93fd6052df7

25 files changed:
libaurum/inc/A11yEvent.h
libaurum/inc/Aurum.h
libaurum/meson.build
libaurum/src/A11yEvent.cc
libaurum/src/Accessibility/AccessibleApplication.cc
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/Accessibility/AccessibleUtils.cc
libaurum/src/Accessibility/AccessibleWatcher.cc
libaurum/src/Accessibility/AccessibleWindow.cc
libaurum/src/Comparer.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleApplication.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc
libaurum/src/Impl/Accessibility/MockAccessibleApplication.cc
libaurum/src/Impl/MockDeviceImpl.cc
libaurum/src/PartialMatch.cc
libaurum/src/Runnable/SendKeyRunnable.cc
libaurum/src/Sel.cc
libaurum/src/UiDevice.cc
libaurum/src/UiObject.cc
libaurum/src/UiScrollable.cc
libaurum/src/UiSelector.cc
libaurum/src/Until.cc
libaurum/src/Waiter.cc
packaging/aurum.spec

index 43da4985bbf3fb32ea6c2596c900162ea48413c4..28ab8a496e6bacb2eeb0b700f3a99bf669e437d1 100644 (file)
@@ -1,6 +1,5 @@
 #pragma once
 #include "bitmask.h"
-
 #include <string>
 
 enum class A11yEvent {
index 801d2ddffa795a72dc459516103c1d6908727ce7..2f46351ca283c60ea8a95c1a7cce93e74be44afa 100644 (file)
@@ -1,3 +1,13 @@
+#ifndef _AURUM_H_
+#define _AURUM_H_
+
+#include <dlog.h>
+
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "AURUM"
+
 #include "UiDevice.h"
 #include "UiObject.h"
 #include "UiSelector.h"
@@ -15,3 +25,9 @@
 #include "IEventSource.h"
 #include "Point2D.h"
 #include "Rect.h"
+#include "PartialMatch.h"
+#include "Comparer.h"
+#include "A11yEvent.h"
+#include "Runnables.h"
+
+#endif /* _AURUM_H_ */
index 85afdb397fcc55c7cd2e41cf8bc43c866a03bfee..257e6f4bf7611f87f2f743cda33fd1a7638b9a16 100644 (file)
@@ -49,6 +49,7 @@ if get_option('tizen') == true
   libaurum_dep += [
     dependency('capi-system-info'),
     dependency('capi-ui-efl-util'),
+    dependency('dlog'),
     dependency('elementary'),
     dependency('libtdm'),
   ]
index 325d6fb01b61a21bf4e41ed42d9d246b17b24494..996fb33b5a6d0bb7a14dba4cc062bafc2c62f681 100644 (file)
@@ -1,5 +1,6 @@
 #include "A11yEvent.h"
 
+#include "Aurum.h"
 #include <unordered_map>
 
 A11yEventInfo::A11yEventInfo() : A11yEventInfo(A11yEvent::EVENT_NONE, nullptr, nullptr) {}
index 6fe51d69fe2f647356abf5716b01af03b000a6df..fdbb013d900ea664ccd627b9390ace3381ee5142 100644 (file)
@@ -1,8 +1,6 @@
-#include "AccessibleApplication.h"
-#include "AccessibleWatcher.h"
+#include "Aurum.h"
 
 #include <algorithm>
-#include <loguru.hpp>
 
 AccessibleApplication::AccessibleApplication(std::shared_ptr<AccessibleNode> node)
 : mNode{node}
index 8e6dbb39daaf08742b38cd3e6b77950b3029aac3..db1c386f5706063cd5343f63194b804bba48957c 100644 (file)
@@ -1,13 +1,12 @@
-#include "AccessibleNode.h"
+#include "Aurum.h"
+
 #include <string.h>
 #include <iostream>
 #include <vector>
 
-#include <loguru.hpp>
 #include "config.h"
 #include <sstream>
 
-
 AccessibleNode::~AccessibleNode()
 {
 }
@@ -76,7 +75,7 @@ void AccessibleNode::notify(int type, int type2, void *src)
 void AccessibleNode::invalidate()
 {
     std::unique_lock<std::mutex> lock(mLock);
-    LOG_F(INFO, "object %p is now invalid", this);
+    dlog_print(DLOG_INFO, LOG_TAG, "object %p is now invalid", this);
     mValid = false;
 }
 
@@ -101,7 +100,7 @@ void AccessibleNode::print(int depth, int maxDepth)
 void AccessibleNode::print(int d)
 {
     this->refresh();
-    LOG_F(INFO, "%s%s",std::string(d, ' ').c_str(), description().c_str());
+    dlog_print(DLOG_INFO, LOG_TAG, "%s %s",std::string(d, ' ').c_str(), description().c_str());
 }
 
 bool AccessibleNode::isSupporting(AccessibleNodeInterface thisIface) const
index 98b2082daaaff89992b6a90067eecddebf3c4791..76e07921af457f597313687f62315a3c8e4a77af 100644 (file)
@@ -1,5 +1,5 @@
-#include "AccessibleUtils.h"
-#include <loguru.hpp>
+#include "Aurum.h"
+
 #include <string.h>
 
 char* state_to_char(AtspiStateType state)
@@ -108,11 +108,11 @@ static void _print_stateset_debug( AtspiStateSet *stateSet)
 
    char *state_name = NULL;
    AtspiStateType stat;
-   LOG_F(INFO, "check ss:%p s:%p, len:%d", stateSet, states, states->len);
+   dlog_print(DLOG_INFO, LOG_TAG, "check ss:%p s:%p, len:%d", stateSet, states, states->len);
    for (int i = 0; states && (i < states->len); ++i) {
       stat = g_array_index(states, AtspiStateType, i);
       state_name = state_to_char(stat);
-      LOG_SCOPE_F(INFO, "state: %s", state_name);
+      dlog_print(DLOG_INFO, LOG_TAG, "state: %s", state_name);
       free(state_name);
    }
    g_array_free(states, 1);
index 3073482a25fa38e41728a9b65f987d4128396ca3..f9636e7e6f0667548e7d099b3ab39a0240270862 100644 (file)
@@ -1,16 +1,14 @@
-#include "AccessibleWatcher.h"
+#include "Aurum.h"
 
 #ifdef TIZEN
 #include "AtspiAccessibleWatcher.h"
 #endif
-
 #include "MockAccessibleWatcher.h"
 
 #include <string.h>
 #include <iostream>
 #include <utility>
 #include <algorithm>
-#include <loguru.hpp>
 
 AccessibleWatcher::AccessibleWatcher()
 :mSources{}, mLock{}
@@ -59,17 +57,17 @@ AccessibleWatcher *AccessibleWatcher::getInstance(AccessibleWatcher *watcherImpl
 
 std::vector<std::shared_ptr<AccessibleApplication>> AccessibleWatcher::getActiveApplications(void) const
 {
-    LOG_SCOPE_F(INFO, "getActiveApplications for this(%p)", this);
+    dlog_print(DLOG_INFO, LOG_TAG, "getActiveApplications for this(%p)", this);
 
     std::vector<std::shared_ptr<AccessibleApplication>> ret{};
     auto apps = this->getApplications();
-    LOG_F(INFO, "apps size %d", apps.size());
+    dlog_print(DLOG_INFO, LOG_TAG, "apps size %d", apps.size());
 
     apps.erase(std::remove_if(apps.begin(), apps.end(), [](auto app){
         return !app->isActive();
     }), apps.end());
 
-    LOG_F(INFO, "active apps size %d", apps.size());
+    dlog_print(DLOG_INFO, LOG_TAG, "active apps size %d", apps.size());
 
     return apps;
 }
@@ -77,7 +75,7 @@ std::vector<std::shared_ptr<AccessibleApplication>> AccessibleWatcher::getActive
 void AccessibleWatcher::attach(std::shared_ptr<IEventConsumer> source)
 {
     std::unique_lock<std::mutex> lock(mLock);
-    LOG_F(INFO, "source attached %p", source.get());
+    dlog_print(DLOG_INFO, LOG_TAG, "source attached %p", source.get());
     if (source) {
         mSources.insert(source);
     }
@@ -86,7 +84,7 @@ void AccessibleWatcher::attach(std::shared_ptr<IEventConsumer> source)
 void AccessibleWatcher::detach(std::shared_ptr<IEventConsumer> source)
 {
     std::unique_lock<std::mutex> lock(mLock);
-    LOG_F(INFO, "source detached %p", source.get());
+    dlog_print(DLOG_INFO, LOG_TAG, "source detached %p", source.get());
     if (source) {
         auto iter = mSources.find(source);
         if (iter != mSources.end()) mSources.erase(iter);
index 437f14150f9c03120aff68911b803e1d705603b9..2818edb62d8a04d60459fe46d0d95c0e96dfc0a0 100644 (file)
@@ -1,5 +1,4 @@
-#include "AccessibleWindow.h"
-#include "AccessibleWatcher.h"
+#include "Aurum.h"
 
 AccessibleWindow::AccessibleWindow(std::shared_ptr<AccessibleApplication> app, std::shared_ptr<AccessibleNode> node)
 : mApp{app}, mNode{node}
index b54298f01e438af2e2cadbf316e717519761015e..e23cf548e347fbecc93328abf7b7af1d852bbf5f 100644 (file)
@@ -1,6 +1,4 @@
-#include "Comparer.h"
-
-#include <loguru.hpp>
+#include "Aurum.h"
 
 Comparer::Comparer(const std::shared_ptr<UiDevice> device, const std::shared_ptr<UiSelector> selector,
                    const bool &earlyReturn)
@@ -27,7 +25,7 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(const std::sh
 {
     Comparer comparer(device, selector, earlyReturn);
 
-    LOG_SCOPE_F(INFO, "findObjects selector(%s) from (type:%s style:%s, role:%s, text:%s) earlyReturn:%d", selector->description().c_str(), root->getType().c_str(),  root->getStyle().c_str(),  root->getRole().c_str(),  root->getText().c_str(), earlyReturn);
+    dlog_print(DLOG_INFO, LOG_TAG, "findObjects selector(%s) from (type:%s style:%s, role:%s, text:%s) earlyReturn:%d", selector->description().c_str(), root->getType().c_str(),  root->getStyle().c_str(),  root->getRole().c_str(),  root->getText().c_str(), earlyReturn);
 
     if (selector->mParent) {
         auto ret = Comparer::findObjects(device, selector->mParent, root);
@@ -47,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);
-    LOG_F(INFO, "%d object(s) found", ret.size());
+    dlog_print(DLOG_INFO, LOG_TAG, "%d object(s) found", ret.size());
     return ret;
 }
 
@@ -56,7 +54,6 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
     std::list<std::shared_ptr<PartialMatch>> &partialMatches)
 {
     std::vector<std::shared_ptr<AccessibleNode>> ret;
-    //LOG_SCOPE_F(INFO, "findObjects idx:%d, depth:%d, partialMatches.size:%d", index, depth, partialMatches.size());
 
     root->refresh();
     for (auto &match : partialMatches)
@@ -79,11 +76,11 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
             if (!ret.empty() && mEarlyReturn) return ret;
         }
     } else {
-        LOG_F(INFO, "Abort searching! No need to search children(maxDepth limit overflow, %d < %d < %d)", mSelector->mMinDepth?*(mSelector->mMinDepth):-1, depth, mSelector->mMaxDepth?*(mSelector->mMaxDepth):9999999);
+        dlog_print(DLOG_INFO, LOG_TAG, "Abort searching! No need to search children(maxDepth limit overflow, %d < %d < %d)", mSelector->mMinDepth?*(mSelector->mMinDepth):-1, depth, mSelector->mMaxDepth?*(mSelector->mMaxDepth):9999999);
     }
 
     if (currentMatch && currentMatch->finalizeMatch()){
-        LOG_F(INFO, "Found matched = %s with criteria %s", root->description().c_str(), currentMatch->debugPrint().c_str());
+        dlog_print(DLOG_INFO, LOG_TAG, "Found matched = %s with criteria %s", root->description().c_str(), currentMatch->debugPrint().c_str());
         ret.push_back(root);
     }
 
index 79aec79a24b42e4372f4ceea86faa82861cdb0de..c458fa063f381c09111cf0d2aa252109d42c6daf 100644 (file)
@@ -5,8 +5,6 @@
 #include <algorithm>
 #include <vector>
 
-#include <loguru.hpp>
-
 AtspiAccessibleApplication::AtspiAccessibleApplication(std::shared_ptr<AccessibleNode> node)
 : AccessibleApplication(node)
 {
index 68239bfc181121f353479755bde9c140bd2edb44..a918fd60ff34f947bdc8cb3046f5d400e35340e7 100644 (file)
@@ -1,11 +1,10 @@
+#include "Aurum.h"
+
 #include "AtspiAccessibleNode.h"
-#include "AccessibleWatcher.h"
 #include "AtspiWrapper.h"
 
 #include <gio/gio.h>
 
-#include <loguru.hpp>
-
 //std::map<AtspiAccessible *, AccessibleNode *> AccessibleNode::mNodeMap{};
 
 AtspiAccessibleNode::AtspiAccessibleNode(AtspiAccessible *node)
@@ -70,7 +69,7 @@ AtspiAccessibleNode::AtspiAccessibleNode(AtspiAccessible *node)
 
         this->refresh();
     } else {
-        LOG_F(INFO, "AtspiAccessibleNode Ctor : mNode is null");
+        dlog_print(DLOG_INFO, LOG_TAG, "AtspiAccessibleNode Ctor : mNode is null");
     }
 }
 
@@ -101,7 +100,7 @@ std::shared_ptr<AccessibleNode> AtspiAccessibleNode::getChildAt(int index) const
         AtspiWrapper::unlock();
         return std::make_shared<AtspiAccessibleNode>(nullptr);
     }
-    LOG_SCOPE_F(INFO, "getChild @ %d from node(%p)", index, mNode);
+    dlog_print(DLOG_INFO, LOG_TAG, "getChild @ %d from node(%p)", index, mNode);
     AtspiAccessible *rawChild = AtspiWrapper::Atspi_accessible_get_child_at_index(mNode, index, NULL);
     AtspiWrapper::unlock();
     return std::make_shared<AtspiAccessibleNode>(rawChild);
@@ -310,7 +309,7 @@ void AtspiAccessibleNode::setValue(std::string text)
     }
 
     AtspiEditableText *iface = AtspiWrapper::Atspi_accessible_get_editable_text(mNode);
-    LOG_F(INFO,"set Value iface:%p obj:%p text:%s", iface, mNode, text.c_str() );
+    dlog_print(DLOG_INFO, LOG_TAG, "set Value iface:%p obj:%p text:%s", iface, mNode, text.c_str() );
     if (iface) {
         int len = getText().length();
         AtspiWrapper::Atspi_editable_text_delete_text(iface, 0, len, NULL);
index 46544d70f60d53f30c9b02713b9cfd8514eca071..bffa4035017143e500de2ccc01c208210dfb7d68 100644 (file)
@@ -1,9 +1,11 @@
-#include "AtspiAccessibleWatcher.h"
+#include "Aurum.h"
 
+#include "AtspiAccessibleWatcher.h"
 #include "AtspiAccessibleApplication.h"
 #include "AtspiAccessibleWindow.h"
 #include "AtspiAccessibleNode.h"
 #include "AtspiWrapper.h"
+
 #include <algorithm>
 #include <chrono>
 #include <thread>
@@ -20,12 +22,12 @@ static bool iShowingNode(AtspiAccessible *node)
     if (node) name = AtspiWrapper::Atspi_accessible_get_name(node, NULL);
     else return false;
 
-    LOG_SCOPE_F(INFO, "isShowing %s", name);
+    dlog_print(DLOG_INFO, LOG_TAG, "isShowing %s", name);
     auto stateSet = AtspiWrapper::Atspi_accessible_get_state_set(node);
 
     if (AtspiWrapper::Atspi_state_set_contains(stateSet, ATSPI_STATE_ACTIVE)
         && AtspiWrapper::Atspi_state_set_contains(stateSet, ATSPI_STATE_SHOWING)) {
-        LOG_F(INFO, "active and showing %p %s", node, name);
+        dlog_print(DLOG_INFO, LOG_TAG, "active and showing %p %s", node, name);
         free(name);
         g_object_unref(stateSet);
         return true;
@@ -39,14 +41,14 @@ static std::vector<AtspiAccessible *>
 findActiveNode(AtspiAccessible *node, int depth,
                                        int max_depth)
 {
-    LOG_SCOPE_F(INFO, "findActiveNode %p %d/%d", node, depth, max_depth);
+    dlog_print(DLOG_INFO, LOG_TAG, "findActiveNode %p %d/%d", node, depth, max_depth);
 
     std::vector<AtspiAccessible *> ret{};
 
     if (iShowingNode(node)) {
         char *name = AtspiWrapper::Atspi_accessible_get_name(node, NULL);
         if (name) {
-            LOG_SCOPE_F(INFO, "%s", name);
+            dlog_print(DLOG_INFO, LOG_TAG, "%s", name);
             free(name);
         }
         ret.push_back(node);
@@ -58,10 +60,10 @@ findActiveNode(AtspiAccessible *node, int depth,
     int nchild = AtspiWrapper::Atspi_accessible_get_child_count(node, NULL);
     if (nchild <= 0) return ret;
 
-    LOG_F(INFO, "findActiveNode node %p has %d children", node, nchild);
+    dlog_print(DLOG_INFO, LOG_TAG, "findActiveNode node %p has %d children", node, nchild);
     for (int i = 0; i < nchild; i++) {
         AtspiAccessible* child = AtspiWrapper::Atspi_accessible_get_child_at_index(node, i, NULL);
-        LOG_F(INFO, "a child found @ %d : %p", i, child);
+        dlog_print(DLOG_INFO, LOG_TAG, "a child found @ %d : %p", i, child);
         std::vector<AtspiAccessible *> childRet = findActiveNode(child, depth + 1, max_depth);
         ret.insert(ret.end(), childRet.begin(), childRet.end());
         g_object_unref(child);
@@ -72,7 +74,7 @@ findActiveNode(AtspiAccessible *node, int depth,
 
 static gpointer _event_thread_loop (gpointer data)
 {
-    LOG_F(INFO, "event thread start");
+    dlog_print(DLOG_INFO, LOG_TAG, "event thread start");
     AtspiEventListener * listener =
         atspi_event_listener_new(AtspiAccessibleWatcher::onAtspiEvents, data, NULL);
 
@@ -81,7 +83,7 @@ static gpointer _event_thread_loop (gpointer data)
 
     atspi_event_main();
 
-    LOG_F(INFO, "event thread end");
+    dlog_print(DLOG_INFO, LOG_TAG, "event thread end");
     atspi_event_listener_deregister(listener, "object:", NULL);
     atspi_event_listener_deregister(listener, "window:", NULL);
 
@@ -207,57 +209,57 @@ void AtspiAccessibleWatcher::onAtspiEvents(AtspiEvent *event, void *user_data)
 
 void AtspiAccessibleWatcher::print_debug()
 {
-    LOG_F(INFO, "activatewindowlist-------------------");
+    dlog_print(DLOG_INFO, LOG_TAG, "activatewindowlist-------------------");
     std::for_each(mActivatedWindowList.begin(), mActivatedWindowList.end(), [](auto acc){
-        LOG_F(INFO, "child:%p", acc);
+        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
     });
 
-    LOG_F(INFO, "mActivatedApplicationList--------------------------");
+    dlog_print(DLOG_INFO, LOG_TAG, "mActivatedApplicationList--------------------------");
     std::for_each(mActivatedApplicationList.begin(), mActivatedApplicationList.end(), [](auto acc){
-        LOG_F(INFO, "child:%p", acc);
+        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
     });
 
-    LOG_F(INFO, "mWindowSet------------------------------");
+    dlog_print(DLOG_INFO, LOG_TAG, "mWindowSet------------------------------");
     std::for_each(mWindowSet.begin(), mWindowSet.end(), [](auto acc){
-        LOG_F(INFO, "child:%p", acc);
+        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
     });
-    LOG_F(INFO, "------------------------------");
+    dlog_print(DLOG_INFO, LOG_TAG, "------------------------------");
 }
 
 void AtspiAccessibleWatcher::onWindowActivated(AtspiAccessible *node,
                             WindowActivateInfoType type)
 {
-    LOG_SCOPE_F(INFO, "onWindowActivated obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onWindowActivated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowActivated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowDeactivated(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO, "onWindowDeactivated obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onWindowDeactivated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowDeactivated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowCreated(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO, "onWindowCreated obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onWindowCreated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowCreated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowDestroyed(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO, "onWindowDestroyed obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onWindowDestroyed obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowDestroyed, node);
 }
 
 void AtspiAccessibleWatcher::onVisibilityChanged(AtspiAccessible *node, bool visible)
 {
-    LOG_SCOPE_F(INFO, "onVisibilityChanged obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onVisibilityChanged obj:%p", node);
     notifyAll((int)EventType::Object, (int)ObjectEventType::ObjectStateVisible, node);
 }
 
 void AtspiAccessibleWatcher::onObjectDefunct(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO, "onObjectDefunct obj:%p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "onObjectDefunct obj:%p", node);
     notifyAll((int)EventType::Object, (int)ObjectEventType::ObjectStateDefunct, node);
 }
 
@@ -288,7 +290,7 @@ std::shared_ptr<AccessibleApplication> AtspiAccessibleWatcher::getApplicationAt(
 std::vector<std::shared_ptr<AccessibleApplication>> AtspiAccessibleWatcher::getApplications(void) const
 {
     AtspiWrapper::lock();
-    LOG_SCOPE_F(INFO, "getApplications for this(%p)", this);
+    dlog_print(DLOG_INFO, LOG_TAG, "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);
@@ -335,7 +337,7 @@ bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const
             for (const auto &event : localEvents) {
                 if (COMPARE(type, event->getEvent()))
                                {
-                    LOG_F(INFO, "type %d == %d name %s pkg %s",static_cast<int>(type), static_cast<int>(event->getEvent()), event->getName().c_str(), event->getPkg().c_str()); 
+                    dlog_print(DLOG_INFO, LOG_TAG, "type %d == %d name %s pkg %s",static_cast<int>(type), static_cast<int>(event->getEvent()), event->getName().c_str(), event->getPkg().c_str()); 
                                    return true; 
                                }
                        }
@@ -352,11 +354,11 @@ bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const
 
 bool AtspiAccessibleWatcher::removeFromActivatedList(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO,"remove from activelist node %p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "remove from activelist node %p", node);
     mActivatedWindowList.remove_if([&](auto &n) { return n == node; });
 
     AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(node, NULL);
-    LOG_F(INFO, "node:%p, app:%p", node, app);
+    dlog_print(DLOG_INFO, LOG_TAG, "node:%p, app:%p", node, app);
     if (app) {
         mActivatedApplicationList.remove_if([&](auto &n) { return n == app; });
         g_object_unref(app);
@@ -366,7 +368,7 @@ bool AtspiAccessibleWatcher::removeFromActivatedList(AtspiAccessible *node)
 
 bool AtspiAccessibleWatcher::addToActivatedList(AtspiAccessible *node)
 {
-    LOG_SCOPE_F(INFO,"add to activelist node %p", node);
+    dlog_print(DLOG_INFO, LOG_TAG, "add to activelist node %p", node);
     mActivatedWindowList.remove_if([&](auto &n) { return n == node; });
     mActivatedWindowList.push_front(node);
 
@@ -374,7 +376,7 @@ bool AtspiAccessibleWatcher::addToActivatedList(AtspiAccessible *node)
     if ( iter == mWindowSet.end()) mWindowSet.insert(node);
 
     AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(node, NULL);
-    LOG_F(INFO, "node:%p, app:%p", node, app);
+    dlog_print(DLOG_INFO, LOG_TAG, "node:%p, app:%p", node, app);
     if (app) {
         mActivatedApplicationList.remove_if([&](auto &n) { if(n == app) { g_object_unref(app); return true;} else return false; });
         mActivatedApplicationList.push_front(app);
index e4f0f34c3b3de435d06bb5168b581ba264460cbb..ed89a5ab76b17822e2d5572a713a348bd56c87b4 100644 (file)
@@ -4,8 +4,6 @@
 
 #include <algorithm>
 
-#include <loguru.hpp>
-
 MockAccessibleApplication::MockAccessibleApplication(std::shared_ptr<AccessibleNode> node)
 : AccessibleApplication(node), mWindowList{}
 {
index 486c32e68a14216a91b44244a5c2a86e42934b16..0184b4429faaed283b8f496b7a7c7ca9a3c7a7be 100644 (file)
@@ -1,5 +1,4 @@
 #include "MockDeviceImpl.h"
-#include <loguru.hpp>
 
 #include <functional>
 #include <algorithm>
index 3abc783f4cd10f9fcb3ceedfe1d9eea8ca17ff8a..bfce60b425408ad09f2ba005ff651307eb6867b9 100644 (file)
@@ -1,13 +1,10 @@
-#include "PartialMatch.h"
+#include "Aurum.h"
 
 #include <iostream>
 #include <set>
 #include <regex>
 #include <sstream>
 
-#include <loguru.hpp>
-
-
 bool PartialMatch::checkCriteria(const std::string *textA, const std::string textB, const bool *match)
 {
     if (!textA || !match) return false;
@@ -80,7 +77,6 @@ std::shared_ptr<PartialMatch> PartialMatch::accept(const std::shared_ptr<Accessi
                                                    int index, int absoluteDepth,
                                                    int relativeDepth)
 {
-    //LOG_SCOPE_F(INFO, "PartialMatch::accept idx:%d abs:%d rel:%d / %d < %d < %d", index, absoluteDepth, relativeDepth, selector->mMinDepth?*(selector->mMinDepth):-1, relativeDepth, selector->mMaxDepth?*(selector->mMaxDepth):9999999);
     PartialMatch *match = nullptr;
 
     if ((selector->mMinDepth && (relativeDepth < *(selector->mMinDepth))) ||
index 88e1fef95c851a2c1e4a5fe4aad30eb02e911480..fc1f54cb90d508f62e17d53f17e9c4bc9a21cb62 100644 (file)
@@ -1,7 +1,4 @@
-#include "SendKeyRunnable.h"
-
-#include <UiDevice.h>
-#include <loguru.hpp>
+#include "Aurum.h"
 
 SendKeyRunnable::SendKeyRunnable(std::string keycode)
     : mKeycode{keycode}
@@ -10,7 +7,7 @@ SendKeyRunnable::SendKeyRunnable(std::string keycode)
 
 void SendKeyRunnable::run() const
 {
-       LOG_F(INFO, "sendKey %s",mKeycode.c_str());
+       dlog_print(DLOG_INFO, LOG_TAG, "sendKey %s",mKeycode.c_str());
        std::shared_ptr<UiDevice> mDevice = UiDevice::getInstance();
        mDevice->pressKeyCode(mKeycode.c_str(), KeyRequestType::PRESS);
        mDevice->pressKeyCode(mKeycode.c_str(), KeyRequestType::RELEASE);
index 1897870e26146c9de758f6258c1ffd1ee096a32e..bf92244606889e3a047c9c62d2d2a5ead1b998ec 100644 (file)
@@ -1,4 +1,4 @@
-#include "Sel.h"
+#include "Aurum.h"
 #include <utility>
 
 std::shared_ptr<UiSelector> Sel::text(std::string text)
index b9b5ab4f9d5df8fdc5c864fdfc6faec45dc0d824..3250661cb132157ba0855bf103e9d4838df62128 100644 (file)
@@ -1,14 +1,10 @@
-#include "UiDevice.h"
-#include "AccessibleWatcher.h"
-#include "Comparer.h"
+#include "Aurum.h"
 
 #ifdef TIZEN
 #include "TizenDeviceImpl.h"
 #endif
 #include "MockDeviceImpl.h"
 
-#include "Runnables.h"
-
 #include <unistd.h>
 #include <utility>
 #include <vector>
@@ -17,7 +13,6 @@
 #include <algorithm>
 #include <iostream>
 
-#include <loguru.hpp>
 UiDevice::UiDevice() : UiDevice(nullptr) {}
 
 UiDevice::UiDevice(IDevice *impl)
index e363c7e1c25e57c30f7a5b46fcaebbee6959bb6e..10956690073e6bc7c904b3affa27f218992dce56 100644 (file)
@@ -1,14 +1,11 @@
-#include "UiObject.h"
-#include "Comparer.h"
-#include "Sel.h"
+#include "Aurum.h"
 
 #include <iostream>
 #include <utility>
 
-#include <loguru.hpp>
-
 #include <chrono>
 #include <thread>
+
 UiObject::UiObject() : UiObject(nullptr, nullptr, nullptr) {}
 
 UiObject::~UiObject()
@@ -89,7 +86,7 @@ std::vector<std::shared_ptr<UiObject>> UiObject::findObjects(
     auto nodes = Comparer::findObjects(mDevice, selector, getAccessibleNode());
     for ( auto& node : nodes) {
         if (!node) {
-            LOG_F(INFO, "Skipped! (node == nullptr)");
+            dlog_print(DLOG_INFO, LOG_TAG, "Skipped! (node == nullptr)");
             continue;
         }
         result.push_back(std::make_shared<UiObject>(mDevice, selector, std::move(node)));
index a051210132fe7e1bf93d36229438edb255f27302..7c4ca8afc8d0fc9db0aa9b6175a11511d48665a7 100644 (file)
@@ -1,4 +1,4 @@
-#include "UiScrollable.h"
+#include "Aurum.h"
 
 UiScrollable::UiScrollable(std::shared_ptr<UiSelector> selector)
 : mSelector{selector}, mMaxSearchSwipe{100}, mScrollStep{50}
index ae14799fcfd3dba854455d1510264aff31b2b710..5caad3d73fb0dee676783cd064dcd97065a5555d 100644 (file)
@@ -1,4 +1,4 @@
-#include "UiSelector.h"
+#include "Aurum.h"
 #include <string>
 #include <sstream>
 
index c243fca3d24f9dcf1192b80b046acbcb9f5cca98..324635b4e27fcdb41b9d2f2ec81905401be34128 100644 (file)
@@ -1,13 +1,10 @@
-#include <Until.h>
-
-#include <UiObject.h>
-#include <loguru.hpp>
+#include "Aurum.h"
 
 std::function<bool(const ISearchable *)> Until::hasObject(
     const std::shared_ptr<UiSelector> selector)
 {
     return [=](const ISearchable *searchable) -> bool {
-        LOG_SCOPE_F(INFO, "Until::hasObject search:%p", searchable);
+        dlog_print(DLOG_INFO, LOG_TAG, "Until::hasObject search:%p", searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj.get() != nullptr;
     };
@@ -17,7 +14,7 @@ std::function<std::shared_ptr<UiObject>(const ISearchable *)> Until::findObject(
     const std::shared_ptr<UiSelector> selector)
 {
     return [=](const ISearchable *searchable) -> std::shared_ptr<UiObject> {
-        LOG_SCOPE_F(INFO, "Until::findObject search:%p", searchable);
+        dlog_print(DLOG_INFO, LOG_TAG, "Until::findObject search:%p", searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj;
     };
@@ -26,7 +23,7 @@ std::function<std::shared_ptr<UiObject>(const ISearchable *)> Until::findObject(
 std::function<bool(const UiObject *)> Until::checkable(const bool isCheckable)
 {
     return [=](const UiObject *object) -> bool {
-        LOG_SCOPE_F(INFO, "Until::checkable checkable:%d for obj %p", isCheckable, object);
+        dlog_print(DLOG_INFO, LOG_TAG, "Until::checkable checkable:%d for obj %p", isCheckable, object);
         return object->isClickable() == isCheckable;
     };
 }
index bdee46af770e679370d46b3f7feb816cd307a210..dfb2ae88fb7dca2890e688f695ef61914e4f3921 100644 (file)
@@ -1,12 +1,8 @@
-#include "Waiter.h"
+#include "Aurum.h"
 #include <unistd.h>
 #include <chrono>
 #include <thread>
 
-#include "ISearchable.h"
-#include "UiObject.h"
-#include <loguru.hpp>
-
 Waiter::Waiter() : Waiter(nullptr) {}
 
 Waiter::~Waiter() {}
@@ -32,7 +28,7 @@ template bool Waiter::waitFor(
 template <typename R>
 R Waiter::waitFor(const std::function<R(const ISearchable *)> condition) const
 {
-    LOG_SCOPE_F(INFO, "Waiter::waitFor ISearchable");
+    dlog_print(DLOG_INFO, LOG_TAG, "Waiter::waitFor ISearchable");
     // startTime = currentTime();
     std::chrono::system_clock::time_point start =
         std::chrono::system_clock::now();
@@ -51,7 +47,7 @@ R Waiter::waitFor(const std::function<R(const ISearchable *)> condition) const
 template <typename R>
 R Waiter::waitFor(const std::function<R(const UiObject *)> condition) const
 {
-    LOG_SCOPE_F(INFO, "Waiter::waitFor UiObject");
+    dlog_print(DLOG_INFO, LOG_TAG, "Waiter::waitFor UiObject");
     if (mUiObject) {
         std::chrono::system_clock::time_point start =
             std::chrono::system_clock::now();
index 065d7b6a4c7ec476a97a211f472dc509a3543636..7e14f5dc3e8eea505e0495a6e59e075bf2ea5970 100644 (file)
@@ -24,6 +24,7 @@ BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-appfw-app-control)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-appfw-service-application)
+BuildRequires: pkgconfig(dlog)
 BuildRequires: pkgconfig(capi-system-device)
 BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(capi-system-system-settings)