// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "NFCFactory.h"
#include "EventTargetAction.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
JSClassRef JSNFCTarget::m_jsClassRef = JSClassCreate(JSNFCTarget::getClassInfo());
JSObjectRef JSNFCTarget::createJSObject(JSContextRef context, void *tagHandle) {
- LogDebug("entered");
+ LoggerD("entered");
INFCTargetPtr nfcTarget = NFCFactory::getInstance().createNFCTargetObject(tagHandle);
void JSNFCTarget::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
NFCTargetPrivObject *priv = static_cast<NFCTargetPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting timezone object");
+ LoggerD("Deleting timezone object");
delete priv;
}
JSValueRef JSNFCTarget::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTARGET_ISCONNECTED)) {
NFCTargetPrivObject* privateObject = static_cast<NFCTargetPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return convert.toJSValueRef(nfcTarget->isConnected());
}
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownExceptionException: " << _rethrown_exception.GetMessage());
} Catch (PlatformException) {
- LogError("PlatformExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformExceptionException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_P2P_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTargetPrivObject* privateObject = static_cast<NFCTargetPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
return JSValueMakeUndefined(context);
} Catch (BasePlatformException) {
- LogError(_rethrown_exception.getName() << ": " << _rethrown_exception.getMessage());
+ LoggerE(_rethrown_exception.getName() << ": " << _rethrown_exception.getMessage());
return JSWebAPIException::throwException(context, exception, _rethrown_exception);
} Catch (ConversionException) {
- LogError("setReceiveNDEFListener : ConversionException");
+ LoggerE("setReceiveNDEFListener : ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("PlatformException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::SERVICE_NOT_AVAILABLE, "Service Not Available");
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
Try {
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_P2P_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTargetPrivObject* privateObject = static_cast<NFCTargetPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch(NullPointerException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("PlatformException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::SERVICE_NOT_AVAILABLE, "Service Not Available");
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_P2P_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTargetPrivObject* privateObject = static_cast<NFCTargetPrivObject*>(JSObjectGetPrivate(thisObject));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
NFCAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, global_context);
return JSValueMakeUndefined(context);
} Catch (BasePlatformException) {
- LogError(_rethrown_exception.getName() << ": " << _rethrown_exception.getMessage());
+ LoggerE(_rethrown_exception.getName() << ": " << _rethrown_exception.getMessage());
return JSWebAPIException::throwException(context, exception, _rethrown_exception);
} Catch (ConversionException) {
- LogError("sendNDEF : ConversionException");
+ LoggerE("sendNDEF : ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("sendNDEF InvalidArgumentException");
+ LoggerE("sendNDEF InvalidArgumentException");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values"));
return JSValueMakeUndefined(context);
} Catch (PlatformException) {
- LogError("PlatformException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::SERVICE_NOT_AVAILABLE, "Service Not Available"));
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("UnknownException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR,"Unknown Error"));