#include <memory>
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenExceptionFactory.h>
#include "NFCFactory.h"
#include "JSNdefRecordURI.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
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) {
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);
*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;
}
JSValueRef JSNdefRecordURI::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_URI_URI)) {
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);
}