Add more logs showing state transitions 09/140809/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 26 Jul 2017 11:17:54 +0000 (20:17 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Wed, 26 Jul 2017 11:17:54 +0000 (20:17 +0900)
Change-Id: I2599737123d936d3c085f2ae2bcefe7181fa8b36
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
src/server/ActionState.cpp
src/server/ContextPublisher.cpp
src/server/JobState.h

index ffc919cef22e69265e04d841e4331d4634a385a3..880dfbdfe90377f592e173f41ca4fb115855bd3f 100644 (file)
@@ -89,9 +89,11 @@ void ActionState::__callDBusMethod()
        bool success = false;
 
        if (getUid() == SYSTEM_UID) {
+               _D("Call %s.%s", action->getInterface().c_str(), action->getMethodName().c_str());
                success = caller.call(action->getBusName(), action->getObjectPath(),
                                action->getInterface(), action->getMethodName(), action->getParameters());
        } else {
+               _D("Call %s.%s of %u", action->getInterface().c_str(), action->getMethodName().c_str(), static_cast<unsigned>(getUid()));
                success = caller.call(action->getBusName(), action->getObjectPath(),
                                action->getInterface(), action->getMethodName(), action->getParameters(),
                                getUid());
index 8d4c783b7932c1268434fa77f4038f4d0f2fb388..b19e1f0c3e8b18fd5af13c5b9736ce24e15f6175 100644 (file)
@@ -46,6 +46,8 @@ ContextPublisher::~ContextPublisher()
 
 void ContextPublisher::addObserver(IContextObserver* observer, void* userData)
 {
+       _D("%p observes %s", observer, getUri());
+
        if (__observers.empty()) {
                read();
                subscribe();
@@ -56,6 +58,8 @@ void ContextPublisher::addObserver(IContextObserver* observer, void* userData)
 
 void ContextPublisher::removeObserver(IContextObserver* observer)
 {
+       _D("%p stops observing %s", observer, getUri());
+
        __observers.remove_if(
                        [&](const ObserverInfo& info)->bool {
                                return (info.observer == observer);
@@ -97,6 +101,8 @@ const Json::Value& ContextPublisher::getData()
 
 void ContextPublisher::notifyObservers()
 {
+       _D("%s notifies", getUri());
+
        auto observers = __observers;
 
        for (auto& info : observers) {
index 8f967c2d8d400ecc136fc256c030dc015e575dd2..d71c5685796353fecb943d6d6e54339600e27630 100644 (file)
@@ -21,8 +21,8 @@
 #include <IClient.h>
 #include <JobInfo.h>
 
-#define _ENTER _I("ENTER: Job-%d of '%s'", getJobId(), getOwner().c_str())
-#define _EXIT  _D("EXIT : Job-%d of '%s'", getJobId(), getOwner().c_str())
+#define _ENTER _I("Create State %p: Job-%d of '%s'", this, getJobId(), getOwner().c_str())
+#define _EXIT  _D("Destroy State %p: Job-%d of '%s'", this, getJobId(), getOwner().c_str())
 
 namespace ctx {