wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Content / JSContentManager.cpp
old mode 100755 (executable)
new mode 100644 (file)
index b13041b..24c6e72
 // limitations under the License.
 //
 
-
 #include <cassert>
 #include <memory>
-#include <dpl/log/log.h>
 #include <CommonsJavaScript/Utils.h>
 #include <CommonsJavaScript/Validator.h>
 #include <CommonsJavaScript/Converter.h>
@@ -55,7 +53,7 @@
 #include "ContentFilterConverter.h"
 #include "ContentUtility.h"
 #include "JSWebAPIException.h"
-
+#include <Logger.h>
 
 using namespace DeviceAPI::Common;
 using namespace DeviceAPI::Tizen;
@@ -116,7 +114,7 @@ JSValueRef JSMediacontentManager::getFolders(
                             const JSValueRef arguments[],
                             JSValueRef* exception )
 {
-    LogDebug("JSContentManagerManager::getFolders entered");
+    LoggerD("JSContentManagerManager::getFolders entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
     MediacontentManagerPrivObject *privateObject;
@@ -167,27 +165,27 @@ JSValueRef JSMediacontentManager::getFolders(
     }
     Catch(WrtDeviceApis::Commons::UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::NotFoundException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -206,7 +204,7 @@ JSValueRef JSMediacontentManager::findItems(
                             const JSValueRef arguments[],
                             JSValueRef* exception )
 {
-    LogDebug("JSContentManagerManager::find entered");
+    LoggerD("JSContentManagerManager::find entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
     MediacontentManagerPrivObject *privateObject;
@@ -312,27 +310,27 @@ JSValueRef JSMediacontentManager::findItems(
     }
     Catch(WrtDeviceApis::Commons::UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::NotFoundException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -349,7 +347,7 @@ JSValueRef JSMediacontentManager::updateItemsBatch(JSContextRef context,
         const JSValueRef arguments[],
         JSValueRef* exception)
 {
-    LogDebug("JSContentManagerManager::updateItemsBatch entered");
+    LoggerD("JSContentManagerManager::updateItemsBatch entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     MediacontentManagerPrivObject *privateObject;
     privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
@@ -417,27 +415,27 @@ JSValueRef JSMediacontentManager::updateItemsBatch(JSContextRef context,
     }
     Catch(WrtDeviceApis::Commons::UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::NotFoundException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -455,7 +453,7 @@ JSValueRef JSMediacontentManager::updateItem(
                         const JSValueRef arguments[],
                         JSValueRef* exception)
 {
-    LogDebug("JSContentManagerManager::updateItem entered");
+    LoggerD("JSContentManagerManager::updateItem entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
     MediacontentManagerPrivObject *privateObject;
@@ -528,27 +526,27 @@ JSValueRef JSMediacontentManager::updateItem(
     }
     Catch(WrtDeviceApis::Commons::UnsupportedException)
     {
-    LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+    LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::InvalidArgumentException)
     {
-    LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+    LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::ConversionException)
     {
-    LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+    LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::NotFoundException)
     {
-    LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+    LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::Exception)
     {
-    LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+    LoggerW("Exception: "<<_rethrown_exception.GetMessage());
     return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -582,7 +580,7 @@ JSValueRef JSMediacontentManager::scanFile(
                         const JSValueRef arguments[],
                         JSValueRef* exception)
 {
-    LogDebug("JSContentManagerManager::scanFile entered");
+    LoggerD("JSContentManagerManager::scanFile entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
     MediacontentManagerPrivObject *privateObject;
@@ -633,27 +631,27 @@ JSValueRef JSMediacontentManager::scanFile(
     }
     Catch(WrtDeviceApis::Commons::UnsupportedException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::InvalidArgumentException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::ConversionException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::NotFoundException)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
     }
     Catch(WrtDeviceApis::Commons::Exception)
     {
-        LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+        LoggerW("Exception: "<<_rethrown_exception.GetMessage());
         return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
     }
 
@@ -670,7 +668,7 @@ JSValueRef JSMediacontentManager::setChangeListener(
                         const JSValueRef arguments[],
                         JSValueRef* exception)
 {
-    LogDebug("JSContentManagerManager::setChangeListener entered");
+    LoggerD("JSContentManagerManager::setChangeListener entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
 
     MediacontentManagerPrivObject *privateObject;
@@ -713,7 +711,7 @@ JSValueRef JSMediacontentManager::unsetChangeListener(
                         const JSValueRef arguments[],
                         JSValueRef* exception)
 {
-    LogDebug("JSContentManagerManager::unsetChangeListener entered");
+    LoggerD("JSContentManagerManager::unsetChangeListener entered");
        TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
     MediacontentManagerPrivObject *privateObject;
     privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
@@ -759,11 +757,11 @@ const JSClassDefinition* JSMediacontentManager::getClassInfo()
 
 void JSMediacontentManager::initialize(JSContextRef context, JSObjectRef object)
 {
-    LogDebug("JSContentManager  initialize entered");
+    LoggerD("JSContentManager  initialize entered");
     MediacontentManagerPrivObject *privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(object));
     if (NULL == privateObject)
     {
-        LogDebug("Create ContenttManagerPrivObject");
+        LoggerD("Create ContenttManagerPrivObject");
         IMediacontentManagerPtr contentManager = MediacontentFactory::getInstance().createMediacontentManagerObject();
         privateObject = new MediacontentManagerPrivObject(context, contentManager);
         if (!JSObjectSetPrivate(object, static_cast<void*>(privateObject)))
@@ -776,11 +774,11 @@ void JSMediacontentManager::initialize(JSContextRef context, JSObjectRef object)
 
 void JSMediacontentManager::finalize(JSObjectRef object)
 {
-    LogDebug("Entered");
+    LoggerD("Entered");
     MediacontentManagerPrivObject* priv = static_cast<MediacontentManagerPrivObject*> (JSObjectGetPrivate(object));
     if(priv != NULL)
     {
-        LogDebug("Deleting coordinates object");
+        LoggerD("Deleting coordinates object");
         delete priv;
         JSObjectSetPrivate(object, NULL);
         priv = NULL;