* @brief Implementation of the JSContact class
*/
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSTizenExceptionFactory.h>
#include <ArgumentValidator.h>
#include <JSWebAPIError.h>
#include <TimeTracer.h>
+#include <Logger.h>
#define FILTER_CLASS_NAME "Contact"
JSContactPriv *priv = new JSContactPriv(context, contact);
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
return jsObjectRef;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
bool jsNoParam = false;
bool js1stParamIsObject = false;
js1stParamIsString = true;
else
{
- LogError("Argument type mismatch : 1nd argument must be ContactInit object or string");
+ LoggerE("Argument type mismatch : 1nd argument must be ContactInit object or string");
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "2nd argument must be 'ContactTextFormat'");
return NULL;
}
contact = converter->toContactFromInit(arguments[0]);
} Catch(ConversionException) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument must be 'ContactInit object'");
return NULL;
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Internal error");
return NULL;
}
contact->setContactFromString(stringRepresentation);
} Catch(ConversionException) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "2nd argument must be 'ContactTextFormat'");
return NULL;
} Catch(InvalidArgumentException) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "1st argument must be vCard string");
return NULL;
} Catch(UnsupportedException) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::NOT_SUPPORTED_ERROR, "Only support vCard 3.0");
return NULL;
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Internal error");
return NULL;
}
Try {
contact = ContactFactory::getInstance().createContact();
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Internal error");
return NULL;
}
Try {
jsobject = createJSObject(gContext, contact);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Internal error");
return NULL;
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
DPL::SharedPtr<Contact> newContactT = DPL::StaticPointerCast<Contact>(contact);
if(newContactT->EmailsJSObjIsSet()){
- LogDebug("return init value");
+ LoggerD("return init value");
return newContactT->getEmailsJSObj();
}else{
- LogDebug("new array");
+ LoggerD("new array");
JSValueRef tempJSValue = newContactT->getEmailsJSValue();
tempJSValue = converter->toJSValueRef(newContactT->getEmails());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactPtr contact(NULL);
ThrowMsg(InvalidArgumentException, "No private object.");
}
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
vCard = contact->convertToString(format);
} Catch(ConversionException) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument must be 'ContactTextFormat string'");
} Catch(UnsupportedException) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, "Only support vCard 3.0");
} Catch(Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
Try {
result = converter->toJSValueRef(vCard);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactPtr contact(NULL);
ThrowMsg(InvalidArgumentException, "No private object.");
}
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
clonedContact = contact->clone();
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
JSContextRef gContext = priv->getContext();
result = createJSObject(gContext, clonedContact);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);