wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / NFC / JSNdefRecordURI.cpp
index b67ba88..489c13c 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <memory>
 #include <string>
-#include <dpl/log/log.h>
 #include <CommonsJavaScript/JSUtils.h>
 
 #include <JSTizenExceptionFactory.h>
@@ -32,6 +31,7 @@
 
 #include "NFCFactory.h"
 #include "JSNdefRecordURI.h"
+#include <Logger.h>
 
 namespace DeviceAPI {
 namespace NFC {
@@ -83,11 +83,11 @@ const JSClassDefinition* JSNdefRecordURI::getClassInfo() {
 JSClassRef JSNdefRecordURI::m_jsClassRef = JSClassCreate(JSNdefRecordURI::getClassInfo());
 
 void JSNdefRecordURI::initialize(JSContextRef context, JSObjectRef object) {
-       LogDebug("entered");
+       LoggerD("entered");
 }
 
 void JSNdefRecordURI::finalize(JSObjectRef object) {
-       LogDebug("Entered");
+       LoggerD("Entered");
 }
 
 JSObjectRef JSNdefRecordURI::createJSObject(JSContextRef context, const NdefRecordProperties &ndefRecordProperties, std::vector<unsigned char> payload) {
@@ -111,7 +111,7 @@ JSObjectRef JSNdefRecordURI::createJSObject(JSContextRef context, INdefRecordPtr
 
 JSObjectRef JSNdefRecordURI::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
-       LogDebug("entered");
+       LoggerD("entered");
 
        Try {
                ArgumentValidator validator(ctx, argumentCount, arguments);
@@ -129,24 +129,24 @@ JSObjectRef JSNdefRecordURI::constructor(JSContextRef ctx, JSObjectRef construct
         *exception = error;
         return error;
        } Catch(ConversionException) {
-               LogError("ConversionException: " << _rethrown_exception.GetMessage());
+               LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
                JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
                *exception = error;
         return error;
        } Catch (InvalidArgumentException) {
-               LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
+               LoggerE("InvalidArgumentException: " << _rethrown_exception.GetMessage());
                JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
                *exception = error;
         return error;
        } Catch (PlatformException) {
-               LogError("PlatformException: " << _rethrown_exception.GetMessage());
+               LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
                JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::SERVICE_NOT_AVAILABLE, "Service Not Available");
                *exception = error;
         return error;
        } Catch (WrtDeviceApis::Commons::UnknownException) {
-               LogError("PlatformException: " << _rethrown_exception.GetMessage());
+               LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
        } Catch (WrtDeviceApis::Commons::Exception) {
-               LogError("Exception: " << _rethrown_exception.GetMessage());
+               LoggerE("Exception: " << _rethrown_exception.GetMessage());
        }
        JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
        *exception = error;
@@ -154,7 +154,7 @@ JSObjectRef JSNdefRecordURI::constructor(JSContextRef ctx, JSObjectRef construct
 }
 JSValueRef JSNdefRecordURI::getProperty(JSContextRef context, JSObjectRef object,
        JSStringRef propertyName, JSValueRef* exception) {
-       LogDebug("Enter");
+       LoggerD("Enter");
 
        Try     {
                if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_URI_URI)) {
@@ -168,21 +168,21 @@ JSValueRef JSNdefRecordURI::getProperty(JSContextRef context, JSObjectRef object
                                Converter convert(context);
                                std::string result(uri);
                                free(uri);
-                               LogDebug("uri : " << result);
+                               LoggerD("uri : " << result);
                                return convert.toJSValueRef(result);
                        }
-                       LogDebug("This record is not URI Type");
+                       LoggerD("This record is not URI Type");
                }
        } Catch (ConversionException) {
-               LogError("ConversionException: " << _rethrown_exception.GetMessage());
+               LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
        } Catch (WrtDeviceApis::Commons::UnknownException) {
-               LogError("UnknownExceptionException: " << _rethrown_exception.GetMessage());
+               LoggerE("UnknownExceptionException: " << _rethrown_exception.GetMessage());
        } Catch (PlatformException) {
-               LogError("PlatformException: " << _rethrown_exception.GetMessage());
+               LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
        } Catch (NullPointerException) {
-               LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+               LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
        } Catch (WrtDeviceApis::Commons::Exception) {
-               LogError("Exception: " << _rethrown_exception.GetMessage());
+               LoggerE("Exception: " << _rethrown_exception.GetMessage());
        }
        return JSValueMakeUndefined(context);
 }