libaurum, bootstrap: change log system to dlog instead of loguru 93/260893/4
authorWoochanlee <wc0917.lee@samsung.com>
Tue, 6 Jul 2021 09:03:35 +0000 (18:03 +0900)
committerWoochanlee <wc0917.lee@samsung.com>
Wed, 7 Jul 2021 07:01:06 +0000 (16:01 +0900)
Change-Id: Ib2af00fb9cc14555e869e1fd4c568680a7695eca

42 files changed:
libaurum/inc/Aurum.h
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/Accessibility/AccessibleUtils.cc
libaurum/src/Accessibility/AccessibleWatcher.cc
libaurum/src/Comparer.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc
libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc
libaurum/src/Impl/TizenDeviceImpl.cc
libaurum/src/Runnable/SendKeyRunnable.cc
libaurum/src/UiObject.cc
libaurum/src/Until.cc
libaurum/src/Waiter.cc
org.tizen.aurum-bootstrap/inc/bootstrap.h [new file with mode: 0644]
org.tizen.aurum-bootstrap/src/AurumServiceImpl.cc
org.tizen.aurum-bootstrap/src/BootstrapServer.cc
org.tizen.aurum-bootstrap/src/Commands/ClearCommand.cc
org.tizen.aurum-bootstrap/src/Commands/ClickCommand.cc
org.tizen.aurum-bootstrap/src/Commands/CloseAppCommand.cc
org.tizen.aurum-bootstrap/src/Commands/Command.cc
org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc
org.tizen.aurum-bootstrap/src/Commands/FindElementCommand.cc
org.tizen.aurum-bootstrap/src/Commands/FlickCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetAppInfoCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetAttributeCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetDeviceTimeCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetLocationCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetSizeCommand.cc
org.tizen.aurum-bootstrap/src/Commands/GetValueCommand.cc
org.tizen.aurum-bootstrap/src/Commands/InstallAppCommand.cc
org.tizen.aurum-bootstrap/src/Commands/KillServerCommand.cc
org.tizen.aurum-bootstrap/src/Commands/LaunchAppCommand.cc
org.tizen.aurum-bootstrap/src/Commands/LongClickCommand.cc
org.tizen.aurum-bootstrap/src/Commands/PostCommand.cc
org.tizen.aurum-bootstrap/src/Commands/PreCommand.cc
org.tizen.aurum-bootstrap/src/Commands/RemoveAppCommand.cc
org.tizen.aurum-bootstrap/src/Commands/SendKeyCommand.cc
org.tizen.aurum-bootstrap/src/Commands/SetValueCommand.cc
org.tizen.aurum-bootstrap/src/Commands/TakeScreenshotCommand.cc
org.tizen.aurum-bootstrap/src/Commands/TouchDownCommand.cc
org.tizen.aurum-bootstrap/src/Commands/TouchMoveCommand.cc
org.tizen.aurum-bootstrap/src/Commands/TouchUpCommand.cc
org.tizen.aurum-bootstrap/src/ObjectMapper.cc

index 76e7405473bb32e8cd37bfff7e41b587370ba98c..63f6fcdc19cfaf5e1dc4f9c4ddd5bde276ab4a10 100644 (file)
@@ -3,11 +3,30 @@
 
 #include <dlog.h>
 
-#ifdef  LOG_TAG
-#undef  LOG_TAG
+#ifdef LOG_TAG
+#undef LOG_TAG
 #endif
 #define LOG_TAG "AURUM"
 
+#ifndef LOGI
+#define LOGI(fmt, arg...) \
+    ({ do { \
+        dlog_print(DLOG_INFO, LOG_TAG, \
+                   "%s: %s(%d) > " fmt, __FILE__, __func__, __LINE__, ##arg); \
+    } while (0); })
+#endif
+
+#ifndef LOGE
+#define FONT_RED    "\033[31m"
+#define FONT_RESET  "\033[0m"
+#define LOGI_RED(fmt, arg...) \
+    ({ do { \
+        dlog_print(DLOG_ERROR, LOG_TAG, \
+                   FONT_RED "%s: %s(%d) > " fmt FONT_RESET, \
+                   __FILE__, __func__, __LINE__, ##arg); \
+    } while (0); })
+#endif
+
 #include "UiDevice.h"
 #include "UiObject.h"
 #include "UiSelector.h"
index db1c386f5706063cd5343f63194b804bba48957c..070d97cfe3fc93f8896cc6d52832a7f65800630e 100644 (file)
@@ -75,7 +75,7 @@ void AccessibleNode::notify(int type, int type2, void *src)
 void AccessibleNode::invalidate()
 {
     std::unique_lock<std::mutex> lock(mLock);
-    dlog_print(DLOG_INFO, LOG_TAG, "object %p is now invalid", this);
+    LOGI("object %p is now invalid", this);
     mValid = false;
 }
 
@@ -100,7 +100,7 @@ void AccessibleNode::print(int depth, int maxDepth)
 void AccessibleNode::print(int d)
 {
     this->refresh();
-    dlog_print(DLOG_INFO, LOG_TAG, "%s %s",std::string(d, ' ').c_str(), description().c_str());
+    LOGI("%s %s",std::string(d, ' ').c_str(), description().c_str());
 }
 
 bool AccessibleNode::isSupporting(AccessibleNodeInterface thisIface) const
index 76e07921af457f597313687f62315a3c8e4a77af..b126880c4c6a3e602a9d46a15a54c6a3d1b206fb 100644 (file)
@@ -108,11 +108,11 @@ static void _print_stateset_debug( AtspiStateSet *stateSet)
 
    char *state_name = NULL;
    AtspiStateType stat;
-   dlog_print(DLOG_INFO, LOG_TAG, "check ss:%p s:%p, len:%d", stateSet, states, states->len);
+   LOGI("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);
-      dlog_print(DLOG_INFO, LOG_TAG, "state: %s", state_name);
+      LOGI("state: %s", state_name);
       free(state_name);
    }
    g_array_free(states, 1);
index f9636e7e6f0667548e7d099b3ab39a0240270862..4ff9548e90df947c0837140ed8afb1e04bd4aa81 100644 (file)
@@ -57,17 +57,17 @@ AccessibleWatcher *AccessibleWatcher::getInstance(AccessibleWatcher *watcherImpl
 
 std::vector<std::shared_ptr<AccessibleApplication>> AccessibleWatcher::getActiveApplications(void) const
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "getActiveApplications for this(%p)", this);
+    LOGI("getActiveApplications for this(%p)", this);
 
     std::vector<std::shared_ptr<AccessibleApplication>> ret{};
     auto apps = this->getApplications();
-    dlog_print(DLOG_INFO, LOG_TAG, "apps size %d", apps.size());
+    LOGI("apps size %d", apps.size());
 
     apps.erase(std::remove_if(apps.begin(), apps.end(), [](auto app){
         return !app->isActive();
     }), apps.end());
 
-    dlog_print(DLOG_INFO, LOG_TAG, "active apps size %d", apps.size());
+    LOGI("active apps size %d", apps.size());
 
     return apps;
 }
@@ -75,7 +75,6 @@ std::vector<std::shared_ptr<AccessibleApplication>> AccessibleWatcher::getActive
 void AccessibleWatcher::attach(std::shared_ptr<IEventConsumer> source)
 {
     std::unique_lock<std::mutex> lock(mLock);
-    dlog_print(DLOG_INFO, LOG_TAG, "source attached %p", source.get());
     if (source) {
         mSources.insert(source);
     }
@@ -84,7 +83,6 @@ void AccessibleWatcher::attach(std::shared_ptr<IEventConsumer> source)
 void AccessibleWatcher::detach(std::shared_ptr<IEventConsumer> source)
 {
     std::unique_lock<std::mutex> lock(mLock);
-    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 e23cf548e347fbecc93328abf7b7af1d852bbf5f..37ee045d3743edbec384a8437bae603618e3ffc6 100644 (file)
@@ -25,7 +25,7 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(const std::sh
 {
     Comparer comparer(device, selector, 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);
+    LOGI("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);
@@ -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);
-    dlog_print(DLOG_INFO, LOG_TAG, "%d object(s) found", ret.size());
+    LOGI("%d object(s) found", ret.size());
     return ret;
 }
 
@@ -73,14 +73,17 @@ std::vector<std::shared_ptr<AccessibleNode>> Comparer::findObjects(
                 findObjects(childNode, i, depth + 1, partialMatches);
             std::move(std::begin(childret), std::end(childret), std::back_inserter(ret));
 
-            if (!ret.empty() && mEarlyReturn) return ret;
+            if (!ret.empty() && mEarlyReturn) {
+                LOGI("Object found and earlyReturn");
+                return ret;
+            }
         }
     } else {
-        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);
+        LOGI("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()){
-        dlog_print(DLOG_INFO, LOG_TAG, "Found matched = %s with criteria %s", root->description().c_str(), currentMatch->debugPrint().c_str());
+        LOGI("Found matched = %s with criteria %s", root->description().c_str(), currentMatch->debugPrint().c_str());
         ret.push_back(root);
     }
 
index c9d7259b03dab891be1c74ff4fc1263810551ae0..2b165d26fa53915e2cc99a6a23794f6f9292034c 100644 (file)
@@ -15,61 +15,9 @@ AtspiAccessibleNode::AtspiAccessibleNode(AtspiAccessible *node)
     watcher->attach(shared_from_this());
 
     if (mNode) {
-        /*
-        GArray *ifaces = AtspiWrapper::Atspi_accessible_get_interfaces(mNode);
-        if (ifaces) {
-            for (unsigned int i = 0; i < ifaces->len; i++) {
-                char *iface = g_array_index(ifaces, char *, i);
-                if (!strcmp(iface, "Action"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::ACTION);
-                else if (!strcmp(iface, "Collection"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::COLLECTION);
-                else if (!strcmp(iface, "Component"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::COMPONENT);
-                else if (!strcmp(iface, "Document"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::DOCUMENT);
-                else if (!strcmp(iface, "EditableText"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::EDITABLETEXT);
-                else if (!strcmp(iface, "Hypertext"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::HYPERTEXT);
-                else if (!strcmp(iface, "Image"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::IMAGE);
-                else if (!strcmp(iface, "Selection"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::SELECTION);
-                else if (!strcmp(iface, "Text"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::TEXT);
-                else if (!strcmp(iface, "Value"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::VALUE);
-                else if (!strcmp(iface, "Accessible"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::ACCESSIBLE);
-                else if (!strcmp(iface, "Table"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::TABLE);
-                else if (!strcmp(iface, "TableCell"))
-                    mSupportingIfaces |=
-                        static_cast<int>(AccessibleNodeInterface::TABLECELL);
-                else
-                    LOG_F(WARNING, "Not Supported interface found %s", iface);
-
-                g_free(iface);
-            }
-            g_array_free(ifaces, FALSE);
-        }*/
-
         this->refresh();
     } else {
-        dlog_print(DLOG_INFO, LOG_TAG, "AtspiAccessibleNode Ctor : mNode is null");
+        LOGI("AtspiAccessibleNode Ctor : mNode is null");
     }
 }
 
@@ -100,7 +48,6 @@ std::shared_ptr<AccessibleNode> AtspiAccessibleNode::getChildAt(int index) const
         AtspiWrapper::unlock();
         return std::make_shared<AtspiAccessibleNode>(nullptr);
     }
-    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);
@@ -127,10 +74,8 @@ std::shared_ptr<AccessibleNode> AtspiAccessibleNode::getParent() const
     AtspiAccessible *rawParent = AtspiWrapper::Atspi_accessible_get_parent(mNode, NULL);
     AtspiWrapper::unlock();
     return std::make_shared<AtspiAccessibleNode>(rawParent);
-/*  auto node = AccessibleNode::get(parent);
-    if (parent) g_object_unref(parent);
-    return node; */
 }
+
 bool AtspiAccessibleNode::isValid() const
 {
     if(!AccessibleNode::isValid())  return false;
@@ -146,7 +91,6 @@ bool AtspiAccessibleNode::isValid() const
     return true;
 }
 
-
 void* AtspiAccessibleNode::getRawHandler(void) const
 {
     return static_cast<void*>(mNode);
@@ -312,7 +256,7 @@ void AtspiAccessibleNode::setValue(std::string text)
     }
 
     AtspiEditableText *iface = AtspiWrapper::Atspi_accessible_get_editable_text(mNode);
-    dlog_print(DLOG_INFO, LOG_TAG, "set Value iface:%p obj:%p text:%s", iface, mNode, text.c_str() );
+    LOGI("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);
@@ -324,10 +268,6 @@ void AtspiAccessibleNode::setValue(std::string text)
 
 void AtspiAccessibleNode::setFeatureProperty(AtspiStateType type)
 {
-/*
-    LONGCLICKABLE = 0X0040,
-    SCROLLABLE = 0X0080,
-*/
     switch(type) {
         case ATSPI_STATE_CHECKED:
             setFeatureProperty(NodeFeatureProperties::CHECKED, true);
index bffa4035017143e500de2ccc01c208210dfb7d68..b15e4407e7b4c8782c8f15ff01ed9631407d4863 100644 (file)
@@ -22,12 +22,12 @@ static bool iShowingNode(AtspiAccessible *node)
     if (node) name = AtspiWrapper::Atspi_accessible_get_name(node, NULL);
     else return false;
 
-    dlog_print(DLOG_INFO, LOG_TAG, "isShowing %s", name);
+    LOGI("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)) {
-        dlog_print(DLOG_INFO, LOG_TAG, "active and showing %p %s", node, name);
+        LOGI("active and showing %p %s", node, name);
         free(name);
         g_object_unref(stateSet);
         return true;
@@ -41,14 +41,14 @@ static std::vector<AtspiAccessible *>
 findActiveNode(AtspiAccessible *node, int depth,
                                        int max_depth)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "findActiveNode %p %d/%d", node, depth, max_depth);
+    LOGI("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) {
-            dlog_print(DLOG_INFO, LOG_TAG, "%s", name);
+            LOGI("%s", name);
             free(name);
         }
         ret.push_back(node);
@@ -60,10 +60,10 @@ findActiveNode(AtspiAccessible *node, int depth,
     int nchild = AtspiWrapper::Atspi_accessible_get_child_count(node, NULL);
     if (nchild <= 0) return ret;
 
-    dlog_print(DLOG_INFO, LOG_TAG, "findActiveNode node %p has %d children", node, nchild);
+    LOGI("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);
-        dlog_print(DLOG_INFO, LOG_TAG, "a child found @ %d : %p", i, child);
+        LOGI("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);
@@ -74,7 +74,7 @@ findActiveNode(AtspiAccessible *node, int depth,
 
 static gpointer _event_thread_loop (gpointer data)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "event thread start");
+    LOGI("event thread start");
     AtspiEventListener * listener =
         atspi_event_listener_new(AtspiAccessibleWatcher::onAtspiEvents, data, NULL);
 
@@ -83,7 +83,7 @@ static gpointer _event_thread_loop (gpointer data)
 
     atspi_event_main();
 
-    dlog_print(DLOG_INFO, LOG_TAG, "event thread end");
+    LOGI("event thread end");
     atspi_event_listener_deregister(listener, "object:", NULL);
     atspi_event_listener_deregister(listener, "window:", NULL);
 
@@ -168,98 +168,63 @@ void AtspiAccessibleWatcher::onAtspiEvents(AtspiEvent *event, void *user_data)
     }
     if (name) free(name);
     if (pkg) free(pkg);
-/*    char *name = NULL, *pname = NULL;
-    AtspiAccessibleWatcher *instance = (AtspiAccessibleWatcher *)user_data;
 
-    if (!event->source)
-    {
-        LOG_F(INFO, "event->source is NULL. Skip event handling");
-        return;
-    }
-
-    name = AtspiWrapper::Atspi_accessible_get_name(event->source, NULL);
-    AtspiAccessible *parent = AtspiWrapper::Atspi_accessible_get_parent(event->source, NULL);
-    if (parent) {
-        pname = AtspiWrapper::Atspi_accessible_get_name(parent, NULL);
-        g_object_unref(parent);
-    }
-
-    if (!strcmp(event->type, "window:activate")) {
-        instance->onWindowActivated(
-            static_cast<AtspiAccessible *>(event->source),
-            static_cast<WindowActivateInfoType>(event->detail1));
-    } else if (!strcmp(event->type, "window:deactivate")) {
-        instance->onWindowDeactivated(static_cast<AtspiAccessible *>(event->source));
-    } else if (!strcmp(event->type, "window:create")) {
-        instance->onWindowCreated(static_cast<AtspiAccessible *>(event->source));
-    } else if (!strcmp(event->type, "window:destroy")) {
-        instance->onWindowDestroyed(static_cast<AtspiAccessible *>(event->source));
-    } else if (!strcmp(event->type, "object:state-changed:visible")) {
-        instance->onVisibilityChanged(
-            static_cast<AtspiAccessible *>(event->source),
-            (event->detail1 != 0));
-    } else if (!strcmp(event->type, "object:state-changed:defunct")) {
-        instance->onObjectDefunct(
-            static_cast<AtspiAccessible *>(event->source));
-    }
-    if (name) free(name);
-    if (pname) free(pname);*/
     AtspiWrapper::unlock();
 }
 
 void AtspiAccessibleWatcher::print_debug()
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "activatewindowlist-------------------");
+    LOGI("activatewindowlist-------------------");
     std::for_each(mActivatedWindowList.begin(), mActivatedWindowList.end(), [](auto acc){
-        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
+        LOGI("child:%p", acc);
     });
 
-    dlog_print(DLOG_INFO, LOG_TAG, "mActivatedApplicationList--------------------------");
+    LOGI("mActivatedApplicationList--------------------------");
     std::for_each(mActivatedApplicationList.begin(), mActivatedApplicationList.end(), [](auto acc){
-        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
+        LOGI("child:%p", acc);
     });
 
-    dlog_print(DLOG_INFO, LOG_TAG, "mWindowSet------------------------------");
+    LOGI("mWindowSet------------------------------");
     std::for_each(mWindowSet.begin(), mWindowSet.end(), [](auto acc){
-        dlog_print(DLOG_INFO, LOG_TAG, "child:%p", acc);
+        LOGI("child:%p", acc);
     });
-    dlog_print(DLOG_INFO, LOG_TAG, "------------------------------");
+    LOGI("------------------------------");
 }
 
 void AtspiAccessibleWatcher::onWindowActivated(AtspiAccessible *node,
                             WindowActivateInfoType type)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onWindowActivated obj:%p", node);
+    LOGI("onWindowActivated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowActivated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowDeactivated(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onWindowDeactivated obj:%p", node);
+    LOGI("onWindowDeactivated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowDeactivated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowCreated(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onWindowCreated obj:%p", node);
+    LOGI("onWindowCreated obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowCreated, node);
 }
 
 void AtspiAccessibleWatcher::onWindowDestroyed(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onWindowDestroyed obj:%p", node);
+    LOGI("onWindowDestroyed obj:%p", node);
     notifyAll((int)EventType::Window, (int)WindowEventType::WindowDestroyed, node);
 }
 
 void AtspiAccessibleWatcher::onVisibilityChanged(AtspiAccessible *node, bool visible)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onVisibilityChanged obj:%p", node);
+    LOGI("onVisibilityChanged obj:%p", node);
     notifyAll((int)EventType::Object, (int)ObjectEventType::ObjectStateVisible, node);
 }
 
 void AtspiAccessibleWatcher::onObjectDefunct(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "onObjectDefunct obj:%p", node);
+    LOGI("onObjectDefunct obj:%p", node);
     notifyAll((int)EventType::Object, (int)ObjectEventType::ObjectStateDefunct, node);
 }
 
@@ -290,7 +255,7 @@ std::shared_ptr<AccessibleApplication> AtspiAccessibleWatcher::getApplicationAt(
 std::vector<std::shared_ptr<AccessibleApplication>> AtspiAccessibleWatcher::getApplications(void) const
 {
     AtspiWrapper::lock();
-    dlog_print(DLOG_INFO, LOG_TAG, "getApplications for this(%p)", this);
+    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);
@@ -332,16 +297,16 @@ bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const
         mEventQueue.clear();
         AtspiWrapper::unlock();
 
-               if (!localEvents.empty())
-               {
+        if (!localEvents.empty())
+        {
             for (const auto &event : localEvents) {
                 if (COMPARE(type, event->getEvent()))
-                               {
-                    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; 
-                               }
-                       }
-               }
+                {
+                    LOGI("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;
+                }
+            }
+        }
         if ((std::chrono::system_clock::now() - start) >
             std::chrono::milliseconds{timeout})
             break;
@@ -354,11 +319,11 @@ bool AtspiAccessibleWatcher::executeAndWaitForEvents(const Runnable *cmd, const
 
 bool AtspiAccessibleWatcher::removeFromActivatedList(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "remove from activelist node %p", node);
+    LOGI("remove from activelist node %p", node);
     mActivatedWindowList.remove_if([&](auto &n) { return n == node; });
 
     AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(node, NULL);
-    dlog_print(DLOG_INFO, LOG_TAG, "node:%p, app:%p", node, app);
+    LOGI("node:%p, app:%p", node, app);
     if (app) {
         mActivatedApplicationList.remove_if([&](auto &n) { return n == app; });
         g_object_unref(app);
@@ -368,7 +333,7 @@ bool AtspiAccessibleWatcher::removeFromActivatedList(AtspiAccessible *node)
 
 bool AtspiAccessibleWatcher::addToActivatedList(AtspiAccessible *node)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "add to activelist node %p", node);
+    LOGI("add to activelist node %p", node);
     mActivatedWindowList.remove_if([&](auto &n) { return n == node; });
     mActivatedWindowList.push_front(node);
 
@@ -376,7 +341,7 @@ bool AtspiAccessibleWatcher::addToActivatedList(AtspiAccessible *node)
     if ( iter == mWindowSet.end()) mWindowSet.insert(node);
 
     AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(node, NULL);
-    dlog_print(DLOG_INFO, LOG_TAG, "node:%p, app:%p", node, app);
+    LOGI("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 82fc92603c9e558a8ad460dfeb79169c2f689c12..446d04152acd9a9ecbf719ace31105ed6e4bcd83 100644 (file)
 #include <tbm_surface.h>
 #include <system_info.h>
 
+#define NANO_SEC 1000000000.0
+#define MICRO_SEC 1000000
+
 TizenDeviceImpl::TizenDeviceImpl()
 : mFakeTouchHandle{0}, mFakeKeyboardHandle{0}, mFakeWheelHandle{0}, tStart{}, isTimerStarted{false}, mTouchSeq{}
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "device implementation init");
+    LOGI("device implementation init");
     TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
     obj->mFakeTouchHandle = efl_util_input_initialize_generator(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN);
     obj->mFakeKeyboardHandle =
@@ -39,7 +42,7 @@ bool TizenDeviceImpl::click(const int x, const int y)
 
 bool TizenDeviceImpl::click(const int x, const int y, const unsigned int intv)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "click %d %d , intv:%d", x, y, intv);
+    LOGI("click %d %d , intv:%d", x, y, intv);
 
     int seq = touchDown(x, y);
     if (seq < 0) return false;
@@ -53,7 +56,7 @@ bool TizenDeviceImpl::click(const int x, const int y, const unsigned int intv)
 int TizenDeviceImpl::touchDown(const int x, const int y)
 {
     int seq = grabTouchSeqNumber();
-    dlog_print(DLOG_INFO, LOG_TAG, "touch down %d %d , seq:%d", x, y, seq);
+    LOGI("touch down %d %d , seq:%d", x, y, seq);
     if (seq >= 0) {
          TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
          long result = (long)efl_util_input_generate_touch(obj->mFakeTouchHandle, seq, EFL_UTIL_INPUT_TOUCH_BEGIN,
@@ -69,7 +72,7 @@ int TizenDeviceImpl::touchDown(const int x, const int y)
 
 bool TizenDeviceImpl::touchMove(const int x, const int y, const int seq)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "touch move %d %d, seq:%d", x, y, seq);
+    LOGI("touch move %d %d, seq:%d", x, y, seq);
     if (seq >= 0) {
          TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
          long result = (long)efl_util_input_generate_touch(obj->mFakeTouchHandle, seq, EFL_UTIL_INPUT_TOUCH_UPDATE,
@@ -81,7 +84,7 @@ bool TizenDeviceImpl::touchMove(const int x, const int y, const int seq)
 
 bool TizenDeviceImpl::touchUp(const int x, const int y, const int seq)
 {
-   dlog_print(DLOG_INFO, LOG_TAG, "touch up %d %d, seq:%d", x, y, seq);
+   LOGI("touch up %d %d, seq:%d", x, y, seq);
    if (seq >= 0) {
         TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
         long result = (long)efl_util_input_generate_touch(obj->mFakeTouchHandle, seq, EFL_UTIL_INPUT_TOUCH_END,
@@ -93,7 +96,7 @@ bool TizenDeviceImpl::touchUp(const int x, const int y, const int seq)
 
 bool TizenDeviceImpl::wheelUp(int amount, const int durationMs)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "wheel up %d for %d", amount, durationMs);
+    LOGI("wheel up %d for %d", amount, durationMs);
     long result = -1;
     TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
     obj->mFakeWheelHandle = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_POINTER, NULL);
@@ -109,7 +112,7 @@ bool TizenDeviceImpl::wheelUp(int amount, const int durationMs)
 
 bool TizenDeviceImpl::wheelDown(int amount, const int durationMs)
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "wheel down %d for %d", amount, durationMs);
+    LOGI("wheel down %d for %d", amount, durationMs);
     long result = -1;
     TizenDeviceImpl *obj = static_cast<TizenDeviceImpl*>(this);
     obj->mFakeWheelHandle = efl_util_input_initialize_generator_with_sync(EFL_UTIL_INPUT_DEVTYPE_POINTER, NULL);
@@ -134,7 +137,7 @@ int TizenDeviceImpl::stopTimer(void)
     if (!isTimerStarted) return 0;
     isTimerStarted = false;
     clock_gettime(CLOCK_MONOTONIC, &tEnd);
-    return ((tEnd.tv_sec + tEnd.tv_nsec/1000000000.0) - (tStart.tv_sec + tStart.tv_nsec/1000000000.0)) * 1000000;
+    return ((tEnd.tv_sec + tEnd.tv_nsec/NANO_SEC) - (tStart.tv_sec + tStart.tv_nsec/NANO_SEC)) * MICRO_SEC;
 }
 
 bool TizenDeviceImpl::drag(const int sx, const int sy, const int ex, const int ey,
@@ -156,7 +159,7 @@ bool TizenDeviceImpl::drag(const int sx, const int sy, const int ex, const int e
         _steps = (int)(_durationUs / (INTV_MINIMUM_DRAG_MS * MSEC_PER_SEC)) - 1;
         _stepUs  = (INTV_MINIMUM_DRAG_MS * MSEC_PER_SEC);
     }
-    dlog_print(DLOG_INFO, LOG_TAG, "flicking (%d, %d) -> (%d, %d) for (%d ms)", sx, sy, ex, ey, durationMs);
+    LOGI("flicking (%d, %d) -> (%d, %d) for (%d ms)", sx, sy, ex, ey, durationMs);
     startTimer();
     int seq = touchDown(sx, sy);
     if (seq < 0) return false;
index fc1f54cb90d508f62e17d53f17e9c4bc9a21cb62..61d313859925f83d56c9fe87ecff184afe996b74 100644 (file)
@@ -7,9 +7,9 @@ SendKeyRunnable::SendKeyRunnable(std::string keycode)
 
 void SendKeyRunnable::run() const
 {
-       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);
+    LOGI("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 10956690073e6bc7c904b3affa27f218992dce56..db48098cd8afb889a2939e2ce415bf64e3b3dacf 100644 (file)
@@ -86,7 +86,7 @@ std::vector<std::shared_ptr<UiObject>> UiObject::findObjects(
     auto nodes = Comparer::findObjects(mDevice, selector, getAccessibleNode());
     for ( auto& node : nodes) {
         if (!node) {
-            dlog_print(DLOG_INFO, LOG_TAG, "Skipped! (node == nullptr)");
+            LOGI("Skipped! (node == nullptr)");
             continue;
         }
         result.push_back(std::make_shared<UiObject>(mDevice, selector, std::move(node)));
index 324635b4e27fcdb41b9d2f2ec81905401be34128..987627a891c335f6baecd964467aeff15c21f1e6 100644 (file)
@@ -4,7 +4,7 @@ std::function<bool(const ISearchable *)> Until::hasObject(
     const std::shared_ptr<UiSelector> selector)
 {
     return [=](const ISearchable *searchable) -> bool {
-        dlog_print(DLOG_INFO, LOG_TAG, "Until::hasObject search:%p", searchable);
+        LOGI("Until::hasObject search:%p", searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj.get() != nullptr;
     };
@@ -14,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> {
-        dlog_print(DLOG_INFO, LOG_TAG, "Until::findObject search:%p", searchable);
+        LOGI("Until::findObject search:%p", searchable);
         std::shared_ptr<UiObject> obj = searchable->findObject(selector);
         return obj;
     };
@@ -23,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 {
-        dlog_print(DLOG_INFO, LOG_TAG, "Until::checkable checkable:%d for obj %p", isCheckable, object);
+        LOGI("Until::checkable checkable:%d for obj %p", isCheckable, object);
         return object->isClickable() == isCheckable;
     };
 }
index dfb2ae88fb7dca2890e688f695ef61914e4f3921..05b4f638044f42c2603bf40e2535ab55d2afa1cb 100644 (file)
@@ -28,8 +28,7 @@ template bool Waiter::waitFor(
 template <typename R>
 R Waiter::waitFor(const std::function<R(const ISearchable *)> condition) const
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "Waiter::waitFor ISearchable");
-    // startTime = currentTime();
+    LOGI("Waiter::waitFor ISearchable");
     std::chrono::system_clock::time_point start =
         std::chrono::system_clock::now();
     R result = condition(mSearchableObject);
@@ -47,7 +46,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
 {
-    dlog_print(DLOG_INFO, LOG_TAG, "Waiter::waitFor UiObject");
+    LOGI("Waiter::waitFor UiObject");
     if (mUiObject) {
         std::chrono::system_clock::time_point start =
             std::chrono::system_clock::now();
diff --git a/org.tizen.aurum-bootstrap/inc/bootstrap.h b/org.tizen.aurum-bootstrap/inc/bootstrap.h
new file mode 100644 (file)
index 0000000..429e4e5
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef _BOOTSTRAP_H_
+#define _BOOTSTRAP_H_
+
+#include <dlog.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "AURUM-BOOTSTRAP"
+
+#ifndef LOGI
+#define LOGI(fmt, arg...) \
+    ({ do { \
+        dlog_print(DLOG_INFO, LOG_TAG, \
+                   "%s: %s(%d) > " fmt, __FILE__, __func__, __LINE__, ##arg); \
+    } while (0); })
+#endif
+
+#ifndef LOGE
+#define FONT_RED    "\033[31m"
+#define FONT_RESET  "\033[0m"
+#define LOGI_RED(fmt, arg...) \
+    ({ do { \
+        dlog_print(DLOG_ERROR, LOG_TAG, \
+                   FONT_RED "%s: %s(%d) > " fmt FONT_RESET, \
+                   __FILE__, __func__, __LINE__, ##arg); \
+    } while (0); })
+#endif
+
+#endif
\ No newline at end of file
index 8cf45271fcc799c1ac3c06b4ef6187e48b5a864a..e733b2305b65d1722a5a0f583951d8e5cce8bb8b 100644 (file)
@@ -6,7 +6,6 @@
 #include "Commands/PreCommand.h"
 
 #include "config.h"
-#include <loguru.hpp>
 
 using namespace grpc;
 using namespace aurum;
index aa70fd3505594cabbe6ea3f027480965c67ba221..827fcee0cc447c0d63e0c63081715ed7f8022625 100644 (file)
@@ -1,5 +1,6 @@
 #include <iostream>
 #include <glib.h>
+#include "bootstrap.h"
 
 #include <service_app.h>
 #include <privacy_privilege_manager.h>
@@ -10,7 +11,6 @@
 
 #include "AurumServiceImpl.h"
 #include "config.h"
-#include <loguru.hpp>
 
 #define PRIV_MEDIASTORAGE "http://tizen.org/privilege/mediastorage"
 #define PRIV_LOCATION "http://tizen.org/privilege/location"
@@ -31,10 +31,9 @@ _grpc_thread_func (gpointer data)
     aurumServiceImpl service;
     ServerBuilder builder;
 
-    LOG_F(INFO, "[T] Server Listening on %s", binding.c_str());
+    LOGI("[T] Server Listening on %s", binding.c_str());
     builder.AddListeningPort(binding, grpc::InsecureServerCredentials());
     builder.RegisterService(&service);
-    //std::unique_ptr<Server> server(builder.BuildAndStart());
     ctx->server = std::move(builder.BuildAndStart());
     ctx->server->Wait();
 
@@ -46,22 +45,22 @@ reponse_cb(ppm_call_cause_e cause, ppm_request_result_e result,
                                       const char *privilege, void *user_data)
 {
     if (cause == PRIVACY_PRIVILEGE_MANAGER_CALL_CAUSE_ERROR) {
-        LOG_F(INFO, "PPM Error PRIVACY_PRIVILEGE_MANAGER_CALL_CAUSE_ERROR");
+        LOGI("PPM Error PRIVACY_PRIVILEGE_MANAGER_CALL_CAUSE_ERROR");
         return;
     }
 
     switch (result) {
         case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER:
-            LOG_F(INFO, "priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
+            LOGI("priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
             break;
         case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_DENY_FOREVER:
-            LOG_F(INFO, "priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
+            LOGI("priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
             break;
         case PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_DENY_ONCE:
-            LOG_F(INFO, "priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
+            LOGI("priv:%s PRIVACY_PRIVILEGE_MANAGER_REQUEST_RESULT_ALLOW_FOREVER", privilege);
             break;
         default:
-            LOG_F(INFO, "priv:%s default", privilege);
+            LOGI("priv:%s default", privilege);
             break;
     }
 }
@@ -71,7 +70,7 @@ check_permission(char *path_privilege)
 {
     ppm_check_result_e result;
     int ret;
-    LOG_F(INFO, "path_privilege = %s",path_privilege);
+    LOGI("path_privilege = %s",path_privilege);
     ret = ppm_check_permission(path_privilege, &result);
 
     if (ret == PRIVACY_PRIVILEGE_MANAGER_ERROR_NONE) {
@@ -80,12 +79,12 @@ check_permission(char *path_privilege)
                 break;
 
             case PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_DENY:
-                LOG_F(INFO, "PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_DENY");
+                LOGI("PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_DENY");
                 ;
                 break;
 
             case PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_ASK:
-                LOG_F(INFO, "PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_ASK");
+                LOGI("PRIVACY_PRIVILEGE_MANAGER_CHECK_RESULT_ASK");
                 ppm_request_permission(path_privilege, reponse_cb, NULL);
                 break;
 
@@ -93,7 +92,7 @@ check_permission(char *path_privilege)
                 break;
         }
     } else {
-        LOG_F(INFO, "Error to check permission[0x%x]", ret);
+        LOGI("Error to check permission[0x%x]", ret);
     }
 }
 
@@ -101,12 +100,6 @@ check_permission(char *path_privilege)
 static bool _service_app_create(void *data)
 {
     ServiceContext *ctx = (ServiceContext*)data;
-    const char *logPath = "/tmp/ua.log";
-
-
-    loguru::g_preamble = false;
-    loguru::add_file(logPath, loguru::Append, loguru::Verbosity_MAX);
-    LOG_SCOPE_F(INFO, "Log : %s", logPath);
 
     ctx->loop = g_main_loop_new ( NULL , FALSE );
     ctx->thread = g_thread_new("grpc_thread", _grpc_thread_func, ctx);
@@ -149,7 +142,7 @@ int main(int argc, char **argv)
     try {
        result = service_app_main(argc, argv, &event_callback, &ctx);
     } catch (const std::exception& e) {
-       LOG_F(INFO, "service_app_main exception: %s", e.what());
+       LOGI("service_app_main exception: %s", e.what());
     }
 
     return result;
index 352c53714624b66665a81f699bd60ae6617f74cc..3b80401fcd5fc3f60dd3fbf712ec5ea674589d24 100644 (file)
@@ -1,6 +1,5 @@
+#include "bootstrap.h"
 #include "ClearCommand.h"
-#include <UiObject.h>
-#include <loguru.hpp>
 #include <string>
 
 ClearCommand::ClearCommand(const ::aurum::ReqClear* request,
@@ -25,7 +24,7 @@ bool ClearCommand::hasHintText(std::shared_ptr<UiObject> obj)
 
 ::grpc::Status ClearCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "Clear --------------- ");
+    LOGI("Clear --------------- ");
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
 
index 8340168153a6361e3cb268e323ec7be4532c3934..0b745273de6f15d6f77fa8ede6b79744d07474df 100644 (file)
@@ -1,10 +1,8 @@
+#include "bootstrap.h"
 #include "ClickCommand.h"
-
 #include "UiObject.h"
 #include "UiDevice.h"
 
-#include <loguru.hpp>
-
 ClickCommand::ClickCommand(const ::aurum::ReqClick* request,
                            ::aurum::RspClick*       response)
     : mRequest{request}, mResponse{response}
@@ -34,7 +32,7 @@ std::unique_ptr<ClickCommand> ClickCommand::createCommand(const ::aurum::ReqClic
 {
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
-    LOG_SCOPE_F(INFO, "ClickElementCommand execute %p", obj);
+    LOGI("ClickElementCommand execute %p", obj.get());
 
     if (obj) {
         obj->click();
@@ -49,7 +47,7 @@ std::unique_ptr<ClickCommand> ClickCommand::createCommand(const ::aurum::ReqClic
 {
     std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
     const ::aurum::Point& point = mRequest->coordination();
-    LOG_SCOPE_F(INFO, "ClickCoordCommand execute %p @ (%d, %d)", obj.get(), point.x(), point.y());
+    LOGI("ClickCoordCommand execute %p @ (%d, %d)", obj.get(), point.x(), point.y());
     obj->click(point.x(), point.y());
     mResponse->set_status(::aurum::RspStatus::OK);
     return grpc::Status::OK;
@@ -60,7 +58,7 @@ std::unique_ptr<ClickCommand> ClickCommand::createCommand(const ::aurum::ReqClic
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
 
-    LOG_SCOPE_F(INFO, "ClickAtspiCommand execute %p", obj);
+    LOGI("ClickAtspiCommand execute %p", obj.get());
 
     if (obj) {
         if (obj->DoAtspiActivate()) mResponse->set_status(::aurum::RspStatus::OK);
index 3221d365fb73287e63336d168d091d4e4ac96030..f40f7cb2a913b301cafd9f44e8539bb0141a3e69 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "CloseAppCommand.h"
-#include <loguru.hpp>
 #include <chrono>
 #include <thread>
 #ifdef GBSBUILD
@@ -14,22 +14,22 @@ CloseAppCommand::CloseAppCommand(const ::aurum::ReqCloseApp* request,
 
 ::grpc::Status CloseAppCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "CloseApp --------------- ");
+    LOGI("CloseApp --------------- ");
 #ifdef GBSBUILD
     std::string   packageName = mRequest->packagename();
     app_context_h app_context = NULL;
 
-    LOG_F(INFO, "close req : %s", packageName.c_str());
+    LOGI("close req : %s", packageName.c_str());
 
     int ret = app_manager_get_app_context(packageName.c_str(), &app_context);
     if (ret) {
-        LOG_SCOPE_F(INFO, "Terminate Failed(1/2) Err Code : %d", ret);
+        LOGI("Terminate Failed(1/2) Err Code : %d", ret);
         mResponse->set_status(::aurum::RspStatus::ERROR);
         return grpc::Status::OK;
     }
     ret = app_manager_terminate_app(app_context);
     if (ret) {
-        LOG_SCOPE_F(INFO, "Terminate Failed(2/2) Err Code : %d", ret);
+        LOGI("Terminate Failed(2/2) Err Code : %d", ret);
         mResponse->set_status(::aurum::RspStatus::ERROR);
         return grpc::Status::OK;
     }
@@ -39,7 +39,7 @@ CloseAppCommand::CloseAppCommand(const ::aurum::ReqCloseApp* request,
 
 ::grpc::Status CloseAppCommand::executePost()
 {
-    LOG_SCOPE_F(INFO, "CloseAppCommand::executePost");
+    LOGI("CloseAppCommand::executePost");
     std::this_thread::sleep_for(std::chrono::milliseconds{1500});
     return grpc::Status::OK;
 }
\ No newline at end of file
index 71a6eb789d7637c17dedc2b978c883df98325b51..8988bf729ec6bc65f310a345378bfb968dc90a2e 100644 (file)
@@ -1,5 +1,4 @@
 #include "Command.h"
-#include <loguru.hpp>
 
 ::grpc::Status Command::executePost()
 {
index c7c0e4afce738747a762933aaf747b8b153b45bd..b8b7c719878c8da2d1a902d6ab43d67fb42f185a 100644 (file)
@@ -1,14 +1,10 @@
+#include "bootstrap.h"
 #include "DumpObjectTreeCommand.h"
-
-#include "ISearchable.h"
-
-#include "Sel.h"
-#include "UiDevice.h"
 #include "UiObject.h"
+#include "UiDevice.h"
 #include "UiSelector.h"
-
-#include <loguru.hpp>
-
+#include "Sel.h"
+#include "ISearchable.h"
 
 DumpObjectTreeCommand::DumpObjectTreeCommand(const ::aurum::ReqDumpObjectTree* request,
                                                    ::aurum::RspDumpObjectTree* response)
@@ -66,8 +62,8 @@ void DumpObjectTreeCommand::traverse(::aurum::Element *root, std::shared_ptr<Nod
 
 ::grpc::Status DumpObjectTreeCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "DumpObjectTree --------------- ");
-    LOG_F(INFO, "elementid : %s", mRequest->elementid().c_str());
+    LOGI("DumpObjectTree --------------- ");
+    LOGI("elementid : %s", mRequest->elementid().c_str());
     if (mRequest->elementid().length()) {
         auto obj = mObjMap->getElement(mRequest->elementid());
         if (!obj) return grpc::Status::OK;;
index 590806f89a318ff83177d76e9ad981b51100e701..1238b8bdf6b4b739ddb5492b28ed90069b486e57 100644 (file)
@@ -1,13 +1,10 @@
+#include "bootstrap.h"
 #include "FindElementCommand.h"
-
-#include "ISearchable.h"
-
-#include "Sel.h"
-#include "UiDevice.h"
 #include "UiObject.h"
+#include "UiDevice.h"
 #include "UiSelector.h"
-
-#include <loguru.hpp>
+#include "Sel.h"
+#include "ISearchable.h"
 
 FindElementCommand::FindElementCommand(const ::aurum::ReqFindElement* request,
                                        ::aurum::RspFindElement*       response)
@@ -54,7 +51,7 @@ std::vector<std::shared_ptr<UiSelector>> FindElementCommand::getSelectors(void)
 
 ::grpc::Status FindElementCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "findElement --------------- ");
+    LOGI("findElement --------------- ");
     auto searchableObj = getSearchableTop();
     auto selectors     = getSelectors();
 
@@ -72,7 +69,7 @@ std::vector<std::shared_ptr<UiSelector>> FindElementCommand::getSelectors(void)
             key = mObjMap->getElement(found);
             if (key.length() <= 0)
               key = mObjMap->addElement(std::move(found));
-            LOG_F(INFO, "found object : %s key:%s",
+            LOGI("found object : %s key:%s",
                   obj->getAutomationId().c_str(), key.c_str());
             ::aurum::Element* elm = mResponse->add_elements();
             elm->set_elementid(key);
index b468e43b02bf59651b049f419ec9e5159df1f8eb..d1703be21fe5e1213109f169bbe4076e8dbc4b8b 100644 (file)
@@ -1,7 +1,6 @@
+#include "bootstrap.h"
 #include "FlickCommand.h"
-#include <loguru.hpp>
-
-#include <UiDevice.h>
+#include "UiDevice.h"
 
 FlickCommand::FlickCommand(const ::aurum::ReqFlick *request,
                            ::aurum::RspFlick *      response)
@@ -11,7 +10,7 @@ FlickCommand::FlickCommand(const ::aurum::ReqFlick *request,
 
 ::grpc::Status FlickCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "Flick --------------- ");
+    LOGI("Flick --------------- ");
 
     const ::aurum::Point &startPoint = mRequest->startpoint();
     const ::aurum::Point &endPoint = mRequest->endpoint();
index b4c5ff74cdeb2b170cb88b09a4de5de4847844fc..6ecb11569e3f14ffb624e9a146635b58a46db3de 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "GetAppInfoCommand.h"
-#include <loguru.hpp>
 #ifdef GBSBUILD
 #include <app_manager_extension.h>
 #include <package_manager.h>
@@ -13,7 +13,7 @@ GetAppInfoCommand::GetAppInfoCommand(const ::aurum::ReqGetAppInfo* request,
 
 ::grpc::Status GetAppInfoCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "GetAppInfo --------------- ");
+    LOGI("GetAppInfo --------------- ");
 #ifdef GBSBUILD
     std::string packageName = mRequest->packagename();
 
index 5b0ced7deebf8c045cb80d56ffb96149864fe273..38a3686b50f1d712430cd90bb80940bbbc231861 100644 (file)
@@ -1,8 +1,7 @@
+#include "bootstrap.h"
 #include "GetAttributeCommand.h"
-#include <loguru.hpp>
-
-#include <UiDevice.h>
-#include <UiObject.h>
+#include "UiObject.h"
+#include "UiDevice.h"
 
 GetAttributeCommand::GetAttributeCommand(
     const ::aurum::ReqGetAttribute* request, ::aurum::RspGetAttribute* response)
@@ -20,7 +19,7 @@ std::unique_ptr<GetAttributeCommand> GetAttributeCommand::createCommand(const ::
 {
     ::aurum::ReqGetAttribute_RequestType type = request->attribute();
 
-    LOG_SCOPE_F(INFO, "type : %d", type);
+    LOGI("type : %d", type);
 
     if (type == ::aurum::ReqGetAttribute_RequestType::ReqGetAttribute_RequestType_VISIBLE)
         return std::make_unique<GetVisibleAttributeCommand>(request, response);
index 0119a20fb7b9f864b35fb1bd7d151141e47ceb14..8403dc80d7ca45435b7f8b7e254472bd60197bca 100644 (file)
@@ -1,12 +1,10 @@
+#include "bootstrap.h"
 #include "GetDeviceTimeCommand.h"
 
 #include <system_settings.h>
 #include <utils_i18n.h>
-
-#include <loguru.hpp>
-
-#include "UiDevice.h"
 #include <string>
+#include "UiDevice.h"
 
 #define BUFSIZE 64
 
@@ -88,7 +86,7 @@ public:
 
 ::grpc::Status GetDeviceTimeCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "GetDeviceTime --------------- ");
+    LOGI("GetDeviceTime --------------- ");
 
     std::shared_ptr<UiDevice> obj = UiDevice::getInstance();
     ::aurum::ReqGetDeviceTime_TimeType type = mRequest->type();
index b92ff80ec33e49551058657d64a3ba75dbf92d88..9110cb5f6b86922e1d816668584a70881048cd19 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "GetLocationCommand.h"
-#include <loguru.hpp>
 
 GetLocationCommand::GetLocationCommand(const ::aurum::ReqGetLocation* request,
                                        ::aurum::RspGetLocation*       response)
@@ -9,7 +9,7 @@ GetLocationCommand::GetLocationCommand(const ::aurum::ReqGetLocation* request,
 
 ::grpc::Status GetLocationCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "CliGetLocation --------------- ");
+    LOGI("CliGetLocation --------------- ");
     // ObjectMapper *mObjMap = ObjectMapper::getInstance();
 
     mResponse->set_alt(-1);
index 919c19638cfc714e58866e3394ce18c36170e7d0..88c7b000f1e5922ceeca55ae2abac90d7908d57a 100644 (file)
@@ -1,7 +1,6 @@
+#include "bootstrap.h"
 #include "GetSizeCommand.h"
-#include <loguru.hpp>
-
-#include <UiObject.h>
+#include "UiObject.h"
 
 GetSizeCommand::GetSizeCommand(const ::aurum::ReqGetSize* request,
                                ::aurum::RspGetSize*       response)
@@ -11,7 +10,7 @@ GetSizeCommand::GetSizeCommand(const ::aurum::ReqGetSize* request,
 
 ::grpc::Status GetSizeCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "GetSize --------------- ");
+    LOGI("GetSize --------------- ");
     ObjectMapper *mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
     if (obj) {
index ebe9c930044ec7ab246da9974c9181001725f14c..410af95180cd98b98b676bff399a68dc846cdaa5 100644 (file)
@@ -1,7 +1,6 @@
+#include "bootstrap.h"
 #include "GetValueCommand.h"
-#include <loguru.hpp>
-
-#include <UiObject.h>
+#include "UiObject.h"
 
 GetValueCommand::GetValueCommand(const ::aurum::ReqGetValue* request,
                                  ::aurum::RspGetValue*       response)
@@ -11,7 +10,7 @@ GetValueCommand::GetValueCommand(const ::aurum::ReqGetValue* request,
 
 ::grpc::Status GetValueCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "GetValue --------------- ");
+    LOGI("GetValue --------------- ");
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
 
index 58c369f586b6e6fd139170128fb82ecdf75ac657..f475da24f4c2fe771fb4aa8beb0aa5be37a2b23d 100644 (file)
@@ -1,8 +1,8 @@
+#include "bootstrap.h"
 #include "InstallAppCommand.h"
 #include <fstream>
 #include <chrono>
 #include <thread>
-#include <loguru.hpp>
 #ifdef GBSBUILD
 #include <package_manager.h>
 #endif
@@ -16,7 +16,7 @@ InstallAppCommand::InstallAppCommand(
 
 ::grpc::Status InstallAppCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "InstallApp --------------- ");
+    LOGI("InstallApp --------------- ");
 #ifdef GBSBUILD
     ::aurum::ReqInstallApp chunk;
 
@@ -40,7 +40,7 @@ InstallAppCommand::InstallAppCommand(
 
 ::grpc::Status InstallAppCommand::executePost()
 {
-    LOG_SCOPE_F(INFO, "InstallAppCommand::executePost");
+    LOGI("InstallAppCommand::executePost");
     std::this_thread::sleep_for(std::chrono::milliseconds{5000});
     return grpc::Status::OK;
 }
\ No newline at end of file
index 2e51682f6b6c32b4bad067aaa8dab75b9ebaae46..8a8641f37f6d87cf084ca7ad7322104f5198defc 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "KillServerCommand.h"
-#include <loguru.hpp>
 
 KillServerCommand::KillServerCommand(const ::aurum::ReqEmpty* request,
                                      ::aurum::RspEmpty*       response)
@@ -9,7 +9,7 @@ KillServerCommand::KillServerCommand(const ::aurum::ReqEmpty* request,
 
 ::grpc::Status KillServerCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "Kill Server ");
+    LOGI("Kill Server ");
 
     exit(1);
 
index f611eb5c34de248909e7924738387ac7807e8f0c..b2a01c33a165eed2b8c8bc5ba2346b6bd270fee0 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "LaunchAppCommand.h"
-#include <loguru.hpp>
 #include <chrono>
 #include <thread>
 
@@ -15,7 +15,7 @@ LaunchAppCommand::LaunchAppCommand(const ::aurum::ReqLaunchApp* request,
 
 ::grpc::Status LaunchAppCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "LaunchApp --------------- ");
+    LOGI("LaunchApp --------------- ");
 #ifdef GBSBUILD
     app_control_h appControl;
     std::string   packageName = mRequest->packagename();
@@ -25,14 +25,14 @@ LaunchAppCommand::LaunchAppCommand(const ::aurum::ReqLaunchApp* request,
 
     ret = app_control_create(&appControl);
     if (ret) {
-        LOG_SCOPE_F(INFO, "Launch Failed(1/3) Err Code : %ull", ret);
+        LOGI("Launch Failed(1/3) Err Code : %ull", ret);
         mResponse->set_status(::aurum::RspStatus::ERROR);
         return grpc::Status::OK;
     }
 
     ret = app_control_set_app_id(appControl, packageName.c_str());
     if (ret) {
-        LOG_SCOPE_F(INFO, "Launch Failed(2/3) Err Code : %ull", ret);
+        LOGI("Launch Failed(2/3) Err Code : %ull", ret);
         mResponse->set_status(::aurum::RspStatus::ERROR);
         app_control_destroy(appControl);
         return grpc::Status::OK;
@@ -40,7 +40,7 @@ LaunchAppCommand::LaunchAppCommand(const ::aurum::ReqLaunchApp* request,
 
     ret = app_control_send_launch_request(appControl, NULL, NULL);
     if (ret) {
-        LOG_SCOPE_F(INFO, "Launch Failed(3/3) Err Code : %ull", ret);
+        LOGI("Launch Failed(3/3) Err Code : %ull", ret);
         mResponse->set_status(::aurum::RspStatus::ERROR);
         app_control_destroy(appControl);
         return grpc::Status::OK;
@@ -52,7 +52,7 @@ LaunchAppCommand::LaunchAppCommand(const ::aurum::ReqLaunchApp* request,
 }
 ::grpc::Status LaunchAppCommand::executePost()
 {
-    LOG_SCOPE_F(INFO, "LaunchAppCommand::executePost");
+    LOGI("LaunchAppCommand::executePost");
     std::this_thread::sleep_for(std::chrono::milliseconds{2500});
     return grpc::Status::OK;
 }
index 6360c122b7f01573de024958531d12cab9881c0a..22148b583daa7f30e221ab6d2a1ac1e3896cc19b 100644 (file)
@@ -1,8 +1,7 @@
+#include "bootstrap.h"
 #include "LongClickCommand.h"
-#include <loguru.hpp>
-
-#include <UiObject.h>
-#include <UiDevice.h>
+#include "UiObject.h"
+#include "UiDevice.h"
 
 LongClickCommand::LongClickCommand(const ::aurum::ReqClick* request,
                                    ::aurum::RspClick*       response)
@@ -12,7 +11,7 @@ LongClickCommand::LongClickCommand(const ::aurum::ReqClick* request,
 
 ::grpc::Status LongClickCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "LongClick --------------- ");
+    LOGI("LongClick --------------- ");
 
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     ::aurum::ReqClick_RequestType type = mRequest->type();
index d6664cc1780b70e419d50a6fa9626420653e88dc..2a2a5e1a3b7c099aa2e92efd9395ae3ec7bf989a 100644 (file)
@@ -1,6 +1,6 @@
+#include "bootstrap.h"
 #include "PostCommand.h"
 #include <atspi/atspi.h>
-#include <loguru.hpp>
 
 PostCommand::PostCommand() : PostCommand(nullptr) {}
 PostCommand::PostCommand(Command *cmd) : mCommand{cmd} {}
@@ -8,7 +8,7 @@ PostCommand::PostCommand(Command *cmd) : mCommand{cmd} {}
 ::grpc::Status PostCommand::execute()
 {
     ::grpc::Status rst = mCommand->execute();
-    LOG_SCOPE_F(INFO, "PostCommand --------------- ");
+    LOGI("PostCommand --------------- ");
     mCommand->executePost();
 
     // do post-command
index af36b2cca72e7ee4f74c1ab7d4f7c2622177abc3..b29128978d38f69bc71e783f02b7871571ad393b 100644 (file)
@@ -1,6 +1,6 @@
+#include "bootstrap.h"
 #include "PreCommand.h"
 #include <atspi/atspi.h>
-#include <loguru.hpp>
 
 #include <thread>
 #include <chrono>
@@ -16,16 +16,16 @@ PreCommand::PreCommand(Command *cmd) : mCommand{cmd} {}
 ::grpc::Status PreCommand::execute()
 {
     {
-       LOG_SCOPE_F(INFO, "PreCommand --------------- ");
-       display_state_e state;
-       if (device_display_get_state(&state) != DEVICE_ERROR_NONE) {
-            LOG_F(INFO, "getting display state has failed");
-       }
+        LOGI("PreCommand --------------- ");
+        display_state_e state;
+        if (device_display_get_state(&state) != DEVICE_ERROR_NONE) {
+            LOGI("getting display state has failed");
+        }
 
         bool isDisplayOn = DISPLAY_STATE_SCREEN_OFF != state;
 
         if (device_power_wakeup(false) != DEVICE_ERROR_NONE) {
-             LOG_F(INFO, "turning on display has failed");
+             LOGI("turning on display has failed");
         }
 
         if (!isDisplayOn)
index 07c07388c41beede75bf63479a0fad9bef934bb4..218e3d5836cacd5c4430c432ede50aa26a46fdb5 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "RemoveAppCommand.h"
-#include <loguru.hpp>
 #include <chrono>
 #include <thread>
 #ifdef GBSBUILD
@@ -14,13 +14,13 @@ RemoveAppCommand::RemoveAppCommand(const ::aurum::ReqRemoveApp* request,
 
 ::grpc::Status RemoveAppCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "RemoveAppCommand::execute");
+    LOGI("RemoveAppCommand::execute");
 
 #ifdef GBSBUILD
     package_manager_request_h pkgRequest;
     std::string               name = mRequest->packagename();
     int                       id;
-    LOG_F(INFO, "package name :%s", name.c_str());
+    LOGI("package name :%s", name.c_str());
 
     if (package_manager_request_create(&pkgRequest) == PACKAGE_MANAGER_ERROR_NONE) {
         if (package_manager_request_uninstall(pkgRequest, name.c_str(), &id) == PACKAGE_MANAGER_ERROR_NONE) {
@@ -33,7 +33,7 @@ RemoveAppCommand::RemoveAppCommand(const ::aurum::ReqRemoveApp* request,
 
 ::grpc::Status RemoveAppCommand::executePost()
 {
-    LOG_SCOPE_F(INFO, "RemoveAppCommand::executePost");
+     LOGI("RemoveAppCommand::executePost");
     std::this_thread::sleep_for(std::chrono::milliseconds{5000});
     return grpc::Status::OK;
 }
index 6008d449cc466f2ef0142d6a062246e3f00d58ed..52e137f7689bbd0667d6df24587a5eeb386bb41d 100644 (file)
@@ -1,7 +1,6 @@
+#include "bootstrap.h"
 #include "SendKeyCommand.h"
-#include <loguru.hpp>
-
-#include <UiDevice.h>
+#include "UiDevice.h"
 
 SendKeyCommand::SendKeyCommand(const ::aurum::ReqKey* request,
                                ::aurum::RspKey*       response)
@@ -11,7 +10,7 @@ SendKeyCommand::SendKeyCommand(const ::aurum::ReqKey* request,
 
 ::grpc::Status SendKeyCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "SendKey --------------- ");
+    LOGI("SendKey --------------- ");
     std::shared_ptr<UiDevice> mDevice = UiDevice::getInstance();
     ::aurum::ReqKey_KeyType type = mRequest->type();
     ::aurum::ReqKey_KeyActionType action_type = mRequest->actiontype();
index 32cd476068c43b6a7dda89c5e78bc7549d3d8c12..8e4e4ac8224310ed5aeb9551d34abb2c863b3515 100644 (file)
@@ -1,5 +1,5 @@
+#include "bootstrap.h"
 #include "SetValueCommand.h"
-#include <loguru.hpp>
 
 SetValueCommand::SetValueCommand(const ::aurum::ReqSetValue* request,
                                  ::aurum::RspSetValue*       response)
@@ -9,7 +9,7 @@ SetValueCommand::SetValueCommand(const ::aurum::ReqSetValue* request,
 
 ::grpc::Status SetValueCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "SetValue (text:%s) --------------- ", mRequest->stringvalue().c_str());
+    LOGI("SetValue (text:%s) --------------- ", mRequest->stringvalue().c_str());
     ObjectMapper* mObjMap = ObjectMapper::getInstance();
     std::shared_ptr<UiObject> obj = mObjMap->getElement(mRequest->elementid());
     if (obj) obj->setText(const_cast<std::string&>(mRequest->stringvalue()));
index 3206029314fc45465023a78e10b4224be98f0e0b..6d0177c88b571f968aabe5adfb3e6f4f898674b5 100644 (file)
@@ -1,8 +1,8 @@
+#include "bootstrap.h"
 #include "TakeScreenshotCommand.h"
-#include <loguru.hpp>
+#include <fstream>
 #include "UiObject.h"
 #include "UiDevice.h"
-#include <fstream>
 
 TakeScreenshotCommand::TakeScreenshotCommand(
     const ::aurum::ReqTakeScreenshot*                  request,
@@ -13,7 +13,7 @@ TakeScreenshotCommand::TakeScreenshotCommand(
 
 ::grpc::Status TakeScreenshotCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "TakeScreenshot --------------- ");
+    LOGI("TakeScreenshot --------------- ");
 
     std::string path = "/tmp/screenshot.png";
     std::shared_ptr<UiDevice> mDevice = UiDevice::getInstance();
index 533f520c40d71281120c211085be2273dfe3183c..c148b8a4b9cdb8db780e72c1854ae5eabd43d591 100644 (file)
@@ -1,6 +1,6 @@
+#include "bootstrap.h"
 #include "TouchDownCommand.h"
-#include <UiDevice.h>
-#include <loguru.hpp>
+#include "UiDevice.h"
 
 TouchDownCommand::TouchDownCommand(const ::aurum::ReqTouchDown* request,
                                    ::aurum::RspTouchDown*       response)
@@ -10,7 +10,7 @@ TouchDownCommand::TouchDownCommand(const ::aurum::ReqTouchDown* request,
 
 ::grpc::Status TouchDownCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "TouchDown --------------- ");
+    LOGI("TouchDown --------------- ");
     const aurum::Point& point_ = mRequest->coordination();
     int seq = UiDevice::getInstance()
         ->touchDown(point_.x(), point_.y());
index d31c77178bfb872e8640d2ae9af8afa81852b150..2bb0423a38d7af2cf12ce361aff1c6ea7b3bdc78 100644 (file)
@@ -1,6 +1,6 @@
+#include "bootstrap.h"
 #include "TouchMoveCommand.h"
-#include <UiDevice.h>
-#include <loguru.hpp>
+#include "UiDevice.h"
 
 TouchMoveCommand::TouchMoveCommand(const ::aurum::ReqTouchMove* request,
                                    ::aurum::RspTouchMove*       response)
@@ -10,7 +10,7 @@ TouchMoveCommand::TouchMoveCommand(const ::aurum::ReqTouchMove* request,
 
 ::grpc::Status TouchMoveCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "TouchMove --------------- ");
+    LOGI("TouchMove --------------- ");
     const aurum::Point& point = mRequest->coordination();
     int seq = mRequest->seqid();
     UiDevice::getInstance()->touchMove(point.x(), point.y(), seq);
index 354ccadbe831d0957f60ad93a5c1f3ce7ae5d221..4fd946b30e61b77aa1e19fab2d702e70ff482642 100644 (file)
@@ -1,6 +1,6 @@
+#include "bootstrap.h"
 #include "TouchUpCommand.h"
-#include <UiDevice.h>
-#include <loguru.hpp>
+#include "UiDevice.h"
 
 TouchUpCommand::TouchUpCommand(const ::aurum::ReqTouchUp* request,
                                ::aurum::RspTouchUp*       response)
@@ -10,7 +10,7 @@ TouchUpCommand::TouchUpCommand(const ::aurum::ReqTouchUp* request,
 
 ::grpc::Status TouchUpCommand::execute()
 {
-    LOG_SCOPE_F(INFO, "TouchUp --------------- ");
+    LOGI("TouchUp --------------- ");
     const aurum::Point& point = mRequest->coordination();
     int seq = mRequest->seqid();
     UiDevice::getInstance()->touchUp(point.x(), point.y(), seq);
index 32b97c3caf0746ffeffd48ed22135f2b530bc166..aa07fb52f630a0f5128075e724bfa26f134f117e 100644 (file)
@@ -1,6 +1,6 @@
 #include "ObjectMapper.h"
 #include <memory>
-#include <loguru.hpp>
+#include "bootstrap.h"
 #include <algorithm>
 #include <sstream>
 
@@ -21,40 +21,40 @@ std::string ObjectMapper::addElement(std::shared_ptr<UiObject> object)
     mObjectMap[key] = object;
     std::string value = object->getId();
     mObjectMapReverse[value] = key;
-    LOG_SCOPE_F(INFO, "addElement %p as key %s, id %s", object.get(), key.c_str(), value.c_str());
+    LOGI("addElement %p as key %s, id %s", object.get(), key.c_str(), value.c_str());
     return key;
 }
 
 std::shared_ptr<UiObject> ObjectMapper::getElement(std::string key)
 {
-    LOG_SCOPE_F(INFO, "getElement for key(%s)", key.c_str());
+    LOGI("getElement for key(%s)", key.c_str());
     unsigned long long keyCnt = (unsigned long long)std::stoll(key); // this key is a result of calling std:to_string(mObjCounter)
     if (keyCnt <= 0 || keyCnt > mObjCounter) return nullptr;
     if (mObjectMap.count(key)) {
         std::shared_ptr<UiObject> obj = mObjectMap[key];
         obj->refresh();
-        LOG_F(INFO, "succeeded");
+        LOGI("succeeded");
         return obj;
     }
-    LOG_F(INFO, "failed(object not found)");
+    LOGI("failed(object not found)");
     return nullptr;
 }
 
 std::string ObjectMapper::getElement(std::shared_ptr<UiObject> object)
 {
-    LOG_SCOPE_F(INFO, "getElement for object(%p)", object.get());
+    LOGI("getElement for object(%p)", object.get());
     std::string value = object->getId();
     if (mObjectMapReverse.count(value)) {
-        LOG_F(INFO, "succeeded");
+        LOGI("succeeded");
         return mObjectMapReverse[value];
     }
-    LOG_F(INFO, "failed(object not found)");
+    LOGI("failed(object not found)");
     return std::string{""};
 }
 
 bool ObjectMapper::removeElement(const std::string key)
 {
-    LOG_SCOPE_F(INFO, "removeElement for key(%s)", key.c_str());
+    LOGI("removeElement for key(%s)", key.c_str());
     std::shared_ptr<UiObject> obj = getElement(key);
     if (obj) {
         std::string value = obj->getId();
@@ -66,7 +66,7 @@ bool ObjectMapper::removeElement(const std::string key)
 
 bool ObjectMapper::removeElement(std::shared_ptr<UiObject> object)
 {
-    LOG_SCOPE_F(INFO, "removeElement for object(%p)", object.get());
+    LOGI("removeElement for object(%p)", object.get());
     std::string key = getElement(object);
     if (key.empty()) return false;
     return removeElement(key);
@@ -76,7 +76,7 @@ void ObjectMapper::cleanUp()
 {
     std::stringstream ss{};
 
-    LOG_SCOPE_F(INFO, "clean up object map");
+    LOGI("clean up object map");
     ss << "mObjectMapReverse: ";
     for(auto iter = mObjectMapReverse.begin(); iter != mObjectMapReverse.end(); ) {
        auto obj = mObjectMap[iter->second];
@@ -98,7 +98,7 @@ void ObjectMapper::cleanUp()
         }
     }
     ss << std::endl;
-    LOG_F(INFO, "%s", ss.str().c_str());
+    LOGI("%s", ss.str().c_str());
 }
 
 //    std::remove_if(mObjectMapReverse.begin(), mObjectMapReverse.end(), [](auto& pair){return !pair.first->isValid();});