wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Tizen / JSAttributeFilter.cpp
index 5cc449c..85251bf 100644 (file)
 #include "JSAttributeFilter.h"
 
 #include <string>
-#include <dpl/log/log.h>
 #include <dpl/shared_ptr.h>
 #include <CommonsJavaScript/ScopedJSStringRef.h>
 #include <JSWebAPIException.h>
 #include <JSUtil.h>
 #include <ArgumentValidator.h>
 #include "AnyFactory.h"
+#include <Logger.h>
 
 #define ATTRIBUTE_FILTER_CLASS_NAME "AttributeFilter"
-
 #define ATTRIBUTE_FILTER_ATTR_ATTRIBUTE_NAME "attributeName"
 #define ATTRIBUTE_FILTER_ATTR_MATCH_FLAG "matchFlag"
 #define ATTRIBUTE_FILTER_ATTR_MATCH_VALUE "matchValue"
@@ -117,7 +116,7 @@ JSObjectRef JSAttributeFilter::createJSObject(JSContextRef context,
        JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
        if (NULL == jsObjectRef)
        {
-               LogError("object creation error");
+               LoggerE("object creation error");
                return NULL;
        }
 
@@ -135,7 +134,7 @@ JSObjectRef JSAttributeFilter::constructor(JSContextRef context,
                const JSValueRef arguments[],
                JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        std::string attributeName;
        MatchFlag matchFlag;
@@ -204,7 +203,7 @@ JSObjectRef JSAttributeFilter::constructor(JSContextRef context,
        }
        Catch(Exception)
        {
-               LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+               LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
                JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
                                context, TypeMismatchException("Error occurred while creating object"));
                *exception = exceptionObj;
@@ -241,7 +240,7 @@ void JSAttributeFilter::Finalize(JSObjectRef object)
 
 AttributeFilterPtr JSAttributeFilter::getPrivData(JSObjectRef object)
 {
-       LogDebug("entered");
+       LoggerD("entered");
        JSAttributeFilterPriv *priv = static_cast<JSAttributeFilterPriv*>(JSObjectGetPrivate(object));
        if (!priv)
                ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
@@ -258,7 +257,7 @@ JSValueRef JSAttributeFilter::getAttributeName(JSContextRef context,
                JSStringRef propertyName,
                JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        try
        {
@@ -267,7 +266,7 @@ JSValueRef JSAttributeFilter::getAttributeName(JSContextRef context,
        }
        catch(BasePlatformException &e)
        {
-               LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+               LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
        }
 
        return JSValueMakeUndefined(context);
@@ -279,7 +278,7 @@ bool JSAttributeFilter::setAttributeName(JSContextRef context,
                JSValueRef value,
                JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        try
        {
@@ -288,7 +287,7 @@ bool JSAttributeFilter::setAttributeName(JSContextRef context,
        }
        catch(BasePlatformException &e)
        {
-               LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+               LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
        }
 
        return true;
@@ -299,7 +298,7 @@ JSValueRef JSAttributeFilter::getMatchFlag(JSContextRef context,
                JSStringRef propertyName,
                JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        try
        {
@@ -325,7 +324,7 @@ JSValueRef JSAttributeFilter::getMatchFlag(JSContextRef context,
        }
        catch(BasePlatformException &e)
        {
-               LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+               LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
        }
 
        return JSValueMakeUndefined(context);
@@ -337,7 +336,7 @@ bool JSAttributeFilter::setMatchFlag(JSContextRef context,
                JSValueRef value,
                JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        try
        {
@@ -365,7 +364,7 @@ bool JSAttributeFilter::setMatchFlag(JSContextRef context,
        }
        catch(BasePlatformException &e)
        {
-               LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+               LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
        }
 
        return true;