wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / DataSync / JSSyncServiceInfo.cpp
old mode 100755 (executable)
new mode 100644 (file)
index b66e07b..3b0d488
 
 
 #include "JSSyncServiceInfo.h"
-
-#include <dpl/log/log.h>
 #include <JSTizenException.h>
 #include <JSTizenExceptionFactory.h>
 #include <CommonsJavaScript/Converter.h>
 #include "DataSyncConverter.h"
+#include <Logger.h>
 
 using namespace WrtDeviceApis::Commons;
 using namespace WrtDeviceApis::CommonsJavaScript;
@@ -87,14 +86,14 @@ void JSSyncServiceInfo::initialize(JSContextRef context,
         JSObjectRef object)
 {
     if (!JSObjectGetPrivate(object)) {
-        LogDebug("Create JSSyncServiceInfo private object.");
+        LoggerD("Create JSSyncServiceInfo private object.");
         SyncServiceInfoPtr syncServiceInfo( new SyncServiceInfo() );
         SyncServiceInfoPrivateObject *priv = new SyncServiceInfoPrivateObject(context, syncServiceInfo);
         if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
             delete priv;
         }
     } else {
-        LogDebug("Private object already set.");
+        LoggerD("Private object already set.");
     }
 }
 
@@ -102,7 +101,7 @@ void JSSyncServiceInfo::finalize(JSObjectRef object)
 {
     SyncServiceInfoPrivateObject* priv = static_cast<SyncServiceInfoPrivateObject*>(JSObjectGetPrivate(object));
     if (priv) {
-        LogDebug("Deleting JSSyncServiceInfo private object.");
+        LoggerD("Deleting JSSyncServiceInfo private object.");
         delete priv;
         JSObjectSetPrivate(object, NULL);
     }
@@ -137,7 +136,7 @@ void JSSyncServiceInfo::setPrivateObject(const SyncServiceInfoPtr &syncServiceIn
     }
     Catch(Exception)
     {
-        LogError("Error during setting JSSyncServiceInfo object.");
+        LoggerE("Error during setting JSSyncServiceInfo object.");
     }
 }
 
@@ -169,28 +168,28 @@ JSObjectRef JSSyncServiceInfo::constructor(JSContextRef context,
                        syncServiceInfo->setPassword(converter.toString(arguments[4]));
         }
 
-        LogDebug("enable: "<<syncServiceInfo->getEnable()<<", serviceType: "<<syncServiceInfo->getSyncServiceType()<<", serverDatabaseUri: "<<syncServiceInfo->getServerDatabaseUri()<<", id: "<<syncServiceInfo->getId()<<", password: "<<syncServiceInfo->getPassword());
+        LoggerD("enable: "<<syncServiceInfo->getEnable()<<", serviceType: "<<syncServiceInfo->getSyncServiceType()<<", serverDatabaseUri: "<<syncServiceInfo->getServerDatabaseUri()<<", id: "<<syncServiceInfo->getId()<<", password: "<<syncServiceInfo->getPassword());
 
         return createJSSyncServiceInfo(context, syncServiceInfo);
     }
     Catch(UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         *exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -226,12 +225,12 @@ JSValueRef JSSyncServiceInfo::getProperty(JSContextRef context,
                // For a privacy reason.
             return JSValueMakeNull(context);
                } else {
-                       LogDebug("Wrong property name.");
+                       LoggerD("Wrong property name.");
                }
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     }
 
     return JSValueMakeUndefined(context);
@@ -270,12 +269,12 @@ bool JSSyncServiceInfo::setProperty(JSContextRef context,
                        syncServiceInfo->setPassword(converter.toString(value));
                        return true;
         } else {
-               LogDebug("Wrong property name.");
+               LoggerD("Wrong property name.");
                }
     }
     Catch(Exception)
     {
-               LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+               LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     }
 
     return true;