// limitations under the License.
//
-#include <dpl/log/log.h>
-
#include <string>
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include "NFCFactory.h"
#include "EventNFCChanged.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace std;
using namespace DPL;
void JSNFCAdapter::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered. Nothing to do");
+ LoggerD("entered. Nothing to do");
}
void JSNFCAdapter::finalize(JSObjectRef object)
}
JSObjectRef JSNFCAdapter::createJSObject(JSContextRef context) {
- LogDebug("entered");
+ LoggerD("entered");
INFCAdapterPtr nfcAdapter(NFCFactory::getInstance().createNFCAdapterObject());
NFCAdapterPrivObject *priv = new NFCAdapterPrivObject(context, nfcAdapter);
JSValueRef JSNFCAdapter::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NFCConverter convert(context);
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCADAPTER_POWERED)) {
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
ThrowMsg(NullPointerException, "Private object not initialized");
}
INFCAdapterPtr nfcAdapter(privateObject->getObject());
return convert.toJSValueRef(nfcAdapter->getPowerState());
}
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
} Catch (UnsupportedException) {
- LogError("UnsupportedException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnsupportedException: " << _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);
JSValueRef JSNFCAdapter::setTagListener (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("JSNFCAdapter::setTagListener Enter");
+ LoggerD("JSNFCAdapter::setTagListener Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_TAG_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
nfcTagType filter = nfcConverter.toNfcTagType(filterValue.at(i));
tagFilter->addTagTypeValue(filter);
- LogDebug("tag_types.at(i): " << filterValue.at(i));
+ LoggerD("tag_types.at(i): " << filterValue.at(i));
}
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!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("JSNFCAdapter::setTagListener : ConversionException");
+ LoggerE("JSNFCAdapter::setTagListener : 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");
}
JSValueRef JSNFCAdapter::setPeerListener (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("JSNFCAdapter::setPeerListener Enter");
+ LoggerD("JSNFCAdapter::setPeerListener Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_P2P_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!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("JSNFCAdapter::setPeerListener : ConversionException");
+ LoggerE("JSNFCAdapter::setPeerListener : 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");
}
JSValueRef JSNFCAdapter::unsetTagListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) {
- LogDebug("JSNFCAdapter::unsetNFCTagListener Enter");
+ LoggerD("JSNFCAdapter::unsetNFCTagListener Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_TAG_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
} Catch (NullPointerException) {
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");
}
JSValueRef JSNFCAdapter::unsetPeerListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) {
- LogDebug("JSNFCAdapter::unsetPeerListener Enter");
+ LoggerD("JSNFCAdapter::unsetPeerListener Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_P2P_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
} Catch (NullPointerException) {
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");
}
JSValueRef JSNFCAdapter::getCachedMessage (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("JSNFCAdapter::getCachedMessage Enter");
+ LoggerD("JSNFCAdapter::getCachedMessage Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_COMMON_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
return JSNdefMessage::createJSObject(global_context, cachedMessage);
return JSValueMakeNull(context);
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::SERVICE_NOT_AVAILABLE, "Service Not Available");
} Catch(NullPointerException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSNFCAdapter::setPowered (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_ADMIN_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(thisObject));
if (!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("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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(NullPointerException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR,"Unknown Error"));
return JSValueMakeUndefined(context);