wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / DataSync / JSDataSyncManager.cpp
old mode 100755 (executable)
new mode 100644 (file)
index a1b0677..0d2f23f
 // limitations under the License.
 //
 
-
-#include <dpl/log/log.h>
-
 #include <string>
-
 #include <CommonsJavaScript/PrivateObject.h>
 #include <CommonsJavaScript/Converter.h>
 #include <CommonsJavaScript/JSUtils.h>
@@ -32,7 +28,6 @@
 
 #include "OnDataSyncStateChanged.h"
 #include "DataSyncManager.h"
-
 #include "JSDataSyncManager.h"
 #include "DataSyncConverter.h"
 #include "JSSyncInfo.h"
@@ -42,6 +37,7 @@
 #include "DataSyncResponseDispatcher.h"
 #include "DataSyncMultiCallback.h"
 #include "DataSyncListenerManager.h"
+#include <Logger.h>
 
 using namespace WrtDeviceApis::Commons;
 using namespace WrtDeviceApis::CommonsJavaScript;
@@ -90,14 +86,14 @@ JSClassRef JSDataSyncManager::m_jsClassRef = JSClassCreate(JSDataSyncManager::ge
 void JSDataSyncManager::initialize(JSContextRef context, JSObjectRef object)
 {
     if (!JSObjectGetPrivate(object)) {
-        LogInfo("Create datasync manager private object.");
+        LoggerI("Create datasync manager private object.");
         IDataSyncManagerPtr datasync(new DataSyncManager());
         DataSyncManagerPrivObject *priv = new DataSyncManagerPrivObject(context, datasync);
         if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
             delete priv;
         }
     } else {
-        LogInfo("Private object already set.");
+        LoggerI("Private object already set.");
     }
 }
 
@@ -105,7 +101,7 @@ void JSDataSyncManager::finalize(JSObjectRef object)
 {
     DataSyncManagerPrivObject *priv = static_cast<DataSyncManagerPrivObject*>(JSObjectGetPrivate(object));
     if (priv) {
-        LogInfo("Deleting datasync manager private object.");
+        LoggerI("Deleting datasync manager private object.");
         delete priv;
         JSObjectSetPrivate(object, NULL);
     }
@@ -161,7 +157,7 @@ JSValueRef JSDataSyncManager::add(JSContextRef context,
             ThrowMsg(ConversionException, "Parameter conversion failed.");
         }
 
-        LogDebug("profileName: "<<profile->getProfileName());
+        LoggerD("profileName: "<<profile->getProfileName());
 
         IEventAddProfilePtr dplEvent(new IEventAddProfile());
 
@@ -170,7 +166,7 @@ JSValueRef JSDataSyncManager::add(JSContextRef context,
         datasyncManager->addProfile(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Add succeeded with id: "<<dplEvent->getProfile()->getProfileId());
+            LoggerD("Add succeeded with id: "<<dplEvent->getProfile()->getProfileId());
                        return JSValueMakeUndefined(context);
         } else {
             if (ExceptionCodes::OutOfRangeException==dplEvent->getExceptionCode()) {
@@ -182,27 +178,27 @@ JSValueRef JSDataSyncManager::add(JSContextRef context,
     }
     Catch(OutOfRangeException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, "QuotaExceededError", _rethrown_exception.GetMessage());
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -244,7 +240,7 @@ JSValueRef JSDataSyncManager::update(JSContextRef context,
             ThrowMsg(ConversionException, "Parameter conversion failed.");
         }
 
-        LogDebug("profileName: "<<profile->getProfileName());
+        LoggerD("profileName: "<<profile->getProfileName());
 
         IEventUpdateProfilePtr dplEvent(new IEventUpdateProfile());
 
@@ -253,7 +249,7 @@ JSValueRef JSDataSyncManager::update(JSContextRef context,
         datasyncManager->updateProfile(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Update succeeded with id: "<<dplEvent->getProfile()->getProfileId());
+            LoggerD("Update succeeded with id: "<<dplEvent->getProfile()->getProfileId());
                        return JSValueMakeUndefined(context);
         } else {
             ThrowMsg(UnknownException, "Update failed by unknown reason.");
@@ -261,22 +257,22 @@ JSValueRef JSDataSyncManager::update(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -309,7 +305,7 @@ JSValueRef JSDataSyncManager::remove(JSContextRef context,
                        profileId = converter.toString(arguments[0]);
                }
 
-        LogDebug("profileId: "<<profileId);
+        LoggerD("profileId: "<<profileId);
 
         IEventRemoveProfilePtr dplEvent(new IEventRemoveProfile());
 
@@ -318,7 +314,7 @@ JSValueRef JSDataSyncManager::remove(JSContextRef context,
         datasyncManager->removeProfile(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Remove succeeded with id: "<<dplEvent->getProfileId());
+            LoggerD("Remove succeeded with id: "<<dplEvent->getProfileId());
                        return JSValueMakeUndefined(context);
         } else {
                        if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
@@ -330,27 +326,27 @@ JSValueRef JSDataSyncManager::remove(JSContextRef context,
     }
     Catch (NotFoundException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -384,7 +380,7 @@ JSValueRef JSDataSyncManager::getMaxProfilesNum(JSContextRef context,
         datasyncManager->getMaxProfilesNum(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Max number of profiles: "<<dplEvent->getNumMaxProfiles());
+            LoggerD("Max number of profiles: "<<dplEvent->getNumMaxProfiles());
             return converter.toJSValueRef(dplEvent->getNumMaxProfiles());
         } else {
                        ThrowMsg(UnknownException, "Get the max number of profiles failed by unknown reason.");
@@ -392,22 +388,22 @@ JSValueRef JSDataSyncManager::getMaxProfilesNum(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -441,7 +437,7 @@ JSValueRef JSDataSyncManager::getProfilesNum(JSContextRef context,
         datasyncManager->getProfilesNum(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Number of profiles: "<<dplEvent->getNumProfiles());
+            LoggerD("Number of profiles: "<<dplEvent->getNumProfiles());
             return converter.toJSValueRef(dplEvent->getNumProfiles());
         } else {
                        ThrowMsg(UnknownException, "Get the number of profiles failed by unknown reason.");
@@ -449,22 +445,22 @@ JSValueRef JSDataSyncManager::getProfilesNum(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -497,7 +493,7 @@ JSValueRef JSDataSyncManager::get(JSContextRef context,
                        profileId = converter.toString(arguments[0]);
                }
 
-        LogDebug("profileId: "<<profileId);
+        LoggerD("profileId: "<<profileId);
 
         IEventGetProfilePtr dplEvent(new IEventGetProfile());
 
@@ -506,7 +502,7 @@ JSValueRef JSDataSyncManager::get(JSContextRef context,
         datasyncManager->getProfile(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Get succeeded with id: "<<dplEvent->getProfileId());
+            LoggerD("Get succeeded with id: "<<dplEvent->getProfileId());
                        return JSSyncProfileInfo::createJSSyncProfileInfo(context, dplEvent->getProfile());
         } else {
                        if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
@@ -518,27 +514,27 @@ JSValueRef JSDataSyncManager::get(JSContextRef context,
     }
     Catch (NotFoundException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -572,7 +568,7 @@ JSValueRef JSDataSyncManager::getAll(JSContextRef context,
         datasyncManager->getAllProfiles(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Getting all profiles succeeded with length: "<<dplEvent->getProfiles()->size());
+            LoggerD("Getting all profiles succeeded with length: "<<dplEvent->getProfiles()->size());
                        return converter.toJSValueRefProfileInfoList(dplEvent->getProfiles());
         } else {
                        ThrowMsg(UnknownException, "Getting all profiles failed by unknown reason.");
@@ -580,22 +576,22 @@ JSValueRef JSDataSyncManager::getAll(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }
@@ -629,15 +625,15 @@ JSValueRef JSDataSyncManager::startSync(JSContextRef context,
                if (argumentCount>=1) {
                        profileId = converter.toString(arguments[0]);
                }
-        LogDebug("profileId: "<<profileId);
+        LoggerD("profileId: "<<profileId);
 
         IEventStartSyncPtr dplEvent(new IEventStartSync());
 
                if (argumentCount>=2) {
-               LogDebug("Process the listener callback.");
+               LoggerD("Process the listener callback.");
 
             if (JSValueIsObject(context, arguments[1])) {
-                               LogDebug("Non-null callbacks.");
+                               LoggerD("Non-null callbacks.");
 
                                JSObjectRef objectCallbacks = converter.toJSObjectRef(arguments[1]);
                                JSCallbackManagerPtr onProgressCbm(NULL), onCompletedCbm(NULL), onStoppedCbm(NULL), onFailedCbm(NULL);
@@ -685,16 +681,16 @@ JSValueRef JSDataSyncManager::startSync(JSContextRef context,
                        emitter->setListener(&DataSyncResponseDispatcher::getInstance());
                        emitter->setEventPrivateData(DPL::StaticPointerCast<IEventPrivateData>(privData));
 
-                               LogDebug("Set the emitter.");
+                               LoggerD("Set the emitter.");
                                dplEvent->setEmitter(emitter);
                        } else  if (JSValueIsNull(context, arguments[1]) || JSValueIsUndefined(context, arguments[1]) ) {
-                               LogDebug("Null or undefined listener.");
+                               LoggerD("Null or undefined listener.");
                        } else {
                                ThrowMsg(ConversionException, "Wrong second parameter type.");
                        }
                }
 
-        LogDebug("Proceed the start sync event to the platform.");
+        LoggerD("Proceed the start sync event to the platform.");
 
         dplEvent->setProfileId(profileId);
         dplEvent->setForSynchronousCall();
@@ -702,13 +698,13 @@ JSValueRef JSDataSyncManager::startSync(JSContextRef context,
 
         if (dplEvent->getResult()) {
                        if(dplEvent->getEmitter()) {
-                               LogDebug("watcherId: "<<profileId.at(4));
+                               LoggerD("watcherId: "<<profileId.at(4));
                    DataSyncListenerCancellerPtr canceller = DataSyncListenerCancellerPtr(new DataSyncListenerCanceller(globalContext, thisObject, profileId.at(4)));
                    IListenerItemPtr listenerItem = DPL::StaticPointerCast<IListenerItem>(canceller);
                    DataSyncListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
                        }
 
-            LogDebug("Starting the sync succeeded.");
+            LoggerD("Starting the sync succeeded.");
         } else {
             switch (dplEvent->getExceptionCode()) {
                 case ExceptionCodes::NotFoundException:
@@ -725,27 +721,27 @@ JSValueRef JSDataSyncManager::startSync(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch (NotFoundException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -779,7 +775,7 @@ JSValueRef JSDataSyncManager::stopSync(JSContextRef context,
                if (argumentCount>=1) {
                        profileId = converter.toString(arguments[0]);
                }
-        LogDebug("profileId: "<<profileId);
+        LoggerD("profileId: "<<profileId);
 
         IEventStopSyncPtr dplEvent(new IEventStopSync());
 
@@ -788,7 +784,7 @@ JSValueRef JSDataSyncManager::stopSync(JSContextRef context,
         datasyncManager->stopSync(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Stop sync succeeded.");
+            LoggerD("Stop sync succeeded.");
         } else {
             if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
                 ThrowMsg(NotFoundException, "Id not found.");
@@ -799,27 +795,27 @@ JSValueRef JSDataSyncManager::stopSync(JSContextRef context,
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch (NotFoundException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -855,7 +851,7 @@ JSValueRef JSDataSyncManager::getLastSyncStatistics(JSContextRef context,
                        profileId = converter.toString(arguments[0]);
                }
 
-        LogDebug("profileId: "<<profileId);
+        LoggerD("profileId: "<<profileId);
 
         IEventGetLastSyncStatisticsPtr dplEvent(new IEventGetLastSyncStatistics());
 
@@ -864,7 +860,7 @@ JSValueRef JSDataSyncManager::getLastSyncStatistics(JSContextRef context,
         datasyncManager->getLastSyncStatistics(dplEvent);
 
         if (dplEvent->getResult()) {
-            LogDebug("Get sync statistics succeeded with length: "<<dplEvent->getSyncStatistics()->size());
+            LoggerD("Get sync statistics succeeded with length: "<<dplEvent->getSyncStatistics()->size());
                        return converter.toJSValueRefSyncStatisticsList(dplEvent->getSyncStatistics());
         } else {
                        if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
@@ -876,27 +872,27 @@ JSValueRef JSDataSyncManager::getLastSyncStatistics(JSContextRef context,
     }
     Catch (NotFoundException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(UnsupportedException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 }