#include "JSSyncInfo.h"
#include "DataSyncConverter.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create JSSyncInfo private object.");
+ LoggerD("Create JSSyncInfo private object.");
SyncInfoPtr syncInfo( new SyncInfo() );
SyncInfoPrivateObject *priv = new SyncInfoPrivateObject(context, syncInfo);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
{
SyncInfoPrivateObject* priv = static_cast<SyncInfoPrivateObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogDebug("Deleting JSSyncInfo private object.");
+ LoggerD("Deleting JSSyncInfo private object.");
delete priv;
JSObjectSetPrivate(object, NULL);
}
}
Catch(Exception)
{
- LogError("Error during setting JSSyncInfo object.");
+ LoggerE("Error during setting JSSyncInfo object.");
}
}
syncInfo->setSyncMode(converter.toSyncMode(converter.toString(arguments[3])));
}
- LogDebug("url: "<<syncInfo->getUrl()<<", id: "<<syncInfo->getId()<<", password: "<<syncInfo->getPassword()<<", mode: "<<syncInfo->getSyncMode());
+ LoggerD("url: "<<syncInfo->getUrl()<<", id: "<<syncInfo->getId()<<", password: "<<syncInfo->getPassword()<<", mode: "<<syncInfo->getSyncMode());
if (SyncInfo::MANUAL_MODE==syncInfo->getSyncMode()) {
if (argumentCount>=5) {
syncInfo->setSyncInterval(converter.toSyncInterval(converter.toString(arguments[4])));
}
} else {
- LogDebug("The sync mode should be push.");
+ LoggerD("The sync mode should be push.");
}
return createJSSyncInfo(context, syncInfo);
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_SYNC_INFO_INTERVAL)) {
return converter.toJSValueRef(converter.toTizenValue(syncInfo->getSyncInterval()));
} else {
- LogDebug("Wrong property name.");
+ LoggerD("Wrong property name.");
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
syncInfo->setSyncInterval(converter.toSyncInterval(converter.toString(value)));
return true;
} else {
- LogDebug("Wrong property name.");
+ LoggerD("Wrong property name.");
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;