From: Woochanlee Date: Wed, 30 Jun 2021 06:11:21 +0000 (+0900) Subject: libaurum: Print dlog instead of file write(loguru) X-Git-Tag: submit/tizen/20210706.064323~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=087624826e1642249cc28368c4dd763b0da0e51d;p=platform%2Fcore%2Fuifw%2Faurum.git libaurum: Print dlog instead of file write(loguru) Change-Id: I634bf285fa4551166c9afdd9a1e3c93fd6052df7 --- diff --git a/libaurum/inc/A11yEvent.h b/libaurum/inc/A11yEvent.h index 43da498..28ab8a4 100644 --- a/libaurum/inc/A11yEvent.h +++ b/libaurum/inc/A11yEvent.h @@ -1,6 +1,5 @@ #pragma once #include "bitmask.h" - #include enum class A11yEvent { diff --git a/libaurum/inc/Aurum.h b/libaurum/inc/Aurum.h index 801d2dd..2f46351 100644 --- a/libaurum/inc/Aurum.h +++ b/libaurum/inc/Aurum.h @@ -1,3 +1,13 @@ +#ifndef _AURUM_H_ +#define _AURUM_H_ + +#include + +#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_ */ diff --git a/libaurum/meson.build b/libaurum/meson.build index 85afdb3..257e6f4 100644 --- a/libaurum/meson.build +++ b/libaurum/meson.build @@ -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'), ] diff --git a/libaurum/src/A11yEvent.cc b/libaurum/src/A11yEvent.cc index 325d6fb..996fb33 100644 --- a/libaurum/src/A11yEvent.cc +++ b/libaurum/src/A11yEvent.cc @@ -1,5 +1,6 @@ #include "A11yEvent.h" +#include "Aurum.h" #include A11yEventInfo::A11yEventInfo() : A11yEventInfo(A11yEvent::EVENT_NONE, nullptr, nullptr) {} diff --git a/libaurum/src/Accessibility/AccessibleApplication.cc b/libaurum/src/Accessibility/AccessibleApplication.cc index 6fe51d6..fdbb013 100644 --- a/libaurum/src/Accessibility/AccessibleApplication.cc +++ b/libaurum/src/Accessibility/AccessibleApplication.cc @@ -1,8 +1,6 @@ -#include "AccessibleApplication.h" -#include "AccessibleWatcher.h" +#include "Aurum.h" #include -#include AccessibleApplication::AccessibleApplication(std::shared_ptr node) : mNode{node} diff --git a/libaurum/src/Accessibility/AccessibleNode.cc b/libaurum/src/Accessibility/AccessibleNode.cc index 8e6dbb3..db1c386 100644 --- a/libaurum/src/Accessibility/AccessibleNode.cc +++ b/libaurum/src/Accessibility/AccessibleNode.cc @@ -1,13 +1,12 @@ -#include "AccessibleNode.h" +#include "Aurum.h" + #include #include #include -#include #include "config.h" #include - AccessibleNode::~AccessibleNode() { } @@ -76,7 +75,7 @@ void AccessibleNode::notify(int type, int type2, void *src) void AccessibleNode::invalidate() { std::unique_lock 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 diff --git a/libaurum/src/Accessibility/AccessibleUtils.cc b/libaurum/src/Accessibility/AccessibleUtils.cc index 98b2082..76e0792 100644 --- a/libaurum/src/Accessibility/AccessibleUtils.cc +++ b/libaurum/src/Accessibility/AccessibleUtils.cc @@ -1,5 +1,5 @@ -#include "AccessibleUtils.h" -#include +#include "Aurum.h" + #include 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); diff --git a/libaurum/src/Accessibility/AccessibleWatcher.cc b/libaurum/src/Accessibility/AccessibleWatcher.cc index 3073482..f9636e7 100644 --- a/libaurum/src/Accessibility/AccessibleWatcher.cc +++ b/libaurum/src/Accessibility/AccessibleWatcher.cc @@ -1,16 +1,14 @@ -#include "AccessibleWatcher.h" +#include "Aurum.h" #ifdef TIZEN #include "AtspiAccessibleWatcher.h" #endif - #include "MockAccessibleWatcher.h" #include #include #include #include -#include AccessibleWatcher::AccessibleWatcher() :mSources{}, mLock{} @@ -59,17 +57,17 @@ AccessibleWatcher *AccessibleWatcher::getInstance(AccessibleWatcher *watcherImpl std::vector> 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> 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> AccessibleWatcher::getActive void AccessibleWatcher::attach(std::shared_ptr source) { std::unique_lock 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 source) void AccessibleWatcher::detach(std::shared_ptr source) { std::unique_lock 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); diff --git a/libaurum/src/Accessibility/AccessibleWindow.cc b/libaurum/src/Accessibility/AccessibleWindow.cc index 437f141..2818edb 100644 --- a/libaurum/src/Accessibility/AccessibleWindow.cc +++ b/libaurum/src/Accessibility/AccessibleWindow.cc @@ -1,5 +1,4 @@ -#include "AccessibleWindow.h" -#include "AccessibleWatcher.h" +#include "Aurum.h" AccessibleWindow::AccessibleWindow(std::shared_ptr app, std::shared_ptr node) : mApp{app}, mNode{node} diff --git a/libaurum/src/Comparer.cc b/libaurum/src/Comparer.cc index b54298f..e23cf54 100644 --- a/libaurum/src/Comparer.cc +++ b/libaurum/src/Comparer.cc @@ -1,6 +1,4 @@ -#include "Comparer.h" - -#include +#include "Aurum.h" Comparer::Comparer(const std::shared_ptr device, const std::shared_ptr selector, const bool &earlyReturn) @@ -27,7 +25,7 @@ std::vector> 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> Comparer::findObjects(const std::sh { std::list> partialList{}; std::vector> 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> Comparer::findObjects( std::list> &partialMatches) { std::vector> 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> 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); } diff --git a/libaurum/src/Impl/Accessibility/AtspiAccessibleApplication.cc b/libaurum/src/Impl/Accessibility/AtspiAccessibleApplication.cc index 79aec79..c458fa0 100644 --- a/libaurum/src/Impl/Accessibility/AtspiAccessibleApplication.cc +++ b/libaurum/src/Impl/Accessibility/AtspiAccessibleApplication.cc @@ -5,8 +5,6 @@ #include #include -#include - AtspiAccessibleApplication::AtspiAccessibleApplication(std::shared_ptr node) : AccessibleApplication(node) { diff --git a/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc b/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc index 68239bf..a918fd6 100644 --- a/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc +++ b/libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc @@ -1,11 +1,10 @@ +#include "Aurum.h" + #include "AtspiAccessibleNode.h" -#include "AccessibleWatcher.h" #include "AtspiWrapper.h" #include -#include - //std::map 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 AtspiAccessibleNode::getChildAt(int index) const AtspiWrapper::unlock(); return std::make_shared(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(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); diff --git a/libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc b/libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc index 46544d7..bffa403 100644 --- a/libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc +++ b/libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc @@ -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 #include #include @@ -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 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 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 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 AtspiAccessibleWatcher::getApplicationAt( std::vector> 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> 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(type), static_cast(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(type), static_cast(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); diff --git a/libaurum/src/Impl/Accessibility/MockAccessibleApplication.cc b/libaurum/src/Impl/Accessibility/MockAccessibleApplication.cc index e4f0f34..ed89a5a 100644 --- a/libaurum/src/Impl/Accessibility/MockAccessibleApplication.cc +++ b/libaurum/src/Impl/Accessibility/MockAccessibleApplication.cc @@ -4,8 +4,6 @@ #include -#include - MockAccessibleApplication::MockAccessibleApplication(std::shared_ptr node) : AccessibleApplication(node), mWindowList{} { diff --git a/libaurum/src/Impl/MockDeviceImpl.cc b/libaurum/src/Impl/MockDeviceImpl.cc index 486c32e..0184b44 100644 --- a/libaurum/src/Impl/MockDeviceImpl.cc +++ b/libaurum/src/Impl/MockDeviceImpl.cc @@ -1,5 +1,4 @@ #include "MockDeviceImpl.h" -#include #include #include diff --git a/libaurum/src/PartialMatch.cc b/libaurum/src/PartialMatch.cc index 3abc783..bfce60b 100644 --- a/libaurum/src/PartialMatch.cc +++ b/libaurum/src/PartialMatch.cc @@ -1,13 +1,10 @@ -#include "PartialMatch.h" +#include "Aurum.h" #include #include #include #include -#include - - 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::accept(const std::shared_ptrmMinDepth?*(selector->mMinDepth):-1, relativeDepth, selector->mMaxDepth?*(selector->mMaxDepth):9999999); PartialMatch *match = nullptr; if ((selector->mMinDepth && (relativeDepth < *(selector->mMinDepth))) || diff --git a/libaurum/src/Runnable/SendKeyRunnable.cc b/libaurum/src/Runnable/SendKeyRunnable.cc index 88e1fef..fc1f54c 100644 --- a/libaurum/src/Runnable/SendKeyRunnable.cc +++ b/libaurum/src/Runnable/SendKeyRunnable.cc @@ -1,7 +1,4 @@ -#include "SendKeyRunnable.h" - -#include -#include +#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 mDevice = UiDevice::getInstance(); mDevice->pressKeyCode(mKeycode.c_str(), KeyRequestType::PRESS); mDevice->pressKeyCode(mKeycode.c_str(), KeyRequestType::RELEASE); diff --git a/libaurum/src/Sel.cc b/libaurum/src/Sel.cc index 1897870..bf92244 100644 --- a/libaurum/src/Sel.cc +++ b/libaurum/src/Sel.cc @@ -1,4 +1,4 @@ -#include "Sel.h" +#include "Aurum.h" #include std::shared_ptr Sel::text(std::string text) diff --git a/libaurum/src/UiDevice.cc b/libaurum/src/UiDevice.cc index b9b5ab4..3250661 100644 --- a/libaurum/src/UiDevice.cc +++ b/libaurum/src/UiDevice.cc @@ -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 #include #include @@ -17,7 +13,6 @@ #include #include -#include UiDevice::UiDevice() : UiDevice(nullptr) {} UiDevice::UiDevice(IDevice *impl) diff --git a/libaurum/src/UiObject.cc b/libaurum/src/UiObject.cc index e363c7e..1095669 100644 --- a/libaurum/src/UiObject.cc +++ b/libaurum/src/UiObject.cc @@ -1,14 +1,11 @@ -#include "UiObject.h" -#include "Comparer.h" -#include "Sel.h" +#include "Aurum.h" #include #include -#include - #include #include + UiObject::UiObject() : UiObject(nullptr, nullptr, nullptr) {} UiObject::~UiObject() @@ -89,7 +86,7 @@ std::vector> 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(mDevice, selector, std::move(node))); diff --git a/libaurum/src/UiScrollable.cc b/libaurum/src/UiScrollable.cc index a051210..7c4ca8a 100644 --- a/libaurum/src/UiScrollable.cc +++ b/libaurum/src/UiScrollable.cc @@ -1,4 +1,4 @@ -#include "UiScrollable.h" +#include "Aurum.h" UiScrollable::UiScrollable(std::shared_ptr selector) : mSelector{selector}, mMaxSearchSwipe{100}, mScrollStep{50} diff --git a/libaurum/src/UiSelector.cc b/libaurum/src/UiSelector.cc index ae14799..5caad3d 100644 --- a/libaurum/src/UiSelector.cc +++ b/libaurum/src/UiSelector.cc @@ -1,4 +1,4 @@ -#include "UiSelector.h" +#include "Aurum.h" #include #include diff --git a/libaurum/src/Until.cc b/libaurum/src/Until.cc index c243fca..324635b 100644 --- a/libaurum/src/Until.cc +++ b/libaurum/src/Until.cc @@ -1,13 +1,10 @@ -#include - -#include -#include +#include "Aurum.h" std::function Until::hasObject( const std::shared_ptr 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 obj = searchable->findObject(selector); return obj.get() != nullptr; }; @@ -17,7 +14,7 @@ std::function(const ISearchable *)> Until::findObject( const std::shared_ptr selector) { return [=](const ISearchable *searchable) -> std::shared_ptr { - LOG_SCOPE_F(INFO, "Until::findObject search:%p", searchable); + dlog_print(DLOG_INFO, LOG_TAG, "Until::findObject search:%p", searchable); std::shared_ptr obj = searchable->findObject(selector); return obj; }; @@ -26,7 +23,7 @@ std::function(const ISearchable *)> Until::findObject( std::function 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; }; } diff --git a/libaurum/src/Waiter.cc b/libaurum/src/Waiter.cc index bdee46a..dfb2ae8 100644 --- a/libaurum/src/Waiter.cc +++ b/libaurum/src/Waiter.cc @@ -1,12 +1,8 @@ -#include "Waiter.h" +#include "Aurum.h" #include #include #include -#include "ISearchable.h" -#include "UiObject.h" -#include - Waiter::Waiter() : Waiter(nullptr) {} Waiter::~Waiter() {} @@ -32,7 +28,7 @@ template bool Waiter::waitFor( template R Waiter::waitFor(const std::function 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 condition) const template R Waiter::waitFor(const std::function 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(); diff --git a/packaging/aurum.spec b/packaging/aurum.spec index 065d7b6..7e14f5d 100644 --- a/packaging/aurum.spec +++ b/packaging/aurum.spec @@ -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)