Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.22
-Release: 2
+Version: 0.4.23
+Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Alarm {
snprintf(strDate, sizeof(strDate), "%d %d %d %d %d %d",m_date.tm_year, m_date.tm_mon,
m_date.tm_mday, m_date.tm_hour, m_date.tm_min, m_date.tm_sec);
- LogInfo("setDate encrypted string = " << strDate);
+ LoggerI("setDate encrypted string = " << strDate);
service_add_extra_data(m_service_handle, ALARM_ALSOLUTE_DATE_KEY, strDate);
- LogInfo("AlarmAbsolute Date = " << " Sec: " << m_date.tm_sec << ", Min: "<< m_date.tm_min
+ LoggerI("AlarmAbsolute Date = " << " Sec: " << m_date.tm_sec << ", Min: "<< m_date.tm_min
<< ", Hour:" << m_date.tm_hour << ", Day: " << m_date.tm_mday << ", MON: " << m_date.tm_mon
<< ", Year: " << m_date.tm_year);
}
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <time.h>
#include <app.h>
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <vector>
#include <app.h>
#include <time.h>
#include "AlarmAbsolute.h"
#include "JSAlarmRelative.h"
#include "AlarmRelative.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Alarm {
{
service_h service;
service_create(&service);
- LogError("[ILOVEFILM] Enter AlarmConverter toService std package = " << id.c_str());
+ LoggerE("[ILOVEFILM] Enter AlarmConverter toService std package = " << id.c_str());
service_set_operation(service, SERVICE_OPERATION_DEFAULT);
service_set_package(service, id.c_str());
service_h service;
service_create(&service);
- LogError("[ILOVEFILM] Enter AlarmConverter toService std package = " << id.c_str());
+ LoggerE("[ILOVEFILM] Enter AlarmConverter toService std package = " << id.c_str());
service_set_operation(service, SERVICE_OPERATION_DEFAULT);
service_set_package(service, id.c_str());
memset(&date, 0, sizeof(tm));
int error = ALARM_ERROR_NONE;
- LogInfo("Enter AlarmConverter.toAlarmAbsolutePtr");
+ LoggerI("Enter AlarmConverter.toAlarmAbsolutePtr");
error = service_get_extra_data(handle, ALARM_ALSOLUTE_DATE_KEY, &dateString);
- LogInfo("Date Strng = " << dateString);
+ LoggerI("Date Strng = " << dateString);
if(error != SERVICE_ERROR_NONE)
{
- LogError("Fail to get AlarmDelay");
+ LoggerE("Fail to get AlarmDelay");
return false;
}
sscanf(dateString, "%d %d %d %d %d %d", &date.tm_year, &date.tm_mon,
&date.tm_mday, &date.tm_hour, &date.tm_min, &date.tm_sec);
mktime(&date);
- LogInfo("Converter AlarmAbsolute Date = " << " Sec: " << date.tm_sec << ", Min: "<< date.tm_min
+ LoggerI("Converter AlarmAbsolute Date = " << " Sec: " << date.tm_sec << ", Min: "<< date.tm_min
<< ", Hour: " << date.tm_hour << ", Day: " << date.tm_mday << ", MON: " << date.tm_mon
<< ", Year: " << date.tm_year);
if(!strcmp(alarmType, ALARM_ALSOLUTE_RECURRENCE_TYPE_INTERVAL)) {
int interval = 0;
alarm_get_scheduled_period(id, &interval);
- LogInfo("interval type alarm: "<<interval);
+ LoggerI("interval type alarm: "<<interval);
privateData->setInterval(interval);
} else if(!strcmp(alarmType, ALARM_ALSOLUTE_RECURRENCE_TYPE_BYDAYVALUE)) {
int byDayValue =0;
error = alarm_get_scheduled_recurrence_week_flag(id, &byDayValue);
- LogInfo("daysOfWeek type alarm: "<<byDayValue<<", error: "<<error);
+ LoggerI("daysOfWeek type alarm: "<<byDayValue<<", error: "<<error);
if(error==ALARM_ERROR_NONE && byDayValue>0) {
std::vector<std::string> result;
result = convertFlagToDaysOfTheWeek(byDayValue);
privateData->setByDayRecurrence(result);
} else {
- LogInfo("Can't get the recurrence week flag.");
+ LoggerI("Can't get the recurrence week flag.");
}
}
error = service_get_extra_data(handle, ALARM_RELATIVE_DELAY_KEY, &delayString);
if(error != SERVICE_ERROR_NONE)
{
- LogError("Fail to get AlarmDelay");
+ LoggerE("Fail to get AlarmDelay");
return false;
}
delay = atoi(delayString);
bool AlarmConverter::toAlarmService(service_h service, DeviceAPI::Application::ApplicationControlPtr appservice)
{
if (appservice->getOperation().compare("") != 0) {
- LogDebug("operation is "<<appservice->getOperation());
+ LoggerD("operation is "<<appservice->getOperation());
service_set_operation(service, appservice->getOperation().c_str() );
} else {
- LogDebug("Error. operation is madatory field. cannot be null");
+ LoggerD("Error. operation is madatory field. cannot be null");
return false;
}
if (appservice->getUri().compare("") != 0) {
- LogDebug("uri is not null");
+ LoggerD("uri is not null");
service_set_uri(service, appservice->getUri().c_str() );
}
if (appservice->getMime().compare("") != 0) {
- LogDebug("mime is "<<appservice->getMime());
+ LoggerD("mime is "<<appservice->getMime());
service_set_mime(service, appservice->getMime().c_str() );
}
- LogDebug(">>> appservice->getAppControlDataArray");
+ LoggerD(">>> appservice->getAppControlDataArray");
std::vector<DeviceAPI::Application::ApplicationControlDataPtr> appControlDataArray = appservice->getAppControlDataArray();
if (!appControlDataArray.empty()) {
std::string key;
const char** arr = NULL;
- LogDebug("serviceDataArray.size() : "<<appControlDataArray.size());
+ LoggerD("serviceDataArray.size() : "<<appControlDataArray.size());
for (size_t i = 0; i < appControlDataArray.size(); ++i) {
key = appControlDataArray.at(i)->getKey();
#ifndef _JS_TIZEN_ALARM_CONVERTER_H_
#define _JS_TIZEN_ALARM_CONVERTER_H_
-#include <dpl/log/log.h>
#include <vector>
#include <string>
#include <app.h>
#include "alarm_common.h"
#include <JSTimeDuration.h>
#include <app.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Alarm {
void AlarmRelative::setPeriod(int value)
{
- LogInfo("Param Peroid = " << value);
+ LoggerI("Param Peroid = " << value);
m_Period = value;
- LogInfo("Setted Period = " << m_Period);
+ LoggerI("Setted Period = " << m_Period);
}
int AlarmRelative::getPeriod()
{
- LogInfo("return Period = " << m_Period);
+ LoggerI("return Period = " << m_Period);
return m_Period;
}
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <time.h>
#include <app.h>
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/Validator.h>
#include "plugin_config.h"
#include "JSAlarmAbsolute.h"
#include "JSAlarmManager.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Alarm {
{
JSAlarmAbsolutePriv *priv = static_cast<JSAlarmAbsolutePriv*>(JSObjectGetPrivate(object));
if (!priv) {
- LogError("Private object is null");
+ LoggerE("Private object is null");
}
delete priv;
}
date = privateData->getDate();
- LogInfo("JSAlarmAbsolute Date = " << " Sec : " << date.tm_sec << " Min : "<< date.tm_min
+ LoggerI("JSAlarmAbsolute Date = " << " Sec : " << date.tm_sec << " Min : "<< date.tm_min
<< " Hour" << date.tm_hour << "Day : " << date.tm_mday << " MON : " << date.tm_mon
<< " Year : " << date.tm_year);
JSObjectRef result = JSObjectMakeDate(ctx, 6, args, exception);
return result;
} catch (...) {
- LogWarning("Exception: occured");
+ LoggerW("Exception: occured");
}
return JSValueMakeUndefined(ctx);
return JSValueMakeNull(ctx);
}
} catch (...) {
- LogWarning("Exception: occured");
+ LoggerW("Exception: occured");
}
return JSValueMakeUndefined(ctx);
return JSValueMakeNull(ctx);
}
} catch (...) {
- LogWarning("Exception: occured");
+ LoggerW("Exception: occured");
}
return JSValueMakeUndefined(ctx);
return jsResult;
} catch (...) {
- LogWarning("Exception: occured");
+ LoggerW("Exception: occured");
}
return JSValueMakeUndefined(ctx);
void JSAlarmManager::initialize(JSContextRef ctx, JSObjectRef object)
{
gContext = ctx;
- LogInfo("GContext = " << gContext);
+ LoggerI("GContext = " << gContext);
}
void JSAlarmManager::finalize(JSObjectRef object)
// applicationId
std::string appId = validator.toString(1);
- LogDebug("appId:[" << appId << "]");
+ LoggerD("appId:[" << appId << "]");
// alarm
JSObjectRef alarmObj = validator.toObject(0);
int err = ALARM_ERROR_NONE;
if(alarmType == AbsoluteRecurrence::ByDayValue) {
int bydayValue = converter.toNativeAlarmValue(alarmPtr->getByDayRecurrence());
- LogInfo("Native bydayValue = " << bydayValue);
+ LoggerI("Native bydayValue = " << bydayValue);
err = alarm_schedule_with_recurrence_week_flag(service, &startDate, bydayValue, &alarm_id);
} else if(alarmType == AbsoluteRecurrence::Interval) {
int interval = alarmPtr->getInterval();
}
} else {
- LogError("First parameter is not a Alarm object");
+ LoggerE("First parameter is not a Alarm object");
throw TypeMismatchException("First parameter is not a Alarm object");
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
ThrowMsg(InvalidArgumentException, "Wrong application id.");
}
applicationId = converter.toString(arguments[1]);
- LogDebug("package:[" << applicationId << "]");
+ LoggerD("package:[" << applicationId << "]");
}
if(JSValueIsObjectOfClass(ctx, arguments[0], JSAlarmAbsolute::getClassRef())) {
service_set_operation(service, SERVICE_OPERATION_DEFAULT);
}
- LogDebug("applicationId:[" << applicationId << "]");
+ LoggerD("applicationId:[" << applicationId << "]");
service_set_app_id(service, applicationId.c_str());
AbsoluteRecurrence::Type alarmType = alarmPtr->getRecurrenceType();
int err = ALARM_ERROR_NONE;
if(alarmType == AbsoluteRecurrence::ByDayValue) {
int bydayValue = converter.toNativeAlarmValue(alarmPtr->getByDayRecurrence());
- LogInfo("Native bydayValue = " << bydayValue);
+ LoggerI("Native bydayValue = " << bydayValue);
err = alarm_schedule_with_recurrence_week_flag(service, &startDate, bydayValue, &alarm_id);
} else if(alarmType == AbsoluteRecurrence::Interval) {
int interval = alarmPtr->getInterval();
if(err == ALARM_ERROR_NONE) {
alarmPtr->setId(alarm_id);
}else{
- LogDebug("err:[" << err << "]");
+ LoggerD("err:[" << err << "]");
ThrowMsg(PlatformException, "Alarm scheduling failed.");
}
} else if(JSValueIsObjectOfClass(ctx, arguments[0], JSAlarmRelative::getClassRef())) {
service_set_operation(service, SERVICE_OPERATION_DEFAULT);
}
- LogDebug("applicationId:[" << applicationId << "]");
+ LoggerD("applicationId:[" << applicationId << "]");
service_set_app_id(service, applicationId.c_str());
int err = alarm_schedule_after_delay(service, delay, interval, &alarm_id);
if(err == ALARM_ERROR_NONE) {
alarmPtr->setId(alarm_id);
}else{
- LogDebug("err:[" << err << "]");
+ LoggerD("err:[" << err << "]");
}
} else {
ThrowMsg(ConversionException, "Wrong first parameter type.");
}
} Catch(ConversionException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(ctx, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
} Catch(UnsupportedException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(ctx, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
} Catch(InvalidArgumentException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(ctx, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
} Catch(Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(ctx, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(ctx);
std::stringstream(id) >> alarmId;
if (alarmId <= 0) {
- LogError("id is wrong : " << alarmId);
+ LoggerE("id is wrong : " << alarmId);
throw InvalidValuesException("Invalid ID");
}
TIME_TRACER_ITEM_END("(removeAll)alarm_cancel_all", 0);
if (ALARM_ERROR_NONE != returnVal) {
- LogInfo("Error while removing all alarms: "<<returnVal);
+ LoggerI("Error while removing all alarms: "<<returnVal);
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
std::stringstream(id) >> alarmId;
if (alarmId <= 0) {
- LogError("id is wrong : " << alarmId);
+ LoggerE("id is wrong : " << alarmId);
throw InvalidValuesException("Invalid ID");
}
ret = service_get_extra_data(service, ALARM_TYPE_KEY, &alarmType);
if (ret != SERVICE_ERROR_NONE) {
- LogError("Getting data failed: " << ret);
+ LoggerE("Getting data failed: " << ret);
service_destroy(service);
throw UnknownException("Unknown error occurred.");
}
int error = alarm_foreach_registered_alarm(alarm_iterate_callback, &alarmIds);
if (error == ALARM_ERROR_CONNECTION_FAIL) {
- LogWarning("Alarm system may not be ready yet.");
+ LoggerW("Alarm system may not be ready yet.");
alarmIds.clear();
} else if(error != ALARM_ERROR_NONE) {
- LogInfo("Error occurred while getting all alarms: "<<error);
+ LoggerI("Error occurred while getting all alarms: "<<error);
throw UnknownException("Unknown error occurred.");
}
error = alarm_get_service(alarmIds.at(i), &handle);
if(error != ALARM_ERROR_NONE) {
- LogInfo("Getting service failed: " << error);
+ LoggerI("Getting service failed: " << error);
throw NotFoundException("Alarm not found");
}
error = service_get_extra_data(handle, ALARM_TYPE_KEY, &alarmType);
if(error != SERVICE_ERROR_NONE) {
- LogInfo("Getting data failed: " << error);
+ LoggerI("Getting data failed: " << error);
service_destroy(handle);
throw UnknownException("Unknown error occurred.");
}
- LogInfo("Alarm id: " << alarmIds.at(i));
- LogInfo("Alarm Type: " << alarmType);
+ LoggerI("Alarm id: " << alarmIds.at(i));
+ LoggerI("Alarm Type: " << alarmType);
JSValueRef obj = NULL;
if (strcmp(alarmType, ALARM_TYPE_ABSOLUTE_VALUE) == 0) {
- LogInfo("Enter getAll Natvie alarm id = " << alarmIds.at(i));
+ LoggerI("Enter getAll Natvie alarm id = " << alarmIds.at(i));
AlarmAbsolutePtr privateData = AlarmAbsolutePtr(new AlarmAbsolute(handle));
if(!converter.toAlarmAbsolutePtr(alarmIds.at(i), handle, privateData)) {
return JSUtil::toJSValueRef(context, (long)604800);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed. %s", err.getMessage().c_str());
+ LoggerW("Getting property is failed. %s", err.getMessage().c_str());
}
return NULL;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/Validator.h>
#include <app.h>
#include <time.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Alarm {
{
JSAlarmRelativePriv *priv = static_cast<JSAlarmRelativePriv*>(JSObjectGetPrivate(object));
if (!priv) {
- LogError("Private object is null");
+ LoggerE("Private object is null");
}
delete priv;
}
long result = nextTime - currentTime;
- LogDebug("nextTime: "<<nextTime<<", currentTime: "<<currentTime<<", result: "<<result);
+ LoggerD("nextTime: "<<nextTime<<", currentTime: "<<currentTime<<", result: "<<result);
if(result < 0) {
// It is impossible
}
delay = privateData->getDelay();
- LogInfo("JSAlarmRelative delay = " << delay);
+ LoggerI("JSAlarmRelative delay = " << delay);
return DeviceAPI::Common::JSUtil::toJSValueRef(ctx, delay);
} catch (const BasePlatformException &err) {
return JSWebAPIException::throwException(ctx, exception, err);
}
period = privateData->getPeriod();
- LogInfo("JSAlarmRelative interval = " << period);
+ LoggerI("JSAlarmRelative interval = " << period);
if(period == -1) {
return JSValueMakeNull(ctx);
} else {
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSAlarmManager.h"
#include "JSAlarmAbsolute.h"
#include "JSAlarmRelative.h"
+#include <Logger.h>
#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\AlarmManager ] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\AlarmManager ] on_widget_start_callback (" << widgetId << ")");
Try
{
TIME_TRACER_INIT();
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\AlarmManager ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\AlarmManager ] on_widget_stop_callback (" << widgetId << ")");
Try
{
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Alarm");
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
//
#include "AppManagerWrapper.h"
-
-#include <dpl/log/log.h>
#include <dpl/singleton_impl.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
// To get package id from appId
#include <package_manager.h>
+#include <Logger.h>
+
IMPLEMENT_SINGLETON(DeviceAPI::Application::AppManagerWrapper)
namespace DeviceAPI {
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
if(m_callbacks.size() == 0)
{
- LogWarning("No callbacks are registered.");
+ LoggerW("No callbacks are registered.");
return;
}
AppListChangedCallbacksSet::iterator iter = m_callbacks.find(callbacks);
if(iter == m_callbacks.end())
{
- LogWarning("Callbacks " << callbacks << " are not registered.");
+ LoggerW("Callbacks " << callbacks << " are not registered.");
return;
}
bool AppManagerWrapper::app_callback(package_info_app_component_type_e comp_type, const char *app_id, void *user_data)
{
if(app_id == NULL) {
- LogWarning("app_manager listener gave a NULL package name.");
+ LoggerW("app_manager listener gave a NULL package name.");
return true;
}
if(user_data == NULL) {
- LogWarning("No user data to store appId");
+ LoggerW("No user data to store appId");
return true;
}
void AppManagerWrapper::appListChangedCallback(app_manger_event_type_e event_type, const char *pkgId, void *user_data)
{
if(user_data == NULL) {
- LogWarning("No user data to store appId");
+ LoggerW("No user data to store appId");
return;
}
int ret = package_manager_get_package_info(pkgId, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot create package info by : " << pkgId);
+ LoggerD("Cannot create package info by : " << pkgId);
return;
}
ret = package_info_foreach_app_from_package(package_info, PACKAGE_INFO_ALLAPP, app_callback, user_data);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("failed while getting appids");
+ LoggerD("failed while getting appids");
return;
}
ret = package_info_destroy(package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot destroy package info");
+ LoggerD("Cannot destroy package info");
}
for (size_t i = 0; i < appManager->applist.size(); i++) {
appListAppUpdated(appManager->applist.at(i).c_str());
break;
default:
- LogWarning("app_manager listener gave wrong event_type : " << event_type);
+ LoggerW("app_manager listener gave wrong event_type : " << event_type);
break;
}
}
void AppManagerWrapper::appListAppInstalled(const char *appId)
{
- LogDebug("app installed : " << appId);
+ LoggerD("app installed : " << appId);
AppListChangedCallbacksSet::iterator iter = m_callbacks.begin();
for(; iter != m_callbacks.end(); iter++)
void AppManagerWrapper::appListAppUninstalled(const char *appId)
{
- LogDebug("app uninstalled : " << appId);
+ LoggerD("app uninstalled : " << appId);
AppListChangedCallbacksSet::iterator iter = m_callbacks.begin();
for(; iter != m_callbacks.end(); iter++)
void AppManagerWrapper::appListAppUpdated(const char *appId)
{
- LogDebug("app updated : " << appId);
+ LoggerD("app updated : " << appId);
AppListChangedCallbacksSet::iterator iter = m_callbacks.begin();
for(; iter != m_callbacks.end(); iter++)
int ret = package_manager_get_package_info(package, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot create package info by : " << package);
+ LoggerD("Cannot create package info by : " << package);
}
ret = package_info_foreach_app_from_package(package_info, PACKAGE_INFO_ALLAPP, app_callback, data);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("failed while getting appids");
+ LoggerD("failed while getting appids");
}
ret = package_info_destroy(package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot destroy package info");
+ LoggerD("Cannot destroy package info");
}
event_type = APP_MANAGER_EVENT_UNINSTALLED;
} else if (!strcasecmp(val, "update")) {
void AppManagerWrapper::registerAppListChangedCallbacks()
{
if (m_manager_handle != NULL) {
- LogWarning("Callback already registered.");
+ LoggerW("Callback already registered.");
return;
}
void AppManagerWrapper::unregisterAppListChangedCallbacks()
{
if (m_manager_handle == NULL) {
- LogWarning("No callback registered");
+ LoggerW("No callback registered");
return;
}
char* packageId = NULL;
int ret = 0;
- //LogDebug("InitializeAppInfo for " << appInfo->getAppId().c_str());
+ //LoggerD("InitializeAppInfo for " << appInfo->getAppId().c_str());
ret = package_manager_get_package_id_by_app_id(appId.c_str(), &packageId);
if (ret != PACKAGE_MANAGER_ERROR_NONE)
{
- LogDebug("Fail to get package id with appId : " << appId.c_str());
+ LoggerD("Fail to get package id with appId : " << appId.c_str());
}
// Below code is already run on ApplicationManager.cpp
ret = pkgmgrinfo_appinfo_get_appinfo(appId.c_str(), &appinfo_h);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get appinfo by " << appId.c_str());
+ LoggerD("Fail to get appinfo by " << appId.c_str());
}
ret = pkgmgrinfo_appinfo_get_label(appinfo_h, &name);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get name by " << appId.c_str());
+ LoggerD("Fail to get name by " << appId.c_str());
}
appInfo->setName(name);
ret = pkgmgrinfo_appinfo_get_icon(appinfo_h, &iconPath);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get icon by " << appId.c_str());
+ LoggerD("Fail to get icon by " << appId.c_str());
}
appInfo->setIconPath(iconPath);
ret = pkgmgrinfo_appinfo_is_nodisplay(appinfo_h, &noDisplay);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get nodisplay by " << appId.c_str());
+ LoggerD("Fail to get nodisplay by " << appId.c_str());
}
appInfo->setShow(!noDisplay);
ret = pkgmgrinfo_appinfo_foreach_category(appinfo_h, category_cb, (void*)appInfo.Get());
if (ret < 0)
{
- LogDebug("Fail to get categories " << appId.c_str());
+ LoggerD("Fail to get categories " << appId.c_str());
}
ret = pkgmgrinfo_appinfo_destroy_appinfo(appinfo_h);
if (ret < 0)
{
- LogDebug("Fail to destroy " << appId.c_str());
+ LoggerD("Fail to destroy " << appId.c_str());
}
#endif
ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &pkginfo_h);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get package info");
+ LoggerD("Fail to get package info");
}
ret = pkgmgrinfo_pkginfo_get_version(pkginfo_h, &version);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get version");
+ LoggerD("Fail to get version");
}
appInfo->setVersion(version);
#include "ApplicationControlData.h"
#include "ApplicationControl.h"
#include "ApplicationManager.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
void Application::getRequestedAppControl(const EventApplicationGetRequestedAppControlPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
int ret = 0;
std::string bundle_str = event->getEncodedBundle();
- LogDebug("bundle str : " << bundle_str);
+ LoggerD("bundle str : " << bundle_str);
service_h service = NULL;
char* tmpStr = NULL;
ret = service_create_event(request_bundle, &service);
if(ret != SERVICE_ERROR_NONE)
{
- LogError("Fail to create event");
+ LoggerE("Fail to create event");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
bundle_free(request_bundle);
return;
ret = service_get_operation(service, &tmpStr);
if(ret == SERVICE_ERROR_NONE && tmpStr != NULL)
{
- LogDebug(" operation : " << tmpStr);
+ LoggerD(" operation : " << tmpStr);
appControl->setOperation(tmpStr);
free(tmpStr);
tmpStr = NULL;
ret = service_get_uri(service, &tmpStr);
if(ret == SERVICE_ERROR_NONE && tmpStr != NULL)
{
- LogDebug(" uri : " << tmpStr);
+ LoggerD(" uri : " << tmpStr);
appControl->setUri(tmpStr);
free(tmpStr);
tmpStr = NULL;
ret = service_get_mime(service, &tmpStr);
if(ret == SERVICE_ERROR_NONE && tmpStr != NULL)
{
- LogDebug(" mime : " << tmpStr);
+ LoggerD(" mime : " << tmpStr);
appControl->setMime(tmpStr);
free(tmpStr);
tmpStr = NULL;
ret = service_get_category(service, &tmpStr);
if(ret == SERVICE_ERROR_NONE && tmpStr != NULL)
{
- LogDebug(" category : " << tmpStr);
+ LoggerD(" category : " << tmpStr);
appControl->setCategory(tmpStr);
free(tmpStr);
tmpStr = NULL;
ret = service_foreach_extra_data(service, ApplicationManager::service_extra_data_callback, &appControlDataArray);
if (ret != SERVICE_ERROR_NONE)
{
- LogError("service_foreach_extra_data fail");
+ LoggerE("service_foreach_extra_data fail");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
}
else
ret = service_get_caller(service, &tmpStr);
if(ret == SERVICE_ERROR_NONE && tmpStr != NULL)
{
- LogDebug(" caller App Id : " << tmpStr);
+ LoggerD(" caller App Id : " << tmpStr);
appCtrMgr->setCallerAppId(tmpStr);
free(tmpStr);
tmpStr = NULL;
} else {
- LogError("caller id fail");
+ LoggerE("caller id fail");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
event->setRequestedAppControl(appCtrMgr);
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppControl : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppControl : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include "ApplicationInformation.h"
#include "EventApplicationGetRequestedAppControl.h"
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
namespace DeviceAPI {
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
namespace DeviceAPI {
* @version 0.1
*/
-
#include "ApplicationControl.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
ApplicationControl::ApplicationControl() :
m_appControl(NULL)
{
- LogDebug("entered");
+ LoggerD("entered");
}
ApplicationControl::ApplicationControl(const std::string &op, const std::string &uri,
std::vector<ApplicationControlDataPtr> &dataArray) :
m_appControl(NULL)
{
- LogDebug("entered");
+ LoggerD("entered");
m_operation = op;
m_uri = uri;
m_mime = mime;
ApplicationControl::~ApplicationControl()
{
- LogDebug("entered");
+ LoggerD("entered");
}
std::string ApplicationControl::getOperation() const
if (!appControlDataArray.empty())
{
- LogDebug("appControlDataArray.size() : "<<appControlDataArray.size());
+ LoggerD("appControlDataArray.size() : "<<appControlDataArray.size());
for (size_t i = 0; i < appControlDataArray.size(); ++i) {
key = appControlDataArray.at(i)->getKey().c_str();
std::vector<std::string> valueArray = appControlDataArray.at(i)->getValue();
service_add_extra_data_array(reply, key, arr, valueArray.size());
}
} else {
- LogError("==[replyResult] appControlDataArray is empty");
+ LoggerE("==[replyResult] appControlDataArray is empty");
}
service_reply_to_launch_request(reply, m_appControl, SERVICE_RESULT_SUCCEEDED);
service_h reply;
service_create(&reply);
- LogError("==[replyFailure] enter ApplicationControl::replyFailure");
+ LoggerE("==[replyFailure] enter ApplicationControl::replyFailure");
service_reply_to_launch_request(reply, m_appControl, SERVICE_RESULT_FAILED);
service_destroy(reply);
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <app_service.h>
#include "ApplicationControlData.h"
//
#include "ApplicationControlData.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
ApplicationControlData::ApplicationControlData()
{
- LogDebug("entered");
+ LoggerD("entered");
}
ApplicationControlData::~ApplicationControlData()
{
//nothing to do in destructor
- LogDebug("entered");
+ LoggerD("entered");
}
std::string ApplicationControlData::getKey() const
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
namespace DeviceAPI {
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "JSApplicationEventCallbackManager.h"
#include "ApplicationAsyncCallbackManager.h"
#include "ApplicationInformationEventPrivateData.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
EventApplicationAppInfoEventListenerListener(ThreadEnum::NULL_THREAD),
ApplicationPrivObject(context, application)
{
- LogDebug("ApplicationController constructed : " << this);
+ LoggerD("ApplicationController constructed : " << this);
if (!application) {
- LogWarning("controller has no application object");
+ LoggerW("controller has no application object");
}
}
ApplicationController::~ApplicationController()
{
- LogDebug("ApplicationController destructed : " << this);
+ LoggerD("ApplicationController destructed : " << this);
}
void ApplicationController::OnAnswerReceived(const EventApplicationLaunchPtr &event)
void ApplicationAsyncAnswerHandler::launch(const EventApplicationLaunchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess();
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::kill(const EventApplicationKillPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess();
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::launchAppControl(const EventApplicationLaunchAppControlPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess();
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::launchAppControlReply(const EventApplicationLaunchAppControlReplyPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
ApplicationConverterFactory::getConverter(gContext);
JSValueRef result = converter->toJSValueRef(*appControlDataArray);
- LogDebug("replyCallbackManager onsuccess");
+ LoggerD("replyCallbackManager onsuccess");
callbackManager->callOnSuccess(result);
return;
void ApplicationAsyncAnswerHandler::findAppControl(const EventApplicationFindAppControlPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result, 2);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::getAppsContext(const EventApplicationGetAppsContextPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::getAppsInfo(const EventApplicationGetAppsInfoPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ApplicationAsyncAnswerHandler::eventListener(const EventApplicationAppInfoEventListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSApplicationEventCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSApplicationEventCallbackManager>(event->getPrivateData());
if (!callbackManager)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ApplicationInformationPtr appInfo = event->getAppInfo();
if(appInfo == NULL)
{
- LogError("AppInfo did not set.");
+ LoggerE("AppInfo did not set.");
return;
}
JSValueRef result = converter->toJSValueRefFromApplicationInformation(appInfo);
ApplicationInformationPtr appInfo = event->getAppInfo();
if(appInfo == NULL)
{
- LogError("AppInfo did not set.");
+ LoggerE("AppInfo did not set.");
return;
}
JSValueRef result = converter->toJSValueRefFromApplicationInformation(appInfo);
std::string appId = appInfo->getAppId();
if(appId == "")
{
- LogError("AppId did not set.");
+ LoggerE("AppId did not set.");
return;
}
JSValueRef result = converter->toJSValueRef(appId);
}
else
{
- LogError("Event callback type is wrong.");
+ LoggerE("Event callback type is wrong.");
return;
}
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
}
#ifndef _TIZEN_APPLICATION_APPLICATION_CONTROLLER_H_
#define _TIZEN_APPLICATION_APPLICATION_CONTROLLER_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include <Commons/EventListener.h>
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include "JSApplicationControl.h"
#include "JSRequestedApplicationControl.h"
#include "JSApplicationCert.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
JSValueRef ApplicationConverter::toJSValueRefFromApplication(const ApplicationPtr &arg)
{
- LogDebug("entered to toJSValueRefFromApplication ");
+ LoggerD("entered to toJSValueRefFromApplication ");
if(arg == NULL) {
Throw(Commons::ConversionException);
}
JSValueRef ApplicationConverter::toJSValueRefFromApplicationCert(const ApplicationCertPtr &arg)
{
- LogDebug("entered to toJSValueRefFromApplicationCert ");
+ LoggerD("entered to toJSValueRefFromApplicationCert ");
if(arg == NULL) {
Throw(Commons::ConversionException);
}
JSValueRef ApplicationConverter::toJSValueRef(const RequestedApplicationControlPtr &arg)
{
- LogDebug("entered to toJSValueRefFromRequestedApplicationControl" );
+ LoggerD("entered to toJSValueRefFromRequestedApplicationControl" );
if(arg == NULL) {
Throw(Commons::InvalidArgumentException);
}
JSValueRef ApplicationConverter::toJSValueRef(const ApplicationControlPtr &arg)
{
- LogDebug("entered");
+ LoggerD("entered");
if(arg == NULL) {
Throw(Commons::InvalidArgumentException);
}
JSValueRef ApplicationConverter::toJSValueRef(const ApplicationControlDataPtr &arg)
{
- LogDebug("entered");
+ LoggerD("entered");
return CommonsJavaScript::JSUtils::makeObject(m_context, JSApplicationControlData::getClassRef(), arg);
}
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
namespace DeviceAPI {
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSApplicationManager.h"
#include "ApplicationController.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
if(!priv)
{
- LogError("Object has no private object.");
+ LoggerE("Object has no private object.");
return;
}
Try
{
- LogDebug("Remove a listener");
+ LoggerD("Remove a listener");
EventApplicationRemoveAppInfoEventListenerPtr event(
new EventApplicationRemoveAppInfoEventListener());
event->setForSynchronousCall();
Try {
- LogDebug("Remove change listener");
+ LoggerD("Remove change listener");
application->removeAppInfoEventListener(event);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
#include <app.h>
-#include <dpl/log/log.h>
-
// to launch app by aul
#include <aul.h>
// To get ppid
#include <unistd.h>
+#include <Logger.h>
+
namespace DeviceAPI {
namespace Application {
static void app_manager_app_context_event_callback(app_context_h app_context,
app_context_event_e event, void *user_data)
{
- LogDebug("called");
+ LoggerD("called");
int ret = 0;
if(event != APP_CONTEXT_EVENT_TERMINATED)
ret = app_context_get_pid(app_context, &pid);
if(ret != APP_MANAGER_ERROR_NONE)
{
- LogDebug("Fail to get pid of terminated app (" << ret << ")");
+ LoggerD("Fail to get pid of terminated app (" << ret << ")");
return;
}
ret = app_manager_get_app_info(appId, &handle);
if (ret < 0)
{
- LogDebug("Fail to get appinfo by " << appId);
+ LoggerD("Fail to get appinfo by " << appId);
return NULL;
}
ret = app_info_get_package(handle, &pkgName);
if (ret < 0)
{
- LogDebug("Fail to get pkgName by " << appId);
+ LoggerD("Fail to get pkgName by " << appId);
pkgName = NULL;
}
ret = app_info_destroy(handle);
if (ret < 0)
{
- LogDebug("Fail to get destory appinfo");
+ LoggerD("Fail to get destory appinfo");
return NULL;
}
ret = app_context_get_app_id(app_context, &app_id);
if((ret != APP_MANAGER_ERROR_NONE) || (app_id == NULL))
{
- LogDebug("app_context_get_app_id error (" << ret << ")");
+ LoggerD("app_context_get_app_id error (" << ret << ")");
return false;
}
ret = app_context_get_pid(app_context, &pid);
if(ret != APP_MANAGER_ERROR_NONE)
{
- LogDebug("app_context_get_app_id error (" << ret << ")");
+ LoggerD("app_context_get_app_id error (" << ret << ")");
if (app_id)
free(app_id);
return false;
static void service_reply_callback(service_h request, service_h reply,
service_result_e result, void *user_data)
{
- LogDebug("appControlResultCallback called");
+ LoggerD("appControlResultCallback called");
LaunchAppControlPendingEventMap::DataKeyType key =
(LaunchAppControlPendingEventMap::DataKeyType)user_data;
certName = "DISTRIBUTOR2_SIGNER";
break;
default:
- LogDebug("Unknow Cert type!!!");
+ LoggerD("Unknow Cert type!!!");
break;
}
static int get_current_app_id(char** app_id)
{
- LogDebug("get_current_app_id enter");
+ LoggerD("get_current_app_id enter");
int parent_pid = getppid();
- LogDebug("parent pid : " << parent_pid);
+ LoggerD("parent pid : " << parent_pid);
int ret = app_manager_get_app_id(parent_pid, app_id);
if ((ret != APP_MANAGER_ERROR_NONE) || (app_id == NULL))
{
- LogDebug("Cannot get app id from pid : " << parent_pid);
+ LoggerD("Cannot get app id from pid : " << parent_pid);
}
else
{
- LogDebug("appid : " << *app_id);
+ LoggerD("appid : " << *app_id);
}
return ret;
static int category_cb(const char *category, void *user_data)
{
- //LogDebug("enter");
+ //LoggerD("enter");
if (category == NULL)
return true;
ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &pkginfo_h);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get package info");
+ LoggerD("Fail to get package info");
}
ret = pkgmgrinfo_pkginfo_get_version(pkginfo_h, &version);
if ((ret != PMINFO_R_OK) || (version == NULL)) {
- LogDebug("Fail to get version");
+ LoggerD("Fail to get version");
} else {
appInfo->setVersion(version);
}
ret = pkgmgrinfo_pkginfo_get_total_size(pkginfo_h, &total_size);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get total size");
+ LoggerD("Fail to get total size");
} else {
appInfo->setInstallSize(total_size);
}
ret = pkgmgrinfo_pkginfo_get_installed_time(pkginfo_h, &installed_time);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get installed time");
+ LoggerD("Fail to get installed time");
} else {
appInfo->setInstallDate(installed_time);
}
ret = pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get destroy pkginfo");
+ LoggerD("Fail to get destroy pkginfo");
}
- LogDebug("6");
+ LoggerD("6");
}
static ApplicationInformationPtr create_app_info(pkgmgrinfo_appinfo_h handle)
{
- //LogDebug("enter");
+ //LoggerD("enter");
char* appId = NULL;
//char* packageId = NULL;
char* name = NULL;
ApplicationInformationPtr appInfo(new ApplicationInformation());
ret = pkgmgrinfo_appinfo_get_appid(handle, &appId);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get name by " << appId);
+ LoggerD("Fail to get name by " << appId);
} else {
appInfo->setAppId(appId);
}
ret = pkgmgrinfo_appinfo_get_label(handle, &name);
if ((ret != PMINFO_R_OK) || (name == NULL)) {
- LogDebug("Fail to get name by " << appId);
+ LoggerD("Fail to get name by " << appId);
} else {
appInfo->setName(name);
}
ret = pkgmgrinfo_appinfo_get_icon(handle, &iconPath);
if ((ret != PMINFO_R_OK) || (iconPath == NULL)) {
- LogDebug("Fail to get icon by " << appId);
+ LoggerD("Fail to get icon by " << appId);
} else {
appInfo->setIconPath(iconPath);
}
ret = pkgmgrinfo_appinfo_is_nodisplay(handle, &noDisplay);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get nodisplay by " << appId);
+ LoggerD("Fail to get nodisplay by " << appId);
} else {
appInfo->setShow(!noDisplay);
}
ret = pkgmgrinfo_appinfo_foreach_category(handle, category_cb, (void*)appInfo.Get());
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get categories " << appId);
+ LoggerD("Fail to get categories " << appId);
}
ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgId);
if ((ret != PMINFO_R_OK) || (pkgId == NULL)) {
- LogDebug("Fail to get pkg Id by " << appId);
+ LoggerD("Fail to get pkg Id by " << appId);
} else {
appInfo->setPackageId(pkgId);
}
ret = pkgmgrinfo_appinfo_get_pkgname(handle, &packageId);
if (ret != PMINFO_R_OK)
{
- LogDebug("Fail to get package id with appId : " << appId);
+ LoggerD("Fail to get package id with appId : " << appId);
return appInfo;
}
- LogDebug("package id : " << packageId);
+ LoggerD("package id : " << packageId);
set_additional_app_info(appInfo, packageId);
#endif
static int installed_app_info_cb(pkgmgrinfo_appinfo_h handle, void *user_data)
{
- //LogDebug("enter");
+ //LoggerD("enter");
ApplicationInformationPtr appInfo = create_app_info(handle);
ApplicationInformationArray *appInfoArray = (ApplicationInformationArray*)user_data;
appInfoArray->push_back(appInfo);
{
if(appid == NULL)
{
- LogWarning("appid is NULL");
+ LoggerW("appid is NULL");
return false;
}
//ApplicationInformationPtr appInfo(new ApplicationInformation(appid));
pkgmgrinfo_appinfo_h handle;
int ret = pkgmgrinfo_appinfo_get_appinfo(appid, &handle);
if (ret != PMINFO_R_OK) {
- LogWarning("Fail to get appInfo from appId : " << appid);
+ LoggerW("Fail to get appInfo from appId : " << appid);
}
ApplicationInformationPtr appInfo = create_app_info(handle);
pkgmgrinfo_appinfo_destroy_appinfo(handle);
void ApplicationManager::getAppCerts(const EventApplicationGetAppCertsPtr& event)
{
- LogError("ApplicationManager::getAppCerts");
+ LoggerE("ApplicationManager::getAppCerts");
if (m_initialized == false) {
initialize();
}
void ApplicationManager::getAppSharedURI(const EventApplicationGetAppSharedURIPtr& event)
{
- LogError("ApplicationManager::getAppSharedURI");
+ LoggerE("ApplicationManager::getAppSharedURI");
if (m_initialized == false) {
initialize();
}
if(result == SERVICE_RESULT_SUCCEEDED)
{
- LogDebug("SERVICE_RESULT_SUCCEEDED in serviceResultCallback");
+ LoggerD("SERVICE_RESULT_SUCCEEDED in serviceResultCallback");
// create new service object to store result.
ApplicationControlDataArrayPtr appControlDataArray(new ApplicationControlDataArray());
if( result == SERVICE_ERROR_NONE)
{
event->setAppControlDataArray(appControlDataArray);
- LogDebug("service_foreach_extra_data() success");
+ LoggerD("service_foreach_extra_data() success");
}
else
{
- LogDebug("service_foreach_extra_data() failed");
+ LoggerD("service_foreach_extra_data() failed");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
}
}
else if(result == SERVICE_RESULT_FAILED || result == SERVICE_RESULT_CANCELED)
{
- LogDebug("SERVICE_RESULT_FAILED in serviceResultCallback : " <<result);
+ LoggerD("SERVICE_RESULT_FAILED in serviceResultCallback : " <<result);
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
}
EventApplicationKillPtr event = it->second;
m_killEventMap.erase(it);
- LogDebug("Calling kill success callback for pid : " << pid);
+ LoggerD("Calling kill success callback for pid : " << pid);
EventRequestReceiver<EventApplicationKill>::ManualAnswer(event);
}
int ret = 0;
ApplicationControlDataArray* appControlDataArray = (ApplicationControlDataArray*)user_data;
- LogDebug(" key : " << key);
+ LoggerD(" key : " << key);
bool isArray = false;
ret = service_is_extra_data_array(service, key, &isArray);
if (ret != SERVICE_ERROR_NONE)
{
- LogDebug("service_is_extra_data_array passes error");
+ LoggerD("service_is_extra_data_array passes error");
// fail to checking. go to next extra data.
return true;
}
switch(ret)
{
case SERVICE_ERROR_NONE: {
- LogDebug("service_get_extra_data success");
+ LoggerD("service_get_extra_data success");
std::vector<std::string> valArray;
- LogDebug("value length : " << length);
+ LoggerD("value length : " << length);
for (int i = 0; i < length; i++)
{
- LogDebug("value : " << value[i]);
+ LoggerD("value : " << value[i]);
if(value[i])
{
valArray.push_back(value[i]);
break;
}
case SERVICE_ERROR_INVALID_PARAMETER:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_INVALID_PARAMETER");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_INVALID_PARAMETER");
break;
case SERVICE_ERROR_KEY_NOT_FOUND:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_KEY_NOT_FOUND");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_KEY_NOT_FOUND");
break;
case SERVICE_ERROR_OUT_OF_MEMORY:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_OUT_OF_MEMORY");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_OUT_OF_MEMORY");
break;
default:
- LogDebug("service_get_extra_data retuns Error");
+ LoggerD("service_get_extra_data retuns Error");
break;
}
}
{
if(value == NULL)
{
- LogDebug("service_get_extra_data returns NULL");
+ LoggerD("service_get_extra_data returns NULL");
break;
}
- LogDebug("service_get_extra_data success");
- LogDebug("key = "<<key<<" value = "<<value);
+ LoggerD("service_get_extra_data success");
+ LoggerD("key = "<<key<<" value = "<<value);
std::vector<std::string> valArray;
valArray.push_back(value);
break;
}
case SERVICE_ERROR_INVALID_PARAMETER:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_INVALID_PARAMETER");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_INVALID_PARAMETER");
break;
case SERVICE_ERROR_KEY_NOT_FOUND:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_KEY_NOT_FOUND");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_KEY_NOT_FOUND");
break;
case SERVICE_ERROR_OUT_OF_MEMORY:
- LogDebug("service_get_extra_data retuns SERVICE_ERROR_OUT_OF_MEMORY");
+ LoggerD("service_get_extra_data retuns SERVICE_ERROR_OUT_OF_MEMORY");
break;
default:
- LogDebug("service_get_extra_data retuns Error");
+ LoggerD("service_get_extra_data retuns Error");
break;
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetCurrAppPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
if (m_app != NULL) {
- LogDebug("CurrentApplicaton Object is already created.");
+ LoggerD("CurrentApplicaton Object is already created.");
event->setApp(m_app);
return;
}
int ret = get_current_app_id(&app_id);
if((ret != APP_ERROR_NONE) || (app_id == NULL))
{
- LogError("Can not get app id from current pid (" << ret << ")");
+ LoggerE("Can not get app id from current pid (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
pkgmgrinfo_appinfo_h handle;
int ret = pkgmgrinfo_appinfo_get_appinfo(appId.c_str(), &handle);
if (ret != PMINFO_R_OK) {
- LogWarning("Fail to get appInfo from appId : " << appId);
+ LoggerW("Fail to get appInfo from appId : " << appId);
}
ApplicationInformationPtr appInfo = create_app_info(handle);
ApplicationPtr app(new Application());
app->setAppInfo(appInfo);
- LogDebug("set appinfo to application");
+ LoggerD("set appinfo to application");
{
//int pid = getpid();
int pid = getppid();
sstr << pid;
app->setContextId(sstr.str());
- LogError("set pid : " << pid);
+ LoggerE("set pid : " << pid);
}
event->setApp(app);
- LogDebug("set application to event ");
+ LoggerD("set application to event ");
m_app = app;
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppInfo : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppInfo : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
void ApplicationManager::OnRequestReceived(const EventApplicationLaunchPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
std::string appId = event->getAppId();
if(appId.empty())
{
- LogError("App id is empty");
+ LoggerE("App id is empty");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
- LogDebug("Launching app id : " << appId);
+ LoggerD("Launching app id : " << appId);
// if the application is running, send raise event to the app instead of reset the application.
#if 1
// delay 300ms for each retry
usleep(300 * 1000);
retry++;
- LogDebug("retry launch request : " << retry);
+ LoggerD("retry launch request : " << retry);
}
if (ret < 0) {
{
case AUL_R_EINVAL:
case AUL_R_ERROR:
- LogDebug("aul_open_app returns Not Found error");
+ LoggerD("aul_open_app returns Not Found error");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
break;
case AUL_R_ECOMM:
- LogDebug("aul_open_app returns internal IPC error");
+ LoggerD("aul_open_app returns internal IPC error");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
break;
default:
- LogDebug("aul_open_app returns Unknown error");
+ LoggerD("aul_open_app returns Unknown error");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
break;
}
} else {
- LogDebug("callee's pid " << ret);
+ LoggerD("callee's pid " << ret);
}
#else
service_h service;
// delay 300ms for each retry
usleep(300 * 1000);
retry++;
- LogDebug("retry launch request : " << retry);
+ LoggerD("retry launch request : " << retry);
}
service_destroy(service);
switch (ret)
{
case SERVICE_ERROR_INVALID_PARAMETER:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_INVALID_PARAMETER");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_INVALID_PARAMETER");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
break;
case SERVICE_ERROR_OUT_OF_MEMORY:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_OUT_OF_MEMORY");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_OUT_OF_MEMORY");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
break;
case SERVICE_ERROR_LAUNCH_REJECTED:
case SERVICE_ERROR_APP_NOT_FOUND:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_APP_NOT_FOUND");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_APP_NOT_FOUND");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
break;
default:
- LogDebug("service_send_launch_request returns UNKNOWN ERROR!!! (" << ret << ")");
+ LoggerD("service_send_launch_request returns UNKNOWN ERROR!!! (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
break;
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on launch : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on launch : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationKillPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
if(contextId.empty())
{
- LogError("Context id is empty");
+ LoggerE("Context id is empty");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
- LogDebug("Killing context id : " << contextId);
+ LoggerD("Killing context id : " << contextId);
int pid;
std::stringstream(contextId) >> pid;
if(pid <= 0)
{
- LogError("Context id is wrong : " << pid);
+ LoggerE("Context id is wrong : " << pid);
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
ret = app_manager_get_app_id(pid, &appIdCStr);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogError("Error while getting app id (" << ret << ")");
+ LoggerE("Error while getting app id (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
ret = app_manager_get_app_context (appId.c_str(), &appContext);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogError("Error while getting app context (" << ret << ")");
+ LoggerE("Error while getting app context (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
ret = app_manager_set_app_context_event_cb(app_manager_app_context_event_callback, this);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogError("Error while registering app context event (" << ret << ")");
+ LoggerE("Error while registering app context event (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
return;
}
ret = app_manager_terminate_app(appContext);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogError("Error while terminating app (" << ret << ")");
+ LoggerE("Error while terminating app (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
return;
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on kill : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on kill : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationLaunchAppControlPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
ApplicationControlPtr appControl = event->getAppControl();
if(appControl == NULL)
{
- LogError("appControl is NULL");
+ LoggerE("appControl is NULL");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
std::string operation = appControl->getOperation();
if(operation.empty())
{
- LogDebug("operation being madatory is empty");
+ LoggerD("operation being madatory is empty");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
if (!appId.empty())
{
- LogDebug(" app id : " << appId);
+ LoggerD(" app id : " << appId);
// Application exist checking. if specific application is not exist, return Not Found Exception.
app_info_h info_h;
}
service_set_operation(service, operation.c_str() );
- LogDebug(" operation : " << operation);
+ LoggerD(" operation : " << operation);
std::string uri = appControl->getUri();
if (!uri.empty())
{
- LogDebug(" uri : " << uri);
+ LoggerD(" uri : " << uri);
service_set_uri(service, uri.c_str() );
}
std::string mime = appControl->getMime();
if (!mime.empty())
{
- LogDebug(" mime : " << mime);
+ LoggerD(" mime : " << mime);
service_set_mime(service, mime.c_str() );
}
std::string category = appControl->getCategory();
if (!category.empty())
{
- LogDebug(" category : " << category);
+ LoggerD(" category : " << category);
service_set_category(service, category.c_str() );
}
if(!appControlDataArray.empty())
{
- LogDebug(" datas : " << appControlDataArray.size());
+ LoggerD(" datas : " << appControlDataArray.size());
ApplicationControlDataArray::iterator iter;
for(iter = appControlDataArray.begin(); iter != appControlDataArray.end(); iter++)
ApplicationControlDataPtr appControlData = *iter;
std::string key = appControlData->getKey();
- LogDebug(" key : " << key);
+ LoggerD(" key : " << key);
if(key.empty())
{
for (size_t j = 0; j < size; j++)
{
arr[j] = valueArray.at(j).c_str();
- LogDebug(" value : " << arr[j]);
+ LoggerD(" value : " << arr[j]);
}
// @20121207-wscho: roll-back to return extra-data instead of extra-data array when the value size is one.
// delay 300ms for each retry
usleep(300 * 1000);
retry++;
- LogDebug("retry launch request : " << retry);
+ LoggerD("retry launch request : " << retry);
}
service_destroy(service);
switch (ret)
{
case SERVICE_ERROR_INVALID_PARAMETER:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_INVALID_PARAMETER");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_INVALID_PARAMETER");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
break;
case SERVICE_ERROR_OUT_OF_MEMORY:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_OUT_OF_MEMORY");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_OUT_OF_MEMORY");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
break;
case SERVICE_ERROR_LAUNCH_REJECTED:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_LAUNCH_REJECTED!!!");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_LAUNCH_REJECTED!!!");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
break;
case SERVICE_ERROR_APP_NOT_FOUND:
- LogDebug("service_send_launch_request returns SERVICE_ERROR_APP_NOT_FOUND");
+ LoggerD("service_send_launch_request returns SERVICE_ERROR_APP_NOT_FOUND");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
break;
default:
- LogDebug("service_send_launch_request returns UNKNOWN ERROR!!!");
+ LoggerD("service_send_launch_request returns UNKNOWN ERROR!!!");
event->setExceptionCode(Commons::ExceptionCodes::UnknownException);
break;
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on launchAppControl : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on launchAppControl : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationLaunchAppControlReplyPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
event->switchToManualAnswer();
}
void ApplicationManager::OnRequestReceived(const EventApplicationFindAppControlPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
ApplicationControlPtr appControl = event->getAppControl();
if(appControl == NULL)
{
- LogError("appControl is NULL");
+ LoggerE("appControl is NULL");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
std::string operation = appControl->getOperation();
if(operation.empty())
{
- LogDebug("operation being madatory is empty");
+ LoggerD("operation being madatory is empty");
event->setExceptionCode(Commons::ExceptionCodes::InvalidArgumentException);
return;
}
service_create(&service);
service_set_operation(service, operation.c_str() );
- LogDebug(" operation : " << operation);
+ LoggerD(" operation : " << operation);
std::string uri = appControl->getUri();
if (!uri.empty())
{
- LogDebug(" uri : " << uri);
+ LoggerD(" uri : " << uri);
service_set_uri(service, uri.c_str() );
}
std::string mime = appControl->getMime();
if (!mime.empty())
{
- LogDebug(" mime : " << mime);
+ LoggerD(" mime : " << mime);
service_set_mime(service, mime.c_str() );
}
std::string category = appControl->getCategory();
if (!category.empty())
{
- LogDebug(" category : " << category);
+ LoggerD(" category : " << category);
service_set_category(service, category.c_str() );
}
if(!appControlDataArray.empty())
{
- LogDebug(" datas : " << appControlDataArray.size());
+ LoggerD(" datas : " << appControlDataArray.size());
ApplicationControlDataArray::iterator iter;
for(iter = appControlDataArray.begin(); iter != appControlDataArray.end(); iter++)
ApplicationControlDataPtr appControlData = *iter;
std::string key = appControlData->getKey();
- LogDebug(" key : " << key);
+ LoggerD(" key : " << key);
if(key.empty())
{
for (size_t j = 0; j < size; j++)
{
arr[j] = valueArray.at(j).c_str();
- LogDebug(" value : " << arr[j]);
+ LoggerD(" value : " << arr[j]);
}
// @20121207-wscho: roll-back to return extra-data instead of extra-data array when the value size is one.
int result = service_foreach_app_matched(service, service_app_matched_callback, (void *)appInfos.Get());
if (result != SERVICE_ERROR_NONE)
{
- LogError("service_foreach_app_matched error (" << result << ")");
+ LoggerE("service_foreach_app_matched error (" << result << ")");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
service_destroy(service);
return;
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on findAppControl : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on findAppControl : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppsContextPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
ret = app_manager_foreach_app_context(app_manager_app_context_callback, appContextArray.Get());
if(ret != APP_MANAGER_ERROR_NONE)
{
- LogError("app_manager_foreach_app_context error (" << ret << ")");
+ LoggerE("app_manager_foreach_app_context error (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppContextPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
int ret = 0;
std::string contextId = event->getAppContextId();
- LogDebug("contextId : " << contextId);
+ LoggerD("contextId : " << contextId);
int pid;
if (contextId.empty())
{
- LogDebug("empty");
+ LoggerD("empty");
//pid = getpid();
pid = getppid();
}
else
{
- LogDebug("not empty");
+ LoggerD("not empty");
std::stringstream(contextId) >> pid;
if (pid <= 0)
{
- LogError("contextId is wrong : " << contextId);
+ LoggerE("contextId is wrong : " << contextId);
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
{
case APP_MANAGER_ERROR_NO_SUCH_APP:
case APP_MANAGER_ERROR_INVALID_PARAMETER:
- LogError("app_manager_get_app_id error : no such app");
+ LoggerE("app_manager_get_app_id error : no such app");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
break;
default:
- LogError("app_manager_get_app_id error (" << ret << ")");
+ LoggerE("app_manager_get_app_id error (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
break;
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppContext : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppContext : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppsInfoPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
ApplicationInformationArrayPtr appInfoArray = event->getAppInfoArray();
ret = pkgmgrinfo_appinfo_get_installed_list(installed_app_info_cb, (void*)appInfoArray.Get());
if (ret != PMINFO_R_OK) {
- LogError("Error on getAppsInfo : ");
+ LoggerE("Error on getAppsInfo : ");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppsInfo : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppsInfo : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppInfoPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
int ret = get_current_app_id(&app_id);
if((ret != APP_ERROR_NONE) || (app_id == NULL))
{
- LogError("Can not get app id from current pid (" << ret << ")");
+ LoggerE("Can not get app id from current pid (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppInfo : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppInfo : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationAddAppInfoEventListenerPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
if(m_installedApplicationsEmitters.size() == 0)
{
- LogDebug("First time registering event listener to this application object.");
+ LoggerD("First time registering event listener to this application object.");
// Below can throw Exception
AppManagerWrapperSingleton::Instance().registerAppListChangedCallbacks(this);
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on addAppInfoEventListener : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on addAppInfoEventListener : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationRemoveAppInfoEventListenerPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
if(m_installedApplicationsEmitters.size() == 0)
{
- LogDebug("No more event listener on this application object.");
+ LoggerD("No more event listener on this application object.");
AppManagerWrapperSingleton::Instance().unregisterAppListChangedCallbacks(this);
}
}
Catch (WrtDeviceApis::Commons::NotFoundException)
{
- LogError("Not found : " << _rethrown_exception.GetMessage());
+ LoggerE("Not found : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on removeAppInfoEventListener : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on removeAppInfoEventListener : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppCertsPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
int ret = get_current_app_id(&tmp);
if((ret != APP_ERROR_NONE) || (tmp == NULL))
{
- LogError("Can not get app id from current pid (" << ret << ")");
+ LoggerE("Can not get app id from current pid (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
char* package = getPackageByAppId(appId.c_str());
if (package == NULL)
{
- LogError("Can not get package from appId (" << appId << ")");
+ LoggerE("Can not get package from appId (" << appId << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
- LogDebug("package : " << package);
+ LoggerD("package : " << package);
package_info_h pkg_info;
int result = 0;
event->setAppCerts(certArray);
- LogDebug("Finish to getting package cert info");
+ LoggerD("Finish to getting package cert info");
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Error on getAppInfo : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getAppInfo : " << _rethrown_exception.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void ApplicationManager::OnRequestReceived(const EventApplicationGetAppSharedURIPtr& event)
{
- LogError("ApplicationManager::getAppCerts");
+ LoggerE("ApplicationManager::getAppCerts");
std::string id = event->getAppId();
std::string appId;
int ret = 0;
- LogError("appId(" << id << ")");
+ LoggerE("appId(" << id << ")");
if (id.empty()) {
char *app_id = NULL;
//int ret = app_get_id(&app_id); // webkit2 patch.
ret = get_current_app_id(&app_id);
if((ret != APP_ERROR_NONE) || (app_id == NULL)) {
- LogError("Can not get app id from current pid (" << ret << ")");
+ LoggerE("Can not get app id from current pid (" << ret << ")");
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
char* pkg_name = NULL;
ret = app_manager_get_app_info(appId.c_str(), &handle);
if (ret != APP_ERROR_NONE) {
- LogDebug("Fail to get appinfo by " << appId);
+ LoggerD("Fail to get appinfo by " << appId);
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
ret = app_info_get_package(handle, &pkg_name);
if ((ret != APP_ERROR_NONE) || (pkg_name == NULL)) {
- LogDebug("Fail to get pkg_name by " << appId);
+ LoggerD("Fail to get pkg_name by " << appId);
event->setExceptionCode(Commons::ExceptionCodes::NotFoundException);
return;
}
app_info_destroy(handle);
- LogError("pkg_name(" << pkg_name << ")");
+ LoggerE("pkg_name(" << pkg_name << ")");
pkgmgrinfo_pkginfo_h pkginfo_h;
char* root_path = NULL;
ret = pkgmgrinfo_pkginfo_get_root_path(pkginfo_h, &root_path);
if ((ret != PMINFO_R_OK) && (root_path != NULL)) {
- LogDebug("Fail to get root path");
+ LoggerD("Fail to get root path");
free(pkg_name);
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
return;
}
- LogError("pkg_name(" << root_path << ")");
+ LoggerE("pkg_name(" << root_path << ")");
std::string sharedURI = TIZENAPIS_APP_FILE_SCHEME + std::string(root_path) + TIZENAPIS_APP_SLASH +
std::string(pkg_name) + TIZENAPIS_APP_SLASH + TIZENAPIS_APP_SHARED;
free(pkg_name);
- LogError("sharedURI(" << sharedURI << ")");
+ LoggerE("sharedURI(" << sharedURI << ")");
pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h);
void ApplicationManager::onAppManagerEventInstalled(const char *appId)
{
- LogDebug("APP_MANAGER_EVENT_INSTALLED, appId : "<< appId);
+ LoggerD("APP_MANAGER_EVENT_INSTALLED, appId : "<< appId);
EventApplicationAppInfoEventListenerPtr event(new EventApplicationAppInfoEventListener());
void ApplicationManager::onAppManagerEventUninstalled(const char *appId)
{
- LogDebug("APP_MANAGER_EVENT_UNINSTALLED, appId : "<< appId);
+ LoggerD("APP_MANAGER_EVENT_UNINSTALLED, appId : "<< appId);
EventApplicationAppInfoEventListenerPtr event(new EventApplicationAppInfoEventListener());
void ApplicationManager::onAppManagerEventUpdated(const char *appId)
{
- LogDebug("APP_MANAGER_EVENT_UPDATED, appId : "<< appId);
+ LoggerD("APP_MANAGER_EVENT_UPDATED, appId : "<< appId);
EventApplicationAppInfoEventListenerPtr event(new EventApplicationAppInfoEventListener());
DataPtrType dataPtr = getData(*keySetIter);
if(dataPtr == NULL)
{
- LogWarning("No data for " << *keySetIter);
+ LoggerW("No data for " << *keySetIter);
break;
}
if(dataKeyIter == m_dataMap.end())
{
- LogDebug("No data for " << dataKey);
+ LoggerD("No data for " << dataKey);
return;
}
typename KeyMapType::iterator keyMapIter = m_keyMap.find(key);
if(keyMapIter == m_keyMap.end())
{
- LogWarning("No data for Key");
+ LoggerW("No data for Key");
return;
}
DataKeySetType::iterator keySetIter = keySet.find(dataKey);
if(keySetIter == keySet.end())
{
- LogWarning("No data for " << dataKey);
+ LoggerW("No data for " << dataKey);
return;
}
typename KeyMapType::iterator keyMapIter = m_keyMap.find(key);
if(keyMapIter == m_keyMap.end())
{
- LogDebug("No data to erase.");
+ LoggerD("No data to erase.");
return;
}
typename DataMapType::iterator dataKeyIter = m_dataMap.find(*keySetIter);
if(dataKeyIter == m_dataMap.end())
{
- LogWarning("No data to erase.");
+ LoggerW("No data to erase.");
break;
}
#ifndef TIZENAPIS_API_APPLICATION_EVENT_FIND_APP_CONTROL_H_
#define TIZENAPIS_API_APPLICATION_EVENT_FIND_APP_CONTROL_H_
-
-#include <dpl/log/log.h>
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "ApplicationInformation.h"
#include "ApplicationControl.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
void JSApplication::initialize(JSContextRef context, JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSApplication::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationPriv* priv = static_cast<JSApplicationPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting JSApplication object");
+ LoggerD("Deleting JSApplication object");
delete priv;
}
JSValueRef JSApplication::makeObject(JSContextRef ctx, const ApplicationPtr value)
{
- LogInfo("entered to ApplicationPtr ");
+ LoggerI("entered to ApplicationPtr ");
if(value == NULL) {
throw TypeMismatchException("Private object is NULL.");
}
return converter->toJSValueRef(privateData->getContextId());
}
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSTizenExceptionFactory::postException(context, exception,JSTizenException::INVALID_VALUES_ERROR, "Invalid value error");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
JSApplicationPriv *priv = static_cast<JSApplicationPriv*>(JSObjectGetPrivate(thisObject));
ScopedJSStringRef(JSStringCreateWithUTF8CString("__bundle")).get(),
exception);
if (JSValueIsUndefined(context, encodedBundle) || JSValueIsNull(context, encodedBundle)) {
- LogError("encodedBundle"+converter->toString(encodedBundle));
+ LoggerE("encodedBundle"+converter->toString(encodedBundle));
return JSValueMakeNull(context);
}
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Converter.h>
#include <JSWebAPIException.h>
#include "ApplicationCert.h"
#include "JSApplicationCert.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
void JSApplicationCert::initialize(JSContextRef context, JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSApplicationCert::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationCertPriv* priv = static_cast<JSApplicationCertPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting JSApplicationCert object");
+ LoggerD("Deleting JSApplicationCert object");
delete priv;
}
CommonsJavaScript::Converter converter(context);
ApplicationCertPtr privateData = getPrivData(object);
- LogError("JSApplicationCert::getProperty = " << propertyName);
+ LoggerE("JSApplicationCert::getProperty = " << propertyName);
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CERT_TYPE)) {
return converter.toJSValueRef(privateData->getType());
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Converter.h>
#include <JSWebAPIException.h>
//#include <JSTizenException.h>
#include "ApplicationContext.h"
#include "JSApplicationContext.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
JSObjectRef jsValueRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsValueRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return JSValueMakeUndefined(context);
}
void JSApplicationContext::initialize(JSContextRef context, JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSApplicationContext::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationContextPriv* priv = static_cast<JSApplicationContextPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting JSApplicationContext object");
+ LoggerD("Deleting JSApplicationContext object");
delete priv;
}
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <SecurityExceptions.h>
#include <JSWebAPIException.h>
#include <ArgumentValidator.h>
+#include <Logger.h>
//#include <Commons/Exception.h>
//#include <JSTizenExceptionFactory.h>
JSObjectRef JSApplicationControl::createJSObject(JSContextRef context, const ApplicationControlPtr &appsvc)
{
- LogInfo(">> createJSObject");
+ LoggerI(">> createJSObject");
JSApplicationControlPriv *priv = new JSApplicationControlPriv(context, appsvc);
if (!priv) {
void JSApplicationControl::initialize(JSContextRef context,JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSApplicationControl::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationControlPriv* priv = static_cast<JSApplicationControlPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting ApplicationControl object");
+ LoggerD("Deleting ApplicationControl object");
delete priv;
}
ApplicationControlPtr JSApplicationControl::getPrivData(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSApplicationControlPriv *priv = static_cast<JSApplicationControlPriv*>(JSObjectGetPrivate(object));
if (!priv) {
throw TypeMismatchException("Private object is null");
ApplicationConverterFactory::ConverterType converter = ApplicationConverterFactory::getConverter(context);
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL_OPERATION)) {
- LogDebug("JSApplicationControl::getProperty::operation " << appsvc->getOperation());
+ LoggerD("JSApplicationControl::getProperty::operation " << appsvc->getOperation());
return converter->toJSValueRef(appsvc->getOperation());
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL_URI)) {
std::string uri = appsvc->getUri();
- LogDebug("JSApplicationControl::getProperty::uri " << uri);
+ LoggerD("JSApplicationControl::getProperty::uri " << uri);
if (uri.empty()) {
return JSValueMakeNull(context);
} else {
}
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL_MIME)) {
std::string mime = appsvc->getMime();
- LogDebug("JSApplicationControl::getProperty::mime " << mime);
+ LoggerD("JSApplicationControl::getProperty::mime " << mime);
if (mime.empty()) {
return JSValueMakeNull(context);
} else {
}
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL_CATEGORY)) {
std::string category = appsvc->getCategory();
- LogDebug("JSApplicationControl::getProperty::category " << category);
+ LoggerD("JSApplicationControl::getProperty::category " << category);
if (category.empty()) {
return JSValueMakeNull(context);
} else {
return converter->toJSValueRef(category);
}
}else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL_DATA)) {
- LogDebug("JSApplicationControl::getProperty::extraData ");
+ LoggerD("JSApplicationControl::getProperty::extraData ");
return converter->toJSValueRef(appsvc->getAppControlDataArray());
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
//#include <JSTizenExceptionFactory.h>
//#include <JSTizenException.h>
#include <JSUtil.h>
-#include <Logger.h>
-
#include "JSApplicationControlData.h"
#include "ApplicationConverter.h"
#include "ApplicationUtil.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef JSApplicationControlData::createJSObject(JSContextRef context, const ApplicationControlDataPtr &appdata)
{
- LogInfo(">> createJSObject");
+ LoggerI(">> createJSObject");
JSApplicationControlDataPriv *priv = new JSApplicationControlDataPriv(context, appdata);
if (!priv) {
void JSApplicationControlData::initialize(JSContextRef context, JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSApplicationControlData::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationControlDataPriv* priv = static_cast<JSApplicationControlDataPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting ApplicationControl object");
+ LoggerD("Deleting ApplicationControl object");
delete priv;
}
ApplicationControlDataPtr JSApplicationControlData::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSApplicationControlDataPriv *priv = static_cast<JSApplicationControlDataPriv*>(JSObjectGetPrivate(object));
if (!priv) {
throw TypeMismatchException("Private object is null");
//
#include "JSApplicationEventCallbackManager.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
{
if ( m_onInstalled == NULL )
{
- //LogDebug("oninstalled callback is not set");
+ //LoggerD("oninstalled callback is not set");
return;
}
JSValueRef objParam[1] = { appInfo };
{
if ( m_onUpdated == NULL )
{
- //LogDebug("onupdated callback is not set");
+ //LoggerD("onupdated callback is not set");
return;
}
JSValueRef objParam[1] = { appInfo };
{
if ( m_onUninstalled == NULL )
{
- //LogDebug("onuninstalled callback is not set");
+ //LoggerD("onuninstalled callback is not set");
return;
}
JSValueRef objParam[1] = { appId };
{
if ( m_onError == NULL )
{
- //LogDebug("Error callback is not set");
+ //LoggerD("Error callback is not set");
return;
}
JSValueRef objParam[1] = { error };
if (callback == NULL)
{
- LogError("callback is NULL");
+ LoggerE("callback is NULL");
return;
}
{
if (argc == 0)
{
- //LogDebug("Calling object directly, no arguments");
+ //LoggerD("Calling object directly, no arguments");
JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
}
else
{
- //LogDebug("Calling object directly, one argument");
+ //LoggerD("Calling object directly, one argument");
JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
}
return;
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Converter.h>
#include <Commons/Exception.h>
#include "ApplicationInformation.h"
#include "JSApplicationInformation.h"
#include "AppManagerWrapper.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
JSObjectRef jsValueRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsValueRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return JSValueMakeUndefined(context);
}
void JSApplicationInformation::initialize(JSContextRef context, JSObjectRef object)
{
- //LogInfo(">> initialize");
+ //LoggerI(">> initialize");
}
void JSApplicationInformation::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSApplicationInformationPriv* priv = static_cast<JSApplicationInformationPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting JSApplicationInformation object");
+ LoggerD("Deleting JSApplicationInformation object");
delete priv;
}
// below code is temporal. if package manager issue is solved, rollback this code.
#if 1 // below code is used to fill attribute lazy
if (!privateData->isInitialized()) {
- //LogInfo(">> is Not Initialized");
+ //LoggerI(">> is Not Initialized");
AppManagerWrapperSingleton::Instance().initializeAppInfo(privateData);
}
#endif
void JSApplicationManager::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug(">>> JSApplicationManager::initialize");
+ LoggerD(">>> JSApplicationManager::initialize");
ApplicationController* priv = static_cast<ApplicationController*>(JSObjectGetPrivate(object));
if (!priv) {
priv = new ApplicationController(context, applications);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
} else {
- LogDebug("private date is already exist");
+ LoggerD("private date is already exist");
}
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
IApplicationManagerPtr appmgr;
ApplicationController *controller;
throw UnknownException("Unknown exception occured");
}
- LogError("get Current Application Successfully. convert application to JSValue");
+ LoggerE("get Current Application Successfully. convert application to JSValue");
//return converter->toJSValueRefFromApplication(event->getApp());
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("launch(async)", 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("kill(async)", 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("launchAppControlReply", 0);
TIME_TRACER_ITEM_BEGIN("launchAppControl(async)", 0);
// id
std::string id = validator.toString(1, true, "");
- LogWarning("id : " << id);
+ LoggerW("id : " << id);
event->setAppId(id);
// successCallback
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("findAppControl(async)", 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("getAppsContext(async)", 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogDebug("BasePlatformException");
+ LoggerD("BasePlatformException");
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
- LogDebug("etc...");
+ LoggerD("etc...");
DeviceAPI::Common::UnknownException err("Unknown Error in ApplicationManager.getAppsContext().");
return JSWebAPIException::throwException(context, exception, err);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
// contextId
std::string contextId = validator.toString(0, true, "");
- LogDebug("contextId : " << contextId);
+ LoggerD("contextId : " << contextId);
event->setAppContextId(contextId);
event->setForSynchronousCall();
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
TIME_TRACER_ITEM_BEGIN("getAppsInfo(async)", 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
// watchId
long watchId = validator.toLong(0);
- LogDebug("watchId : " << watchId);
+ LoggerD("watchId : " << watchId);
event->setWatchId(watchId);
event->setForSynchronousCall();
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = APPLICATION_CHECK_ACCESS(APPLICATION_FUNCTION_API_GET_APP_CERTS);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try {
}
void JSApplicationManager::setTitleProperty(JSContextRef context, std::string propertyValue){
- LogDebug("<<<propertyValue:[" << propertyValue << "]");
+ LoggerD("<<<propertyValue:[" << propertyValue << "]");
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
// get window object
kJSPropertyAttributeNone,
NULL);
- LogDebug(">>>");
+ LoggerD(">>>");
}
}
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <JSTizenException.h>
#include "plugin_config.h"
-
#include "ApplicationConverter.h"
#include "ApplicationUtil.h"
#include "JSRequestedApplicationControl.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef JSRequestedApplicationControl::createJSObject(JSContextRef context, const RequestedApplicationControlPtr &appsvc)
{
- LogInfo(">> createJSObject");
+ LoggerI(">> createJSObject");
JSRequestedApplicationControlPriv *priv = new JSRequestedApplicationControlPriv(context, appsvc);
if (!priv) {
void JSRequestedApplicationControl::initialize(JSContextRef context,JSObjectRef object)
{
- LogInfo(">> initialize");
+ LoggerI(">> initialize");
}
void JSRequestedApplicationControl::finalize(JSObjectRef object)
{
- LogInfo(">> finalize");
+ LoggerI(">> finalize");
JSRequestedApplicationControlPriv* priv = static_cast<JSRequestedApplicationControlPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting ApplicationControl object");
+ LoggerD("Deleting ApplicationControl object");
delete priv;
}
RequestedApplicationControlPtr JSRequestedApplicationControl::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSRequestedApplicationControlPriv *priv = static_cast<JSRequestedApplicationControlPriv*>(JSObjectGetPrivate(object));
if (!priv) {
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
ApplicationConverterFactory::ConverterType converter = ApplicationConverterFactory::getConverter(context);
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_APPLICATION_CONTROL)) {
- LogDebug("JSRequestedApplicationControl::getProperty::appControl " << providerMgr->getAppControl());
+ LoggerD("JSRequestedApplicationControl::getProperty::appControl " << providerMgr->getAppControl());
return converter->toJSValueRef(providerMgr->getAppControl());
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALLER_APP_ID)) {
- LogDebug("JSRequestedApplicationControl::getProperty::callerAppId " << providerMgr->getCallerAppId());
+ LoggerD("JSRequestedApplicationControl::getProperty::callerAppId " << providerMgr->getCallerAppId());
return converter->toJSValueRef(providerMgr->getCallerAppId());
}
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSDOMExceptionFactory::UnknownException.make(context, exception);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
JSRequestedApplicationControlPriv *priv = static_cast<JSRequestedApplicationControlPriv*>(JSObjectGetPrivate(thisObject));
Try {
}
providerMgr->replyResult(resultArray);
} Catch (ConversionException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
} Catch (NotFoundException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
} Catch (NullPointerException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
JSRequestedApplicationControlPriv *priv = static_cast<JSRequestedApplicationControlPriv*>(JSObjectGetPrivate(thisObject));
Try {
RequestedApplicationControlPtr providerMgr = priv->getObject();
providerMgr->replyFailure();
} Catch (NotFoundException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
} Catch (NullPointerException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
// limitations under the License.
//
-
#include <Commons/Exception.h>
#include <app_service.h>
#include <app_manager.h>
#include "RequestedApplicationControl.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Application {
m_appControl(NULL),
m_appService(NULL)
{
- LogDebug("entered");
+ LoggerD("entered");
}
RequestedApplicationControl::~RequestedApplicationControl()
{
- LogDebug("entered");
+ LoggerD("entered");
}
ApplicationControlPtr RequestedApplicationControl::getAppControl() const
{
const char** arr = NULL;
- LogDebug("appControlDataArray.size() : "<<appControlDataArray.size());
+ LoggerD("appControlDataArray.size() : "<<appControlDataArray.size());
for (size_t i = 0; i < appControlDataArray.size(); ++i) {
std::vector<std::string> valueArray = appControlDataArray.at(i)->getValue();
if (arr != NULL) {
for (size_t j = 0; j < valueArray.size(); j++) {
arr[j] = valueArray.at(j).c_str();
- LogDebug("== value : " << arr[j]);
+ LoggerD("== value : " << arr[j]);
}
}
service_add_extra_data_array(reply, appControlDataArray.at(i)->getKey().c_str(), arr, valueArray.size());
}
}
} else {
- LogError("[replyResult] appControlDataArray is empty");
+ LoggerE("[replyResult] appControlDataArray is empty");
}
// temporal code to check caller liveness
if (m_callerAppId.empty()) {
- LogDebug("m_callerAppId is empty. means caller is dead");
+ LoggerD("m_callerAppId is empty. means caller is dead");
ThrowMsg(NotFoundException, "Cannot find caller");
} else {
bool running = false;
int ret = app_manager_is_running(m_callerAppId.c_str(), &running);
if ((ret != APP_MANAGER_ERROR_NONE) || !running) {
- LogDebug("caller is not running");
+ LoggerD("caller is not running");
ThrowMsg(NotFoundException, "Cannot find caller");
}
}
service_h reply;
service_create(&reply);
- LogError("[replyFailure] enter RequestedApplicationControl::replyFailure");
+ LoggerE("[replyFailure] enter RequestedApplicationControl::replyFailure");
// temporal code to check caller liveness
if (m_callerAppId.empty()) {
- LogDebug("m_callerAppId is empty. means caller is dead");
+ LoggerD("m_callerAppId is empty. means caller is dead");
ThrowMsg(NotFoundException, "Cannot find caller");
} else {
bool running = false;
int ret = app_manager_is_running(m_callerAppId.c_str(), &running);
if ((ret != APP_MANAGER_ERROR_NONE) || !running) {
- LogDebug("caller is not running");
+ LoggerD("caller is not running");
ThrowMsg(NotFoundException, "Cannot find caller");
}
}
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include "ApplicationControl.h"
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <sys/types.h>
#include "JSApplicationControl.h"
#include "ApplicationAsyncCallbackManager.h"
#include "ApplicationListenerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
};
void on_widget_start_callback(int widgetId) {
- LogDebug("[Tizen1_0\\Application] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen1_0\\Application] on_widget_start_callback ("<<widgetId<<")");
Try {
TIME_TRACER_INIT();
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId) {
- LogDebug("[Tizen1_0\\Application] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen1_0\\Application] on_widget_stop_callback ("<<widgetId<<")");
Try {
char buf[30];
sprintf(buf,"Application.%d",getpid());
TIME_TRACER_RELEASE();
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\application] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\application] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\application] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\application] on_frame_unload_callback (" << context << ")");
DeviceAPI::Application::ApplicationAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::Application::ApplicationListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
void BluetoothAdapter::onStateChangedCB(int result, bt_adapter_state_e adapterState, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
object->mEnabled = (adapterState == BT_ADAPTER_ENABLED) ? true : false;
if(object->mUserDataList[SET_POWERED] != NULL) { // requested event
bool state = (adapterState == BT_ADAPTER_ENABLED) ? true : false;
if(object->mRequestedState != state) {
- LogWarning("Requested state is same to current state");
+ LoggerW("Requested state is same to current state");
return;
}
}
}
else { // unexpected event
- LogWarning("Bluetooth state is changed unexpectedly");
+ LoggerW("Bluetooth state is changed unexpectedly");
}
}
void BluetoothAdapter::onNameChangedCB(char *name, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
bt_adapter_unset_name_changed_cb();
}
else { // unexpected event
- LogWarning("Bluetooth name is changed unexpectedly");
+ LoggerW("Bluetooth name is changed unexpectedly");
}
}
void BluetoothAdapter::onVisibilityChangedCB(int result, bt_adapter_visibility_mode_e visibilityMode, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
if(object->mUserDataList[SET_VISIBLE] != NULL) { // requested event
//bool visibility = (visibilityMode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE) ? false : true;
if(object->mRequestedVisibility != visibilityMode) {
- LogWarning("Requested visibility is not same to current visibility");
+ LoggerW("Requested visibility is not same to current visibility");
return;
}
bt_adapter_unset_visibility_mode_changed_cb();
}
else { // unexpected event
- LogWarning("Bluetooth visibility is changed unexpectedly");
+ LoggerW("Bluetooth visibility is changed unexpectedly");
}
}
void BluetoothAdapter::onDiscoveryStateChangedCB(int result, bt_adapter_device_discovery_state_e discoveryState,
bt_adapter_device_discovery_info_s *discoveryInfo, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
switch(discoveryState) {
case BT_ADAPTER_DEVICE_DISCOVERY_STARTED:
{
- LogDebug("BT_ADAPTER_DEVICE_DISCOVERY_STARTED");
+ LoggerD("BT_ADAPTER_DEVICE_DISCOVERY_STARTED");
if(object->mUserDataList[DISCOVER_DEVICES] != NULL) { // requested event
MultiCallbackUserDataPtr callback =
static_cast<MultiCallbackUserDataPtr>(object->mUserDataList[DISCOVER_DEVICES]);
}
else {
if(callback) {
- LogDebug("Reset DISCOVER_DEVICES");
+ LoggerD("Reset DISCOVER_DEVICES");
object->mUserDataList[DISCOVER_DEVICES].reset();
JSContextRef context = callback->getContext();
}
}
else { // unexpected event
- LogWarning("Unexpected discovery");
+ LoggerW("Unexpected discovery");
}
break;
}
case BT_ADAPTER_DEVICE_DISCOVERY_FINISHED:
{
- LogDebug("BT_ADAPTER_DEVICE_DISCOVERY_FINISHED");
+ LoggerD("BT_ADAPTER_DEVICE_DISCOVERY_FINISHED");
if(result == BT_ERROR_NONE || result == BT_ERROR_CANCELLED) {
// in case of discoverDevices()
if(object->mUserDataList[DISCOVER_DEVICES] != NULL) {
static_cast<MultiCallbackUserDataPtr>(object->mUserDataList[DISCOVER_DEVICES]);
if(callback) {
- LogDebug("Call onfinished()");
+ LoggerD("Call onfinished()");
if(object->mDisappearedDevices.size() > 0) {
- LogDebug("There are disappeared devices");
+ LoggerD("There are disappeared devices");
for(std::vector<std::string>::iterator iter = object->mDisappearedDevices.begin();
iter != object->mDisappearedDevices.end(); iter++) {
}
if(object->mFoundDevices.size() > 0) { // There are found devices
- LogDebug("There are found devices");
+ LoggerD("There are found devices");
int num = object->mFoundDevices.size();
JSObjectRef devices[num];
for(int i = 0; i < num; i++) {
devices[i] = deviceObj;
}
- LogDebug("Reset DISCOVER_DEVICES");
+ LoggerD("Reset DISCOVER_DEVICES");
object->mUserDataList[DISCOVER_DEVICES].reset();
callback->invokeCallback(
JSObjectMakeArray(callback->getContext(), num, devices, NULL) );
}
else { // There is no found device
- LogDebug("There is no found device");
+ LoggerD("There is no found device");
- LogDebug("Reset DISCOVER_DEVICES");
+ LoggerD("Reset DISCOVER_DEVICES");
object->mUserDataList[DISCOVER_DEVICES].reset();
callback->invokeCallback(
static_cast<MultiCallbackUserDataPtr>(object->mUserDataList[STOP_DISCOVERY]);
if(callback) {
- LogDebug("Call successCallback of stopDiscovery()");
+ LoggerD("Call successCallback of stopDiscovery()");
object->mUserDataList[STOP_DISCOVERY].reset();
callback->invokeCallback("success");
}
//bt_adapter_unset_device_discovery_state_changed_cb();
}
else {
- LogWarning("result MUST be BT_ERROR_NONE or BT_ERROR_CANCELLED when BT_ADAPTER_DEVICE_DISCOVERY_FINISHED");
+ LoggerW("result MUST be BT_ERROR_NONE or BT_ERROR_CANCELLED when BT_ADAPTER_DEVICE_DISCOVERY_FINISHED");
}
break;
}
case BT_ADAPTER_DEVICE_DISCOVERY_FOUND:
{
- LogDebug("BT_ADAPTER_DEVICE_DISCOVERY_FOUND");
+ LoggerD("BT_ADAPTER_DEVICE_DISCOVERY_FOUND");
if(!discoveryInfo) {
- LogWarning("discoveryInfo is NULL");
+ LoggerW("discoveryInfo is NULL");
return;
}
for(std::vector<std::string>::iterator iter = object->mDisappearedDevices.begin();
iter != object->mDisappearedDevices.end(); iter++) {
if(!strcmp(discoveryInfo->remote_address, (*iter).c_str())) {
- LogDebug("This device is still found");
+ LoggerD("This device is still found");
object->mDisappearedDevices.erase(iter);
break;
}
callback->invokeCallback("ondevicefound", deviceObj);
}
else {
- LogWarning("result MUST be BT_ERROR_NONE when BT_ADAPTER_DEVICE_DISCOVERY_FOUND");
+ LoggerW("result MUST be BT_ERROR_NONE when BT_ADAPTER_DEVICE_DISCOVERY_FOUND");
}
}
else { // unexpected event
- LogWarning("Unexpected discovery");
+ LoggerW("Unexpected discovery");
}
break;
}
default:
{
- LogWarning("Unknown state");
+ LoggerW("Unknown state");
}
}
}
bool BluetoothAdapter::foreachBondedDevicesCB(bt_device_info_s *deviceInfo, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr adapter = static_cast<BluetoothAdapterPtr>(userData);
if(!adapter) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return true;
}
if(deviceInfo == NULL) {
- LogWarning("deviceInfo is NULL");
+ LoggerW("deviceInfo is NULL");
return true;
}
BluetoothDeviceSharedPtr foundDevice = *iter;
if(!strcmp(foundDevice->getAddress().c_str(), deviceInfo->remote_address)) {
- LogDebug("Already known device");
+ LoggerD("Already known device");
foundDevice->updateInfo(deviceInfo);
break;
}
}
if(iter == adapter->knownDevices.end()) {
- LogDebug("Add a device into foundDevices");
+ LoggerD("Add a device into foundDevices");
BluetoothDeviceSharedPtr device(new BluetoothDevice(deviceInfo));
adapter->knownDevices.push_back(device);
}
void BluetoothAdapter::onBondCreatedCB(int result, bt_device_info_s *deviceInfo, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
if(!deviceInfo) {
- LogWarning("deviceInfo is NULL");
+ LoggerW("deviceInfo is NULL");
return;
}
object->mCreateBondingAddress.clear();
}
else { // unexpected event
- LogWarning("A bonding is created unexpectedly");
+ LoggerW("A bonding is created unexpectedly");
}
}
void BluetoothAdapter::onBondDestroyedCB(int result, char *remoteAddress, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
object->mDestroyBondingAddress.clear();
}
else { // unexpected event
- LogWarning("A bonding is created unexpectedly");
+ LoggerW("A bonding is created unexpectedly");
}
}
void BluetoothAdapter::onSocketConnected(int result, bt_socket_connection_state_e state, bt_socket_connection_s *connection, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
if(!connection) {
- LogWarning("connection is NULL");
+ LoggerW("connection is NULL");
return;
}
if(connection->local_role == BT_SOCKET_SERVER) {
RegisteredUUIDMapT::iterator iter = object->mRegisteredUUID.find(connection->service_uuid);
if(iter == object->mRegisteredUUID.end()) {
- LogWarning("Connection state is changed unexpectedly");
+ LoggerW("Connection state is changed unexpectedly");
return;
}
bt_socket_set_data_received_cb(onSocketReceivedCB, userData);
}
else {
- LogWarning("Establishing a connection failed");
+ LoggerW("Establishing a connection failed");
}
return;
}
// call BluetoothSocket.onclose;
ConnectedSocketMapT::iterator i = object->mConnectedSocket.find(connection->socket_fd);
if(i == object->mConnectedSocket.end()) {
- LogWarning("Unknown connected socket");
+ LoggerW("Unknown connected socket");
return;
}
//BluetoothSocketSharedPtr socket = i->second;
object->mConnectedSocket.erase(i);
}
else {
- LogWarning("Disconnecting a connection failed");
+ LoggerW("Disconnecting a connection failed");
}
}
}
do {
iter = object->mConnReqMap.find(remoteAddress);
if(iter != object->mConnReqMap.end() && !strcmp(iter->second->mUUID.c_str(), connection->service_uuid)) {
- LogDebug("Find");
+ LoggerD("Find");
break;
}
} while(iter != object->mConnReqMap.end());
if(iter == object->mConnReqMap.end()) {
- LogWarning("Connection state is changed unexpectedly");
+ LoggerW("Connection state is changed unexpectedly");
return;
}
// call BluetoothSocket.onclose;
ConnectedSocketMapT::iterator i = object->mConnectedSocket.find(connection->socket_fd);
if(i == object->mConnectedSocket.end()) {
- LogWarning("Unknown connected socket");
+ LoggerW("Unknown connected socket");
return;
}
object->mConnectedSocket.erase(i);
}
else {
- LogWarning("Disconnecting a connection failed");
+ LoggerW("Disconnecting a connection failed");
}
}
}
else {
- LogWarning("Unknown role");
+ LoggerW("Unknown role");
return;
}
}
if(object->mRegisteredUUID.size() == 0 && object->mConnReqMap.size() == 0 && object->mConnectedSocket.size() == 0) {
- LogDebug("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
+ LoggerD("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
object->mRegisteredUUID.size(), object->mConnReqMap.size(), object->mConnectedSocket.size());
bt_socket_unset_connection_state_changed_cb();
}
void BluetoothAdapter::onSocketReceivedCB(bt_socket_received_data_s *data, void *userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothAdapterPtr object = static_cast<BluetoothAdapterPtr>(userData);
if(!object) {
- LogWarning("userData is NULL");
+ LoggerW("userData is NULL");
return;
}
if(!data) {
- LogWarning("data is NULL");
+ LoggerW("data is NULL");
return;
}
ConnectedSocketMapT::iterator i = object->mConnectedSocket.find(data->socket_fd);
if(i == object->mConnectedSocket.end()) {
- LogWarning("Unknown connected socket");
+ LoggerW("Unknown connected socket");
return;
}
BluetoothAdapter::BluetoothAdapter():
mEnabled(false)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(bt_initialize() != BT_ERROR_NONE) {
- LogError("bt_initialize() failed");
+ LoggerE("bt_initialize() failed");
}
bt_adapter_state_e state;
}
if(bt_adapter_set_state_changed_cb(onStateChangedCB, this) != BT_ERROR_NONE) {
- LogError("bt_adapter_set_state_changed_cb() failed");
+ LoggerE("bt_adapter_set_state_changed_cb() failed");
}
if(bt_adapter_set_device_discovery_state_changed_cb(onDiscoveryStateChangedCB, this) != BT_ERROR_NONE) {
- LogError("bt_adapter_set_device_discovery_state_changed_cb() failed");
+ LoggerE("bt_adapter_set_device_discovery_state_changed_cb() failed");
}
}
BluetoothAdapter::~BluetoothAdapter()
{
- LogDebug("Entered");
+ LoggerD("Entered");
// unset platform callback
bt_adapter_unset_state_changed_cb();
void BluetoothAdapter::unloadFrame(JSContextRef context)
{
- LogDebug("Entered");
+ LoggerD("Entered");
- LogDebug("Clean mUserDataList");
+ LoggerD("Clean mUserDataList");
for(int i = 0; i <= DESTROY_BONDING; i++) {
if(mUserDataList[i]) {
MultiCallbackUserDataPtr callback = mUserDataList[i];
if(!GlobalContextManager::getInstance()->isAliveGlobalContext(callback->getContext())) {
- LogDebug("reset an userData");
+ LoggerD("reset an userData");
mUserDataList[i].reset();
}
}
}
- LogDebug("Clean mConnReqMap");
+ LoggerD("Clean mConnReqMap");
for(ConnReqMultiMapT::iterator iter = mConnReqMap.begin(); iter != mConnReqMap.end(); ) {
ConnReqMultiMapT::iterator temp = iter++;
MultiCallbackUserDataPtr callback = temp->second->mUserData;
if(!callback && !GlobalContextManager::getInstance()->isAliveGlobalContext(callback->getContext())) {
- LogDebug("erase a connectionRequest");
+ LoggerD("erase a connectionRequest");
mConnReqMap.erase(temp);
}
}
void BluetoothAdapter::unregisterUUID(std::string &uuid)
{
- LogDebug("Entered");
+ LoggerD("Entered");
mRegisteredUUID.erase(mRegisteredUUID.find(uuid));
if(mRegisteredUUID.size() == 0 && mConnReqMap.size() == 0 && mConnectedSocket.size() == 0) {
- LogDebug("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
+ LoggerD("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
mRegisteredUUID.size(), mConnReqMap.size(), mConnectedSocket.size());
bt_socket_unset_connection_state_changed_cb();
}
bool BluetoothAdapter::closeConnectedSocket(int socket)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mEnabled == true) {
ConnectedSocketMapT::iterator iter = mConnectedSocket.find(socket);
if(iter == mConnectedSocket.end()) {
- LogWarning("Already disconnected");
+ LoggerW("Already disconnected");
return true;
}
}
if(mRegisteredUUID.size() == 0 && mConnReqMap.size() == 0 && mConnectedSocket.size() == 0) {
- LogDebug("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
+ LoggerD("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
mRegisteredUUID.size(), mConnReqMap.size(), mConnectedSocket.size());
bt_socket_unset_connection_state_changed_cb();
}
return true;
}
else {
- LogError("Bluetooth is not powered");
+ LoggerE("Bluetooth is not powered");
return false;
}
}
void BluetoothAdapter::removeConnReq(std::string &remoteAddress)
{
- LogDebug("Entered");
+ LoggerD("Entered");
mConnReqMap.erase(remoteAddress);
if(mRegisteredUUID.size() == 0 && mConnReqMap.size() == 0 && mConnectedSocket.size() == 0) {
- LogDebug("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
+ LoggerD("mRegisteredUUID.size()=%d, mConnReqMap.size()=%d, mConnectedSocket.size()=%d",
mRegisteredUUID.size(), mConnReqMap.size(), mConnectedSocket.size());
if(bt_socket_unset_connection_state_changed_cb() != BT_ERROR_NONE) {
- LogWarning("Unsetting connection event callback failed");
+ LoggerW("Unsetting connection event callback failed");
}
}
}
BluetoothAdapter* BluetoothAdapter::getInstance()
{
- LogDebug("Entered");
+ LoggerD("Entered");
static BluetoothAdapter instance;
return &instance;
bool isSupported = false;
if(system_info_get_value_bool(SYSTEM_INFO_KEY_BLUETOOTH_SUPPORTED, &isSupported) != SYSTEM_INFO_ERROR_NONE) {
- LogError("Can't know whether Bluetooth is supported or not");
+ LoggerE("Can't know whether Bluetooth is supported or not");
}
return isSupported;
bool BluetoothAdapter::isValidAddress(std::string &address)
{
- LogDebug("Entered");
+ LoggerD("Entered");
pcrecpp::RE re("(([0-9a-zA-Z]+):)+([0-9a-zA-Z]+)");
std::string compareAddress = "00:12:47:08:9A:A6";
if (!re.FullMatch(address)) {
- LogError("Invalid address");
+ LoggerE("Invalid address");
return false;
}
if (address.size() != compareAddress.size())
{
- LogError("Invalid size");
+ LoggerE("Invalid size");
return false;
}
if (!re.FullMatch(uuid))
{
- LogError("Invalid UUID");
+ LoggerE("Invalid UUID");
return false;
}
if (uuid.size() != compareUUID.size())
{
- LogError("Invalid size");
+ LoggerE("Invalid size");
return false;
}
std::string BluetoothAdapter::getName() const
{
- LogDebug("Entered");
+ LoggerD("Entered");
char* name = NULL;
std::string str = "";
{
str = name;
free(name);
- LogDebug("name" << str);
+ LoggerD("name" << str);
}
}
else {
- LogError("bt_adapter_get_name() failed");
+ LoggerE("bt_adapter_get_name() failed");
}
return str;
void BluetoothAdapter::setName(std::string &name, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mEnabled == true) {
std::string adapterName = getName();
if(adapterName == name) { // in case of same name
- LogDebug("same name");
+ LoggerD("same name");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
return;
}
bt_adapter_set_name_changed_cb(onNameChangedCB, this);
mUserDataList[SET_NAME] = userData;
} else {
- LogError("Already requested");
+ LoggerE("Already requested");
UnknownException *error = new UnknownException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_set_name() succeeded");
+ LoggerD("bt_adapter_set_name() succeeded");
mRequestedName = name;
return;
}
case BT_ERROR_INVALID_PARAMETER:
{
- LogError("Invalid value");
+ LoggerE("Invalid value");
InvalidValuesException *error = new InvalidValuesException("Invalid value");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
break;
}
default:
{
- LogError("Invalid value");
+ LoggerE("Invalid value");
UnknownException *error = new UnknownException("Unknown exception");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
bt_adapter_unset_name_changed_cb();
mUserDataList[SET_NAME].reset();
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Bluetooth device is turned off");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
std::string BluetoothAdapter::getAddress() const
{
- LogDebug("Entered");
+ LoggerD("Entered");
char* address = NULL;
std::string str = "";
if (address != NULL) {
str = address;
free(address);
- LogDebug("address: " << str);
+ LoggerD("address: " << str);
}
else {
- LogWarning("address is NULL");
+ LoggerW("address is NULL");
}
}
else {
- LogError("bt_adapter_get_address() failed");
+ LoggerE("bt_adapter_get_address() failed");
}
return str;
bool BluetoothAdapter::getPowered() const
{
- LogDebug("Entered");
+ LoggerD("Entered");
return mEnabled;
}
void BluetoothAdapter::setPowered(bool powered, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(powered == mEnabled) {
- LogDebug("same state");
+ LoggerD("same state");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
return;
}
mUserDataList[SET_POWERED] = userData;
} else {
// Already requested
- LogError("Already requested");
+ LoggerE("Already requested");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_enable() succeeded");
+ LoggerD("bt_adapter_enable() succeeded");
return;
}
case BT_ERROR_ALREADY_DONE:
{
// call successCallback
- LogDebug("BT_ERROR_ALREADY_DONE");
+ LoggerD("BT_ERROR_ALREADY_DONE");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
break;
}
case BT_ERROR_NOW_IN_PROGRESS:
{
- LogDebug("BT_ERROR_NOW_IN_PROGRESS");
+ LoggerD("BT_ERROR_NOW_IN_PROGRESS");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Bluetooth device is busy");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
break;
}
default:
{
- LogDebug("Unknown error");
+ LoggerD("Unknown error");
UnknownException *error = new UnknownException("Unknown error");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_disable() succeeded");
+ LoggerD("bt_adapter_disable() succeeded");
return;
}
case BT_ERROR_NOT_ENABLED:
{
// call successCallback
- LogDebug("Already disabled");
+ LoggerD("Already disabled");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
break;
}
case BT_ERROR_NOW_IN_PROGRESS:
{
- LogDebug("BT_ERROR_NOW_IN_PROGRESS");
+ LoggerD("BT_ERROR_NOW_IN_PROGRESS");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Bluetooth device is busy");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
break;
}
default:
{
- LogDebug("Unknown error");
+ LoggerD("Unknown error");
UnknownException *error = new UnknownException("Unknown error");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
bool BluetoothAdapter::getVisible() const
{
- LogDebug("Entered");
+ LoggerD("Entered");
bt_adapter_visibility_mode_e mode;
void BluetoothAdapter::setVisible(bool visible, unsigned int timeout, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mEnabled == true) {
bt_adapter_visibility_mode_e discoverable_mode = BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
bt_adapter_visibility_mode_e current = BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE;
int time = 0;
if(bt_adapter_get_visibility(¤t , &time) != BT_ERROR_NONE) {
- LogError("bt_adapter_get_visibility() failed");
+ LoggerE("bt_adapter_get_visibility() failed");
UnknownException *error = new UnknownException("Can't get current visibility");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
if(discoverable_mode == current) {
if(discoverable_mode != BT_ADAPTER_VISIBILITY_MODE_LIMITED_DISCOVERABLE) {
- LogDebug("same visibility");
+ LoggerD("same visibility");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
return;
}
else if((unsigned int)time == timeout) {
- LogDebug("same visibility");
+ LoggerD("same visibility");
BluetoothCallbackUtil::syncToAsyncSuccessCallback(userData);
return;
}
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_set_visibility() succeeded");
+ LoggerD("bt_adapter_set_visibility() succeeded");
return;
}
case BT_ERROR_INVALID_PARAMETER:
void BluetoothAdapter::discoverDevices(MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mUserDataList[DISCOVER_DEVICES] == NULL) {
mUserDataList[DISCOVER_DEVICES] = userData;
bt_adapter_set_device_discovery_state_changed_cb(onDiscoveryStateChangedCB, this);
*/
} else {
- LogError("Already requested");
+ LoggerE("Already requested");
UnknownException *error = new UnknownException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_start_device_discovery() succeeded");
+ LoggerD("bt_adapter_start_device_discovery() succeeded");
return;
}
default:
{
- LogError("Unknown exception");
+ LoggerE("Unknown exception");
UnknownException *error = new UnknownException("Unknown error");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
}
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Bluetooth device is turned off");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
void BluetoothAdapter::stopDiscovery(MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mEnabled == true) {
bt_adapter_set_device_discovery_state_changed_cb(onDiscoveryStateChangedCB, this);
*/
} else {
- LogDebug("Already requested");
+ LoggerD("Already requested");
UnknownException *error = new UnknownException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_adapter_stop_device_discovery() succeeded");
+ LoggerD("bt_adapter_stop_device_discovery() succeeded");
return;
}
default:
void BluetoothAdapter::getKnownDevices(MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothCallbackUtil::syncToAsyncDeviceArrayCallback(userData);
}
void BluetoothAdapter::getDevice(std::string &address, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothCallbackUtil::syncToAsyncDeviceCallback(userData, address);
}
void BluetoothAdapter::createBonding(std::string &address, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(!isValidAddress(address)) {
- LogError("Wrong address");
+ LoggerE("Wrong address");
NotFoundException *error = new NotFoundException("Wrong address");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
mCreateBondingAddress = address;
mUserDataList[CREATE_BONDING] = userData;
} else {
- LogError("Already requested");
+ LoggerE("Already requested");
UnknownException *error = new UnknownException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_device_create_bond() succeeded");
+ LoggerD("bt_device_create_bond() succeeded");
return;
}
case BT_ERROR_INVALID_PARAMETER:
{
- LogError("Not found");
+ LoggerE("Not found");
NotFoundException *error = new NotFoundException("Not found");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
break;
}
default:
{
- LogError("Unknown exception");
+ LoggerE("Unknown exception");
UnknownException *error = new UnknownException("Unknown error");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
}
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
ServiceNotAvailableException *error = new ServiceNotAvailableException("Bluetooth device is turned off");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
void BluetoothAdapter::destroyBonding(std::string &address, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(!isValidAddress(address)) {
- LogError("Wrong address");
+ LoggerE("Wrong address");
NotFoundException *error = new NotFoundException("Wrong address");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
mDestroyBondingAddress = address;
mUserDataList[DESTROY_BONDING] = userData;
} else {
- LogDebug("Already requested");
+ LoggerD("Already requested");
UnknownException *error = new UnknownException("Already requested");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
if(mEnabled == true) {
bt_device_info_s *deviceInfo = NULL;
if(bt_adapter_get_bonded_device_info(address.c_str(), &deviceInfo) != BT_ERROR_NONE || deviceInfo == NULL) {
- LogDebug("There is no bonding");
+ LoggerD("There is no bonding");
NotFoundException *error = new NotFoundException("Not found");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
}
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_device_destroy_bond() succeeded");
+ LoggerD("bt_device_destroy_bond() succeeded");
return;
}
case BT_ERROR_INVALID_PARAMETER:
void BluetoothAdapter::registerRFCOMMServiceByUUID(std::string &uuid, std::string &name, MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothCallbackUtil::syncToAsyncServiceCallback(userData, uuid, name);
}
void BluetoothAdapter::connectToServiceByUUID(std::string &remoteAddress, std::string &uuid, Common::MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(!isValidUUID(uuid)) {
- LogError("Wrong UUID");
+ LoggerE("Wrong UUID");
InvalidValuesException *error = new InvalidValuesException("Wrong UUID");
BluetoothCallbackUtil::syncToAsyncErrorCallback(userData, error);
return;
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_socket_connect_rfcomm() succeeded");
+ LoggerD("bt_socket_connect_rfcomm() succeeded");
bt_socket_set_connection_state_changed_cb(onSocketConnected, this);
BluetoothConnReqPtr connReq = new BluetoothConnReq(uuid, userData);
void BluetoothAdapter::returnKnownDevices(Common::MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(mEnabled == true) {
knownDevices = mFoundDevices;
if(bt_adapter_foreach_bonded_device(foreachBondedDevicesCB, this) == BT_ERROR_NONE) {
if(knownDevices.size() > 0) { // There are found devices
- LogDebug("There are found devices");
+ LoggerD("There are found devices");
int num = knownDevices.size();
JSObjectRef devices[num];
for(int i = 0; i < num; i++) {
devices[i] = deviceObj;
}
- LogDebug("invoke successCallback");
+ LoggerD("invoke successCallback");
userData->invokeCallback("success", JSObjectMakeArray(userData->getContext(), num, devices, NULL));
}
else { // There is no found device
- LogDebug("There is no found device");
+ LoggerD("There is no found device");
userData->invokeCallback("success", JSObjectMakeArray(userData->getContext(), 0, NULL, NULL) );
}
}
else {
- LogError("Unknown exception");
+ LoggerE("Unknown exception");
userData->invokeCallback(
"error",
JSWebAPIError::makeJSWebAPIError(userData->getContext(), UnknownException("Unknown exception"))
);
}
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
userData->invokeCallback(
"error",
JSWebAPIError::makeJSWebAPIError(userData->getContext(), ServiceNotAvailableException("Bluetooth device is turned off"))
void BluetoothAdapter::returnDevice(std::string &address, Common::MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(!isValidAddress(address)) {
- LogError("Wrong address");
+ LoggerE("Wrong address");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), NotFoundException("Wrong address")));
return;
}
BluetoothDeviceSharedPtr device(new BluetoothDevice(deviceInfo));
bt_adapter_free_device_info(deviceInfo);
- LogDebug("invoke successCallback");
+ LoggerD("invoke successCallback");
userData->invokeCallback("success", JSBluetoothDevice::createJSObject(userData->getContext(), device));
return;
}
for(iter = mFoundDevices.begin(); iter != mFoundDevices.end(); ++iter) {
BluetoothDeviceSharedPtr foundDevice = *iter;
if(!strcmp(foundDevice->getAddress().c_str(), address.c_str())) {
- LogDebug("Found in mFoundDevices");
+ LoggerD("Found in mFoundDevices");
userData->invokeCallback("success", JSBluetoothDevice::createJSObject(userData->getContext(), foundDevice));
break;
}
}
if(iter == mFoundDevices.end()) {
- LogError("Can't find this device");
+ LoggerE("Can't find this device");
userData->invokeCallback(
"error",
}
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
userData->invokeCallback(
"error",
JSWebAPIError::makeJSWebAPIError(userData->getContext(), ServiceNotAvailableException("Bluetooth device is turned off"))
void BluetoothAdapter::returnRegisteredService(std::string &uuid, std::string &name, Common::MultiCallbackUserDataPtr userData)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if(!isValidUUID(uuid)) {
- LogError("Wrong UUID");
+ LoggerE("Wrong UUID");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), InvalidValuesException("Wrong UUID")));
return;
}
bool isRegistered;
if(bt_adapter_is_service_used(uuid.c_str(), &isRegistered) == BT_ERROR_NONE && isRegistered == true) {
- LogDebug("Already registered");
+ LoggerD("Already registered");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), InvalidValuesException("Already registered")));
return;
}
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_socket_create_rfcomm() succeeded");
+ LoggerD("bt_socket_create_rfcomm() succeeded");
int ret = bt_socket_listen_and_accept_rfcomm(socket, 0);
switch(ret) {
case BT_ERROR_NONE:
{
- LogDebug("bt_socket_listen() succeeded");
+ LoggerD("bt_socket_listen() succeeded");
bt_socket_set_connection_state_changed_cb(onSocketConnected, this);
BluetoothServiceHandlerPtr serviceHandler = new BluetoothServiceHandler(uuid, name, socket);
}
case BT_ERROR_INVALID_PARAMETER:
{
- LogDebug("Invalid value");
+ LoggerD("Invalid value");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), InvalidValuesException("Invalid value")));
break;
}
default:
{
- LogDebug("Unknown exception");
+ LoggerD("Unknown exception");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), UnknownException("Unknown exception")));
}
}
}
case BT_ERROR_INVALID_PARAMETER:
{
- LogDebug("Invalid value");
+ LoggerD("Invalid value");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), InvalidValuesException("Invalid value")));
break;
}
default:
{
- LogDebug("Unknown exception");
+ LoggerD("Unknown exception");
userData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(userData->getContext(), UnknownException("Unknown exception")));
}
}
} else { // Not enabled
- LogError("Bluetooth device is turned off");
+ LoggerE("Bluetooth device is turned off");
userData->invokeCallback(
"error",
JSWebAPIError::makeJSWebAPIError(userData->getContext(), ServiceNotAvailableException("Bluetooth device is turned off"))
namespace Bluetooth {
static Eina_Bool jobCompleteCB(void *userData){
- LogDebug("Entered");
+ LoggerD("Entered");
BluetoothCallbackUserDataPtr data = static_cast<BluetoothCallbackUserDataPtr>(userData);
if(!data) {
- LogWarning("BluetoothCallbackUserDataPtr is NULL");
+ LoggerW("BluetoothCallbackUserDataPtr is NULL");
return false;
}
if(!(data->mUserData)) {
- LogWarning("MulticallbackUserData is NULL");
+ LoggerW("MulticallbackUserData is NULL");
delete data;
return false;
}
switch(data->mCBType) {
case BluetoothCallbackUserData::BT_CB_SUCCESS:
{
- LogDebug("BT_CB_SUCCESS");
+ LoggerD("BT_CB_SUCCESS");
data->mUserData->invokeCallback("success");
break;
}
case BluetoothCallbackUserData::BT_CB_ERROR:
{
- LogDebug("BT_CB_ERROR");
+ LoggerD("BT_CB_ERROR");
data->mUserData->invokeCallback("error", JSWebAPIError::makeJSWebAPIError(data->mUserData->getContext(), *(data->mError)));
break;
}
case BluetoothCallbackUserData::BT_CB_DEVICE:
{
- LogDebug("BT_CB_DEVICE");
+ LoggerD("BT_CB_DEVICE");
BluetoothAdapter::getInstance()->returnDevice(data->mAddress, data->mUserData);
break;
}
case BluetoothCallbackUserData::BT_CB_DEVICES:
{
- LogDebug("BT_CB_DEVICES");
+ LoggerD("BT_CB_DEVICES");
BluetoothAdapter::getInstance()->returnKnownDevices(data->mUserData);
break;
}
case BluetoothCallbackUserData::BT_CB_SERVICE:
{
- LogDebug("BT_CB_SERVICE");
+ LoggerD("BT_CB_SERVICE");
BluetoothAdapter::getInstance()->returnRegisteredService(data->mUUID, data->mName, data->mUserData);
break;
}
default:
{
- LogWarning("Unknown callback type");
+ LoggerW("Unknown callback type");
}
}
BluetoothClass::BluetoothClass(bt_class_s bluetoothClass)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mMajor = BluetoothClassDeviceMajor::getInstance()->getMajorValue(bluetoothClass.major_device_class);
mMinor = BluetoothClassDeviceMinor::getInstance()->getMinorValue(bluetoothClass.minor_device_class);
mServices= BluetoothClassDeviceService::getInstance()->getServiceValues(bluetoothClass.major_service_class_mask);
BluetoothClass::~BluetoothClass()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
unsigned long BluetoothClass::getMajor() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mMajor;
}
unsigned long BluetoothClass::getMinor() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mMinor;
}
JSValueRef BluetoothClass::getServices(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
/*
JSValueRef service = mLocalProperty.getProperty(context, BLUETOOTH_CLASS_SERVICES);
if(service == NULL) {
bool BluetoothClass::hasService(unsigned long service)
{
- LogDebug("Enter");
+ LoggerD("Enter");
for(std::vector<unsigned long>::iterator iter = mServices.begin(); iter != mServices.end(); ++iter) {
if((*iter) == service) {
BluetoothClassDeviceMajor::BluetoothClassDeviceMajor()
{
- LogDebug("Enter");
+ LoggerD("Enter");
mMajorStringMap.insert(std::pair<std::string, unsigned long>("MISC", 0x00));
mMajorStringMap.insert(std::pair<std::string, unsigned long>("COMPUTER", 0x01));
BluetoothClassDeviceMajor::~BluetoothClassDeviceMajor()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
BluetoothClassDeviceMajor* BluetoothClassDeviceMajor::getInstance()
{
- LogDebug("Enter");
+ LoggerD("Enter");
static BluetoothClassDeviceMajor instance;
return &instance;
}
unsigned long BluetoothClassDeviceMajor::getMajorValue(std::string major)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mMajorStringMap.find(major)->second;
}
unsigned long BluetoothClassDeviceMajor::getMajorValue(bt_major_device_class_e major)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mMajorEnumMap.find(major)->second;
}
BluetoothClassDeviceMinor::BluetoothClassDeviceMinor()
{
- LogDebug("Enter");
+ LoggerD("Enter");
mMinorStringMap.insert(std::pair<std::string, unsigned long>("COMPUTER_UNCATEGORIZED", 0x00));
mMinorStringMap.insert(std::pair<std::string, unsigned long>("COMPUTER_DESKTOP", 0x01));
BluetoothClassDeviceMinor::~BluetoothClassDeviceMinor()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
BluetoothClassDeviceMinor* BluetoothClassDeviceMinor::getInstance()
{
- LogDebug("Enter");
+ LoggerD("Enter");
static BluetoothClassDeviceMinor instance;
return &instance;
}
unsigned long BluetoothClassDeviceMinor::getMinorValue(std::string minor)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mMinorStringMap.find(minor)->second;
}
unsigned long BluetoothClassDeviceMinor::getMinorValue(bt_minor_device_class_e minor)
{
- LogDebug("Enter");
+ LoggerD("Enter");
// F/W provides more minor deivce class
std::map<bt_minor_device_class_e, unsigned long>::iterator iter = mMinorEnumMap.find(minor);
BluetoothClassDeviceService::BluetoothClassDeviceService()
{
- LogDebug("Enter");
+ LoggerD("Enter");
mServiceStringMap.insert(std::pair<std::string, unsigned long>("LIMITED_DISCOVERABILITY", 0x0001));
mServiceStringMap.insert(std::pair<std::string, unsigned long>("POSITIONING", 0x0008));
BluetoothClassDeviceService::~BluetoothClassDeviceService()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
BluetoothClassDeviceService* BluetoothClassDeviceService::getInstance()
{
- LogDebug("Enter");
+ LoggerD("Enter");
static BluetoothClassDeviceService instance;
return &instance;
}
unsigned long BluetoothClassDeviceService::getServiceValue(std::string service)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mServiceStringMap.find(service)->second;
}
unsigned long BluetoothClassDeviceService::getServiceValue(bt_major_service_class_e service)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mServiceEnumMap.find(service)->second;
}
std::vector<unsigned long> BluetoothClassDeviceService::getServiceValues(int serviceMask)
{
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<unsigned long> ret;
for(std::map<bt_major_service_class_e, unsigned long>::iterator iter = mServiceEnumMap.begin(); iter != mServiceEnumMap.end(); iter++) {
BluetoothDevice::BluetoothDevice(bt_adapter_device_discovery_info_s *discoveryInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mName = std::string(discoveryInfo->remote_name);
mAddress = std::string(discoveryInfo->remote_address);
BluetoothDevice::BluetoothDevice(bt_device_info_s *deviceInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mName = std::string(deviceInfo->remote_name);
mAddress = std::string(deviceInfo->remote_address);
BluetoothDevice::~BluetoothDevice()
{
- LogDebug("Enter");
+ LoggerD("Enter");
BluetoothAdapter::getInstance()->removeConnReq(mAddress);
}
void BluetoothDevice::updateInfo(bt_device_info_s *deviceInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mName = std::string(deviceInfo->remote_name);
mUUIDs.clear();
std::string BluetoothDevice::getName() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mName;
}
std::string BluetoothDevice::getAddress() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mAddress;
}
JSValueRef BluetoothDevice::getDeviceClass(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
/*
JSValueRef deviceClass = mLocalProperty.getProperty(context, BLUETOOTH_DEVICE_DEVICE_CLASS);
if(deviceClass == NULL) {
bool BluetoothDevice::isBonded() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
bool ret = false;
bt_device_info_s *deviceInfo = NULL;
bool BluetoothDevice::isTrusted() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
bool ret = false;
bt_device_info_s *deviceInfo = NULL;
bool BluetoothDevice::isConnected() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
bool ret = false;
bt_device_info_s *deviceInfo = NULL;
JSValueRef BluetoothDevice::getUUIDs(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
/*
if(isUpdated == true) {
mLocalProperty.setProperty(context, BLUETOOTH_DEVICE_UUIDS, JSUtil::toJSValueRef(context, mUUIDs));
BluetoothServiceHandler::~BluetoothServiceHandler()
{
- LogDebug("Enter");
+ LoggerD("Enter");
if(mIsRegistered) {
BluetoothAdapter::getInstance()->unregisterUUID(mUUID);
if(bt_socket_destroy_rfcomm(mRegisteredSocket) != BT_ERROR_NONE) {
- LogWarning("Already destroyed");
+ LoggerW("Already destroyed");
}
}
}
bool BluetoothServiceHandler::setOnConnect(JSContextRef context, JSObjectRef onConnect)
{
- LogDebug("Enter");
+ LoggerD("Enter");
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
return false;
}
callback->setCallback("onconnect", onConnect);
JSValueRef BluetoothServiceHandler::getOnConnect(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSValueRef onConnect = mLocalProperty.getProperty(context, BLUETOOTH_SERVICE_HANDLER_ONCONNECT);
if(onConnect == NULL) {
- LogDebug("onconnect is null");
+ LoggerD("onconnect is null");
return JSValueMakeNull(context);
}
void BluetoothServiceHandler::unregister(MultiCallbackUserDataPtr userData)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if(BluetoothAdapter::getInstance()->getPowered() == true) {
if(bt_socket_destroy_rfcomm(mRegisteredSocket) == BT_ERROR_NONE) {
BluetoothSocket::BluetoothSocket(bt_socket_connection_s *connection)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mConnectedSocket = connection->socket_fd;
mUUID = std::string(connection->service_uuid);
mIsConnected = true;
BluetoothSocket::~BluetoothSocket()
{
- LogDebug("Enter");
+ LoggerD("Enter");
if(mIsConnected) {
if(bt_socket_disconnect_rfcomm(mConnectedSocket) != BT_ERROR_NONE) {
- LogWarning("Already disconnected");
+ LoggerW("Already disconnected");
}
if(!BluetoothAdapter::getInstance()->closeConnectedSocket(mConnectedSocket)) {
- LogWarning("Already done");
+ LoggerW("Already done");
}
}
}
bool BluetoothSocket::setOnMessage(JSContextRef context, JSObjectRef onMessage)
{
- LogDebug("Enter");
+ LoggerD("Enter");
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
return false;
}
callback->setCallback("onmessage", onMessage);
bool BluetoothSocket::setOnClose(JSContextRef context, JSObjectRef onClose)
{
- LogDebug("Enter");
+ LoggerD("Enter");
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
return false;
}
callback->setCallback("onclose", onClose);
bool BluetoothSocket::setOnError(JSContextRef context, JSObjectRef onError)
{
- LogDebug("Enter");
+ LoggerD("Enter");
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
return false;
}
callback->setCallback("onerror", onError);
std::string BluetoothSocket::getUUID() const
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mUUID;
}
void BluetoothSocket::setConnectionState(bool isConnected)
{
- LogDebug("Enter");
+ LoggerD("Enter");
mIsConnected = isConnected;
}
bool BluetoothSocket::getConnectionState()
{
- LogDebug("Enter");
+ LoggerD("Enter");
return mIsConnected;
}
JSValueRef BluetoothSocket::getPeer(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
/*
JSValueRef peer = mLocalProperty.getProperty(context, BLUETOOTH_SOCKET_PEER);
if(peer == NULL && mPeer != NULL) {
JSValueRef BluetoothSocket::getOnMessage(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSValueRef onMessage = mLocalProperty.getProperty(context, BLUETOOTH_SOCKET_ONMESSAGE);
if(onMessage == NULL) {
- LogDebug("onmessage is null");
+ LoggerD("onmessage is null");
return JSValueMakeNull(context);
}
JSValueRef BluetoothSocket::getOnClose(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSValueRef onClose = mLocalProperty.getProperty(context, BLUETOOTH_SOCKET_ONCLOSE);
if(onClose == NULL) {
- LogDebug("onclose is null");
+ LoggerD("onclose is null");
return JSValueMakeNull(context);
}
JSValueRef BluetoothSocket::getOnError(JSContextRef context)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSValueRef onError = mLocalProperty.getProperty(context, BLUETOOTH_SOCKET_ONERROR);
if(onError == NULL) {
- LogDebug("onerror is null");
+ LoggerD("onerror is null");
return JSValueMakeNull(context);
}
unsigned long BluetoothSocket::writeData(char* data, unsigned long size)
{
- LogDebug("Enter");
+ LoggerD("Enter");
unsigned long ret = 0;
if(bt_socket_send_data(mConnectedSocket, data, static_cast<int>(size)) == BT_ERROR_NONE) {
- LogDebug("bt_socket_send_data() succeeded");
+ LoggerD("bt_socket_send_data() succeeded");
ret = size;
}
else {
void BluetoothSocket::storeRecivedData(char *data, unsigned long size)
{
- LogDebug("Enter");
+ LoggerD("Enter");
for(unsigned long i = 0; i < size; i++) {
mReceivedData.push_back(static_cast<signed char>(data[i]));
std::vector<signed char> BluetoothSocket::readData()
{
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<signed char> result (mReceivedData);
mReceivedData.clear();
void BluetoothSocket::close()
{
- LogDebug("Enter");
+ LoggerD("Enter");
if(!mIsConnected) {
- LogDebug("Already disconnected");
+ LoggerD("Already disconnected");
return;
}
if(bt_socket_disconnect_rfcomm(mConnectedSocket) != BT_ERROR_NONE) {
- LogError("bt_socket_disconnect_rfcomm() failed");
+ LoggerE("bt_socket_disconnect_rfcomm() failed");
throw UnknownException("Unknown error");
}
void JSBluetoothAdapter::initialize(JSContextRef context, JSObjectRef object)
{
// do nothing
- LogDebug("Enter");
+ LoggerD("Enter");
}
void JSBluetoothAdapter::finalize(JSObjectRef object)
{
// do nothing
- LogDebug("Enter");
+ LoggerD("Enter");
}
JSValueRef JSBluetoothAdapter::getProperty(JSContextRef context,
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
if (JSStringIsEqualToUTF8CString(propertyName, BLUETOOTH_ADAPTER_NAME)) {
std::string name = BluetoothAdapter::getInstance()->getName();
- LogDebug("name: " << name);
+ LoggerD("name: " << name);
return JSUtil::toJSValueRef(context, name);
}
else if (JSStringIsEqualToUTF8CString(propertyName, BLUETOOTH_ADAPTER_POWERED)) {
}
else if (JSStringIsEqualToUTF8CString(propertyName, BLUETOOTH_DEVICE_ADDRESS)) {
std::string address = BluetoothAdapter::getInstance()->getAddress();
- LogDebug("address: " << address);
+ LoggerD("address: " << address);
return JSUtil::toJSValueRef(context, address);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed" << err.getMessage().c_str());
+ LoggerW("Getting property is failed" << err.getMessage().c_str());
}
return NULL;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiMultiCallbackUserData");
+ LoggerW("Can't create MultiMultiCallbackUserData");
}
else {
// onstarted
JSValueRef onstartedValue = JSUtil::getProperty(context , successCallback, "onstarted");
if(!JSValueIsUndefined(context, onstartedValue)) {
- LogDebug("There is a onstarted()");
+ LoggerD("There is a onstarted()");
callback->setCallback("onstarted", JSUtil::JSValueToObject(context, onstartedValue));
}
// ondevicefound
JSValueRef ondevicefoundValue = JSUtil::getProperty(context , successCallback, "ondevicefound");
if(!JSValueIsUndefined(context, ondevicefoundValue)) {
- LogDebug("There is a ondevicefound()");
+ LoggerD("There is a ondevicefound()");
callback->setCallback("ondevicefound", JSUtil::JSValueToObject(context, ondevicefoundValue));
}
// ondevicedisappeared
JSValueRef ondevicedisappearedValue = JSUtil::getProperty(context , successCallback, "ondevicedisappeared");
if(!JSValueIsUndefined(context, ondevicedisappearedValue)) {
- LogDebug("There is a ondevicedisappeared()");
+ LoggerD("There is a ondevicedisappeared()");
callback->setCallback("ondevicedisappeared", JSUtil::JSValueToObject(context, ondevicedisappearedValue));
}
// onfinished
JSValueRef onfinishedValue = JSUtil::getProperty(context , successCallback, "onfinished");
if(!JSValueIsUndefined(context, onfinishedValue)) {
- LogDebug("There is a onfinished()");
+ LoggerD("There is a onfinished()");
callback->setCallback("onfinished", JSUtil::JSValueToObject(context, onfinishedValue));
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
void JSBluetoothClass::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter");
+ LoggerD("Enter");
// do nothing
}
return priv->mClass->getServices(context);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
void JSBluetoothClassDeviceMajor::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter");
+ LoggerD("Enter");
// Do nothing
}
void JSBluetoothClassDeviceMajor::finalize(JSObjectRef object)
{
- LogDebug("Enter");
+ LoggerD("Enter");
// Do nothing
}
std::string name = JSUtil::JSStringToString(context, propertyName);
return JSUtil::toJSValueRef(context, BluetoothClassDeviceMajor::getInstance()->getMajorValue(name));
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
void JSBluetoothClassDeviceMinor::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
void JSBluetoothClassDeviceMinor::finalize(JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
JSValueRef JSBluetoothClassDeviceMinor::getProperty(JSContextRef context,
std::string name = JSUtil::JSStringToString(context, propertyName);
return JSUtil::toJSValueRef(context, BluetoothClassDeviceMinor::getInstance()->getMinorValue(name));
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
void JSBluetoothClassDeviceService::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
void JSBluetoothClassDeviceService::finalize(JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
JSValueRef JSBluetoothClassDeviceService::getProperty(JSContextRef context,
std::string name = JSUtil::JSStringToString(context, propertyName);
return JSUtil::toJSValueRef(context, BluetoothClassDeviceService::getInstance()->getServiceValue(name));
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
void JSBluetoothDevice::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter");
+ LoggerD("Enter");
// Do nothing
}
return priv->mDevice->getUUIDs(context);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
JSBluetoothClassDeviceService::createJSObject(context));
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogWarning("Failed to set private data");
+ LoggerW("Failed to set private data");
delete priv;
}
}
else {
- LogWarning("Failed to create private data");
+ LoggerW("Failed to create private data");
}
}
else {
- LogWarning("Private data already exists");
+ LoggerW("Private data already exists");
}
}
JSValueRef JSBluetoothManager::getReadOnlyProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception) {
PropertyBag *priv = static_cast<PropertyBag*>(JSObjectGetPrivate(object));
if(!priv) {
- LogWarning("There is no private data");
+ LoggerW("There is no private data");
return NULL;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
JSObjectRef JSBluetoothServiceHandler::createJSObject(JSContextRef context, BluetoothServiceHandlerPtr service)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return JSObjectMake(context, getClassRef(), static_cast<void*>(service));
}
void JSBluetoothServiceHandler::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
void JSBluetoothServiceHandler::finalize(JSObjectRef object)
{
- LogDebug("Enter");
+ LoggerD("Enter");
BluetoothServiceHandlerPtr priv = static_cast<BluetoothServiceHandlerPtr>(JSObjectGetPrivate(object));
if (priv) {
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
BluetoothServiceHandlerPtr priv = static_cast<BluetoothServiceHandlerPtr>(JSObjectGetPrivate(object));
return priv->getOnConnect(context);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
BluetoothServiceHandlerPtr priv = static_cast<BluetoothServiceHandlerPtr>(JSObjectGetPrivate(object));
}
}
else {
- LogDebug("onconnect() is NULL");
+ LoggerD("onconnect() is NULL");
}
return priv->setOnConnect(context, object);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
MultiCallbackUserDataPtr callback(
new MultiCallbackUserData(GlobalContextManager::getInstance()->getGlobalContext(context)));
if(!callback){
- LogWarning("Can't create MultiCallbackUserData");
+ LoggerW("Can't create MultiCallbackUserData");
}
else {
callback->setCallback("success", successCallback);
void JSBluetoothSocket::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("Enter"); // do nothing
+ LoggerD("Enter"); // do nothing
}
void JSBluetoothSocket::finalize(JSObjectRef object)
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
BluetoothSocketPtr priv = static_cast<BluetoothSocketPtr>(JSObjectGetPrivate(object));
return JSUtil::toJSValueRef(context, priv->getUUID());
}
else if (JSStringIsEqualToUTF8CString(propertyName, BLUETOOTH_SOCKET_STATE)) {
- LogDebug("get state");
+ LoggerD("get state");
std::string state;
if(priv->getConnectionState()) {
state = "OPEN";
else {
state = "CLOSED";
}
- LogDebug("state: " << state);
+ LoggerD("state: " << state);
return JSUtil::toJSValueRef(context, state);
}
else if (JSStringIsEqualToUTF8CString(propertyName, BLUETOOTH_SOCKET_PEER)) {
return priv->getOnError(context);
}
} catch (const BasePlatformException &err) {
- LogWarning("Getting property is failed: " << err.getMessage().c_str());
+ LoggerW("Getting property is failed: " << err.getMessage().c_str());
}
return NULL;
}
}
else {
- LogDebug("onmessage() is NULL");
+ LoggerD("onmessage() is NULL");
}
return priv->setOnMessage(context, object);
}
}
else {
- LogDebug("onclose() is NULL");
+ LoggerD("onclose() is NULL");
}
return priv->setOnClose(context, object);
}
}
else {
- LogDebug("onerror() is NULL");
+ LoggerD("onerror() is NULL");
}
return priv->setOnError(context, object);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
// Access Check
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Bluetooth] on_widget_start_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Bluetooth] on_widget_start_callback (%d)", widgetId);
TIME_TRACER_INIT();
try {
WrtAccessSingleton::Instance().initialize(widgetId);
} catch (...) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Bluetooth] on_widget_stop_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Bluetooth] on_widget_stop_callback (%d)", widgetId);
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Bluetooth");
TIME_TRACER_RELEASE();
try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} catch (...) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void *context)
{
- LogDebug("[Tizen\\Bluetooth] on_frame_load_callback (%p)", context);
+ LoggerD("[Tizen\\Bluetooth] on_frame_load_callback (%p)", context);
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void *context)
{
- LogDebug("[Tizen\\Bluetooth] on_frame_unload_callback (%p)", context);
+ LoggerD("[Tizen\\Bluetooth] on_frame_unload_callback (%p)", context);
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
BluetoothAdapter::getInstance()->unloadFrame(static_cast<JSContextRef>(context));
}
#include "JSBookmarkItem.h"
#include <queue>
#include <Ecore.h>
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <PlatformException.h>
#include <favorites.h>
+#include <Logger.h>
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace DeviceAPI::Common;
namespace DeviceAPI {
namespace Bookmark{
static bool favorites_bookmark_foreach_cb(favorites_bookmark_entry_s *entry, void *user_data) {
- LogDebug("Entered");
+ LoggerD("Entered");
if (user_data) {
BookmarkSearchData *searchData = static_cast<BookmarkSearchData*>(user_data);
int parentId = 0;
else
parentId = BookmarkManager::getInstance()->getRootFolderId();
- LogDebug("parentId : " << parentId);
- LogDebug("m_reculsive : " << searchData->m_reculsive);
- LogDebug("entry title : " << entry->title);
- LogDebug("entry id : " << entry->id);
+ LoggerD("parentId : " << parentId);
+ LoggerD("m_reculsive : " << searchData->m_reculsive);
+ LoggerD("entry title : " << entry->title);
+ LoggerD("entry id : " << entry->id);
if (!(searchData->isAlive) && (entry->id == parentId))
searchData->isAlive = true;
- LogDebug("isAlive : " << searchData->isAlive);
+ LoggerD("isAlive : " << searchData->isAlive);
if ((searchData->m_reculsive) || (entry->folder_id == parentId)) {
- LogDebug("found subitem : " << entry->title);
+ LoggerD("found subitem : " << entry->title);
BookmarkDataPtr bookmark;
if (entry->is_folder)
bookmark = BookmarkDataPtr(new BookmarkData(BOOKMARKFOLDER_TYPE, entry->title, "", entry->id, entry->folder_id));
if (!(searchData->isAlive) || (searchData->m_reculsive) || (parentId == BookmarkManager::getInstance()->getRootFolderId()) || ((searchData->m_bookmark)->m_type == BOOKMARKFOLDER_TYPE))
return true;
} else
- LogDebug("user_data is null");
+ LoggerD("user_data is null");
- LogDebug("stop ");
+ LoggerD("stop ");
return false;
}
static bool favorites_bookmark_parent_search_cb(favorites_bookmark_entry_s *entry, void *user_data) {
if (user_data){
BookmarkParentSearchData *parentSearchData = static_cast<BookmarkParentSearchData *>(user_data);
- LogDebug("entry->id : " << entry->id);
+ LoggerD("entry->id : " << entry->id);
if (entry->id == parentSearchData->m_id) {
parentSearchData->isAlive = true;
} else if (entry->id == parentSearchData->m_parentId){
- LogDebug("Found parent");
+ LoggerD("Found parent");
parentSearchData->isParentAlive = true;
parentSearchData->m_parent = BookmarkDataPtr(new BookmarkData(BOOKMARKFOLDER_TYPE, entry->title, "", entry->id, entry->folder_id));
} else
return true;
if (parentSearchData->isAlive && parentSearchData->isParentAlive) {
- LogDebug("Found parent.Stop.");
+ LoggerD("Found parent.Stop.");
return false;
} else
return true;
}
- LogDebug("user_data is null");
+ LoggerD("user_data is null");
return false;
}
std::vector<BookmarkDataPtr> BookmarkManager::get(BookmarkSearchDataPtr &searchData){
- LogDebug("Entered");
+ LoggerD("Entered");
int count;
std::vector<BookmarkDataPtr> bookmarkArray;
if (favorites_bookmark_get_count(&count) == FAVORITES_ERROR_NONE) {
}
std::vector<BookmarkDataPtr> BookmarkManager::_getCompleteCB(BookmarkSearchDataPtr &searchData){
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<BookmarkDataPtr> bookmarkArray;
//check if searchData->m_bookmark is in db or not
if (searchData->isAlive) {
BookmarkData *parent = searchData->m_bookmark;
for (it=(searchData->m_results).begin(); it!=(searchData->m_results).end(); ++it)
- LogDebug("it->first:"<<it->first << " it->second:" <<(it->second)->m_id);
+ LoggerD("it->first:"<<it->first << " it->second:" <<(it->second)->m_id);
int lastItemId = (((searchData->m_results).rbegin())->second)->m_id;
- LogDebug("end's first:"<<((searchData->m_results).rbegin())->first << "end's second:"<<lastItemId);
+ LoggerD("end's first:"<<((searchData->m_results).rbegin())->first << "end's second:"<<lastItemId);
while (1) {
it = (searchData->m_results).find(parent->m_id);
- LogDebug("it->first:"<<it->first << " parent->m_id:" <<parent->m_id);
+ LoggerD("it->first:"<<it->first << " parent->m_id:" <<parent->m_id);
while (it->first == parent->m_id) {
- LogDebug("it->second:"<<(it->second)->m_id);
+ LoggerD("it->second:"<<(it->second)->m_id);
bookmarkArray.push_back(it->second);
- LogDebug("m_type:"<<(it->second)->m_type);
+ LoggerD("m_type:"<<(it->second)->m_type);
//if it is folder, it will be pushed in folders vector
if ((it->second)->m_type == BOOKMARKFOLDER_TYPE)
folders.push((it->second).get());
if ((it->second)->m_id != lastItemId) {
- LogDebug("not last item");
+ LoggerD("not last item");
it++;
- LogDebug("it->first:"<<it->first << " it->second:" <<(it->second)->m_id);
+ LoggerD("it->first:"<<it->first << " it->second:" <<(it->second)->m_id);
} else
break;
if (folders.size()) {
parent = folders.front();
- LogDebug("parent->m_id:" <<parent->m_id);
+ LoggerD("parent->m_id:" <<parent->m_id);
folders.pop();
} else
break;
} else { // Not found Error because it is not in db
throw NotFoundException("Can't find the parent folder");
}
- LogDebug("Success!");
+ LoggerD("Success!");
return bookmarkArray;
}
int BookmarkManager::add(bookmarkType type, const int parent_id, const std::string& title, const std::string& url) {
- LogDebug("Entered");
+ LoggerD("Entered");
int id = UNDEFINED_ID;
int result = favorites_bookmark_add(title.c_str(), url.c_str(), parent_id, static_cast<int>(type), &id);
if (result == FAVORITES_ERROR_NONE)
}
void BookmarkManager::remove(BookmarkSearchDataPtr &searchData) {
- LogDebug("Entered");
+ LoggerD("Entered");
int result = FAVORITES_ERROR_NONE;
if (searchData->m_bookmark == NULL)
result = favorites_bookmark_delete_all_bookmarks();
}
}
} catch( const NotFoundException& err) {
- LogDebug("Not Found");
+ LoggerD("Not Found");
return;
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <ArgumentValidator.h>
#include "JSBookmarkFolder.h"
#include "BookmarkManager.h"
#include "BookmarkData.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::CommonsJavaScript;
void JSBookmarkFolder::initialize(JSContextRef ctx, JSObjectRef object)
{
- LogDebug("JSBookmarkFolder::initialize()\n");
+ LoggerD("JSBookmarkFolder::initialize()\n");
}
void JSBookmarkFolder::finalize(JSObjectRef object)
{
- LogDebug("JSBookmarkFolder::finalize()\n");
+ LoggerD("JSBookmarkFolder::finalize()\n");
BookmarkData * priv = static_cast<BookmarkData *>(JSObjectGetPrivate(object));
if( priv ){
JSObjectSetPrivate(object, NULL);
}
JSObjectRef JSBookmarkFolder::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
- LogDebug("Enter");
+ LoggerD("Enter");
try{
ArgumentValidator validator(ctx, argumentCount, arguments);
}
JSObjectRef JSBookmarkFolder::createJSObject(JSContextRef context, const std::string &title, const int id, const int parentId) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (title == "")
throw InvalidValuesException("Title is empty");
BookmarkData *priv = new BookmarkData(BOOKMARKFOLDER_TYPE, title, "", id, parentId);
}
#endif
JSValueRef JSBookmarkFolder::getParent(JSContextRef context, JSObjectRef object) {
- LogDebug("Enter");;
+ LoggerD("Enter");;
BookmarkData * priv = static_cast<BookmarkData *>(JSObjectGetPrivate(object));
if (!priv)
throw TypeMismatchException("Private data is null");
- LogDebug("bookmark id:" << priv->m_id);
- LogDebug("bookmark parent id:" << priv->m_parentId);
+ LoggerD("bookmark id:" << priv->m_id);
+ LoggerD("bookmark parent id:" << priv->m_parentId);
if (priv->m_id != UNDEFINED_ID) {
BookmarkParentSearchDataPtr parentSearchData(new BookmarkParentSearchData(priv->m_id, priv->m_parentId));
bool isAlive = BookmarkManager::getInstance()->findParent(parentSearchData);
JSValueRef JSBookmarkFolder::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_BOOKMARKFOLDER_PARENT)) {
#include "JSBookmarkItem.h"
#include "JSBookmarkFolder.h"
#include "BookmarkData.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include <ArgumentValidator.h>
#include <PlatformException.h>
#include <JSWebAPIException.h>
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::CommonsJavaScript;
void JSBookmarkItem::initialize(JSContextRef ctx, JSObjectRef object)
{
- LogDebug("JSBookmarkItem::initialize()");
+ LoggerD("JSBookmarkItem::initialize()");
}
void JSBookmarkItem::finalize(JSObjectRef object)
{
- LogDebug("JSBookmarkItem::finalize()");
+ LoggerD("JSBookmarkItem::finalize()");
BookmarkData *priv = static_cast<BookmarkData *>(JSObjectGetPrivate(object));
if( priv ){
JSObjectSetPrivate(object, NULL);
}
JSObjectRef JSBookmarkItem::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
- LogDebug("JSBookmarkItem::constructor()");
+ LoggerD("JSBookmarkItem::constructor()");
ArgumentValidator validator(ctx, argumentCount, arguments);
try{
std::string title = validator.toString(0);
}
JSObjectRef JSBookmarkItem::createJSObject(JSContextRef context, const std::string &title, const std::string &url) {
- LogDebug("Enter");
+ LoggerD("Enter");
return createJSObject(context, title, url, UNDEFINED_ID, UNDEFINED_ID);
}
JSObjectRef JSBookmarkItem::createJSObject(JSContextRef context, const std::string &title, const std::string &url, const int id, const int parentId) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (title == "")
throw InvalidValuesException("Title is empty");
if (url == "")
#endif
JSValueRef JSBookmarkItem::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
try {
Converter convert(context);
BookmarkData *priv = static_cast<BookmarkData *>(JSObjectGetPrivate(object));
#include <TimeTracer.h>
#include <string>
-#include <dpl/log/log.h>
#include <vector>
-
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::CommonsJavaScript;
}
JSValueRef JSBookmarkManager::get(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_READ_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
BookmarkSearchDataPtr searchData(new BookmarkSearchData(parentFolder,reculsive));
std::vector<BookmarkDataPtr> bookmarkList = BookmarkManager::getInstance()->get(searchData);
unsigned short bookmarksCount = bookmarkList.size();
- LogDebug("count : " << bookmarksCount);
+ LoggerD("count : " << bookmarksCount);
std::vector<JSValueRef> bookmarksArray;
Converter converter(ctx);
for (int i = 0; i < bookmarksCount; i++) {
JSValueRef bookmark;
- LogDebug("bookmarkList["<<i<<"]:" << (bookmarkList[i]->m_title));
+ LoggerD("bookmarkList["<<i<<"]:" << (bookmarkList[i]->m_title));
if (bookmarkList[i]->m_type == BOOKMARKITEM_TYPE)
bookmark = static_cast<JSValueRef>(JSBookmarkItem::createJSObject(ctx, bookmarkList[i]->m_title, bookmarkList[i]->m_url, bookmarkList[i]->m_id, bookmarkList[i]->m_parentId));
else
}
JSValueRef JSBookmarkManager::add(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_WRITE_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
try {
bookmarkobj = validator.toObject(0, JSBookmarkItem::getClassRef());
} catch (const TypeMismatchException& err){
- LogDebug("Bookmark's type is not BookmarkItem");
+ LoggerD("Bookmark's type is not BookmarkItem");
bookmarkobj = validator.toObject(0, JSBookmarkFolder::getClassRef());
}
BookmarkData * bookmark = static_cast<BookmarkData *>(JSObjectGetPrivate(bookmarkobj));
bookmark->m_id = BookmarkManager::getInstance()->add(bookmark->m_type, parentId, bookmark->m_title, bookmark->m_url);
bookmark->m_parentId = parentId;
- LogDebug("bookmark id:" << bookmark->m_id);
- LogDebug("bookmark parent id:" << bookmark->m_parentId);
+ LoggerD("bookmark id:" << bookmark->m_id);
+ LoggerD("bookmark parent id:" << bookmark->m_parentId);
}catch( const BasePlatformException& err){
return JSWebAPIException::throwException(ctx, exception, err);
}
JSValueRef JSBookmarkManager::remove(JSContextRef ctx, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception){
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = BOOKMARK_CHECK_ACCESS(BOOKMARK_FUNCTION_API_WRITE_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, ctx, exception);
try {
bookmarkobj = validator.toObject(0, JSBookmarkItem::getClassRef(), true);
} catch (const TypeMismatchException& err){
- LogDebug("Bookmark's type is not BookmarkItem");
+ LoggerD("Bookmark's type is not BookmarkItem");
bookmarkobj = validator.toObject(0, JSBookmarkFolder::getClassRef(), true);
}
* limitations under the License.
*/
-
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSBookmarkManager.h"
#include "JSBookmarkFolder.h"
#include "JSBookmarkItem.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Bookmark {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Bookmark] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Bookmark] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Bookmark] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Bookmark] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Bookmark");
TIME_TRACER_RELEASE();
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Bookmark] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\Bookmark] on_frame_load_callback (" << context << ")");
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Bookmark] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\Bookmark] on_frame_unload_callback (" << context << ")");
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
)
add_subdir(Common/StandaloneConsole)
-add_subdir(Common/TimeTracer)
IF(ENABLE_TIME_TRACER)
+add_subdir(Common/TimeTracer)
+
SET(LIBS_COMMON
${LIBS_COMMON}
"timetracer"
// limitations under the License.
//
-
#include <calendar2.h>
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include "Calendar.h"
#include "CalendarManager.h"
#include <IFilterVisitor.h>
#include <sstream>
#include <algorithm>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
ThrowMsg(NullPointerException, "Item parameter is NULL.");
}
if (event->getEvent()->getIdIsSet()) {
- LogWarning("Non-null item id.");
+ LoggerW("Non-null item id.");
event->getEvent()->resetId();
}
DPL::ScopedPtr<EventWrapper> eventWrapper(new EventWrapper(event->getEvent(), getType()));
if(getIsUnified()) {
- LogDebug("Set the default calendar id for a unified calendar item.");
+ LoggerD("Set the default calendar id for a unified calendar item.");
event->getEvent()->setCalendarId(DEFAULT_EVENT_CALENDAR_BOOK_ID);
} else {
std::stringstream ss(getId());
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
for(unsigned int i=0; i<event->getEvents()->size(); i++) {
CalendarEventPtr theItem = event->getEvents()->at(i);
if (theItem->getIdIsSet()) {
- LogWarning("Item has index: " << i << ". Resetting it.");
+ LoggerW("Item has index: " << i << ". Resetting it.");
theItem->resetId();
}
DPL::ScopedPtr<EventWrapper> eventWrapper(new EventWrapper(theItem, getType()));
if(getIsUnified()) {
- LogDebug("Set the default calendar id for a unified calendar item.");
+ LoggerD("Set the default calendar id for a unified calendar item.");
theItem->setCalendarId(DEFAULT_EVENT_CALENDAR_BOOK_ID);
} else {
std::stringstream ss(getId());
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't insert the item list: "<<ret);
} else {
- LogDebug("Add records requst done with count: "<<count);
+ LoggerD("Add records requst done with count: "<<count);
}
for(int i=0; i<count; i++) {
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
DPL::ScopedPtr<EventWrapper> eventWrapper(new EventWrapper(theItem, getType()));
eventWrapper->convertAbstractEventToPlatformEvent(true);
- if ( event->getUpdateAllInstances() || 0>=theItem->getRecurrenceRule()->getFrequency()) {
+ if ( event->getUpdateAllInstances() || 0>=theItem->getRecurrenceRule()->getFrequency() || UNDEFINED_TIME==theItem->getRecurrenceId()) {
// Platform detects the detached events and uptates all instances.
eventWrapper->saveEvent();
} else {
- LogDebug("Update the exdate for a recurring parent event and add a new child event.");
+ LoggerD("Update the exdate for a recurring parent event and add a new child event.");
// First update the parent event.
EventRecurrenceRulePtr rrule = theItem->getRecurrenceRule();
if(ret!=CALENDAR_ERROR_NONE) {
ThrowMsg(PlatformException, "Can't update the exdate: "<<ret);
} else {
- LogDebug("Set the exdate for the parent event: "<<exdate);
+ LoggerD("Set the exdate for the parent event: "<<exdate);
}
// Don't set the recurrence id for the parent event.
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't add the detached item to the list: "<<ret);
} else {
- LogDebug("Added the detached event to the update list: "<<thisEvent->getId());
+ LoggerD("Added the detached event to the update list: "<<thisEvent->getId());
}
- } else if (event->getUpdateAllInstances() || 0>=thisEvent->getRecurrenceRule()->getFrequency()) {
+ } else if (event->getUpdateAllInstances() || 0>=thisEvent->getRecurrenceRule()->getFrequency() || UNDEFINED_TIME==thisEvent->getRecurrenceId()) {
// Platform detects the detached events and uptates all instances.
- record = NULL;
+ record = NULL;
ret = calendar_record_clone(eventWrapper->getPlatformEvent(), &record);
- if(CALENDAR_ERROR_NONE!=ret) {
- ThrowMsg(PlatformException, "Clonning failed: "<<ret);
- }
+ if(CALENDAR_ERROR_NONE!=ret) {
+ ThrowMsg(PlatformException, "Clonning failed: "<<ret);
+ }
- ret = calendar_list_add(listForUpdate, record);
- if (CALENDAR_ERROR_NONE != ret) {
+ ret = calendar_list_add(listForUpdate, record);
+ if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't add the item to the list: "<<ret);
}
} else {
- LogDebug("Update the exdate for a recurring parent event and add a new child event.");
+ LoggerD("Update the exdate for a recurring parent event and add a new child event.");
DPL::ScopedPtr<EventWrapper> eventWrapperChild(new EventWrapper(thisEvent, getType()));
eventWrapperChild->convertAbstractEventToPlatformEvent(true);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Cannot set event recurrence id: "<<ret);
} else {
- LogDebug("Saved the rid for the child: "<<thisEvent->getRecurrenceId());
+ LoggerD("Saved the rid for the child: "<<thisEvent->getRecurrenceId());
}
ret = calendar_record_set_int(eventWrapperChild->getPlatformEvent(), _calendar_event.original_event_id, thisEvent->getId());
if(ret!=CALENDAR_ERROR_NONE) {
ThrowMsg(PlatformException, "Can't update the exdate: "<<ret);
} else {
- LogDebug("Set the exdate for the parent event: "<<exdate);
+ LoggerD("Set the exdate for the parent event: "<<exdate);
}
record = NULL;
if(CALENDAR_ERROR_NONE!=ret){
ThrowMsg(PlatformException, "Getting list count failed: "<<ret);
} else {
- LogDebug("Final list count for add: "<<count);
+ LoggerD("Final list count for add: "<<count);
}
if(count>0) {
ret = calendar_db_insert_records(listForAdd, NULL, NULL);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't insert the item list: "<<ret);
} else {
- LogDebug("Add records requst done for update batch operation.");
+ LoggerD("Add records requst done for update batch operation.");
}
}
if(CALENDAR_ERROR_NONE!=ret){
ThrowMsg(PlatformException, "Getting list count failed: "<<ret);
} else {
- LogDebug("Final list count for update: "<<count);
+ LoggerD("Final list count for update: "<<count);
}
if(count>0) {
ret = calendar_db_update_records(listForUpdate);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't update the item list: "<<ret);
} else {
- LogDebug("Update records requst done for update batch operation.");
+ LoggerD("Update records requst done for update batch operation.");
}
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
long long int rid;
ss>>rid;
- LogDebug("id: " << id << ", rid: " << rid);
+ LoggerD("id: " << id << ", rid: " << rid);
eventWrapper->loadEvent(id);
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
eventWrapper->getAbstractEvent()->setRecurrenceId(rid);
// If the recurrenceId is set, delete the instance of recurring event only.
- LogDebug("id to delete: " << id << ", rid: " << rid << ", type: " << getType());
+ LoggerD("id to delete: " << id << ", rid: " << rid << ", type: " << getType());
dataType = NULL;
if(getType() == CalendarEvent::TASK_TYPE) {
ThrowMsg(PlatformException, "Can't get the parent id: "<<ret);
}
listForDetachedParent.push_back(parentId);
- LogDebug("Added the detached event id: "<<id<<", parent id: "<<parentId);
+ LoggerD("Added the detached event id: "<<id<<", parent id: "<<parentId);
} else {
EventRecurrenceRulePtr rrule = eventWrapper->getAbstractEvent()->getRecurrenceRule();
(*rrule->getExceptions()).push_back(rid);
if(ret!=CALENDAR_ERROR_NONE) {
ThrowMsg(PlatformException, "Can't delete the instance: "<<ret);
} else {
- LogDebug("Set the exdate: "<<exdate);
+ LoggerD("Set the exdate: "<<exdate);
}
record = NULL;
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't add the item to the list: "<<ret);
}
- LogDebug("Calendar item instance added for update.");
+ LoggerD("Calendar item instance added for update.");
}
}
count = -1;
ret = calendar_list_get_count(listForUpdate, &count);
if(CALENDAR_ERROR_NONE!=ret){
- LogWarning("Getting list count for update failed: "<<ret);
+ LoggerW("Getting list count for update failed: "<<ret);
} else {
- LogDebug("Final list count for update: "<<count);
+ LoggerD("Final list count for update: "<<count);
}
if(count>0) {
ret = calendar_db_update_records(listForUpdate);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't update the item list: "<<ret);
} else {
- LogDebug("Update records requst done for update batch operation.");
+ LoggerD("Update records requst done for update batch operation.");
}
}
// Merge the detached event id list if the parent is not included in the delete list.
count = listForDetached.size();
- LogDebug("Number of detached events: "<<count);
+ LoggerD("Number of detached events: "<<count);
while(count--) {
std::vector<int>::iterator it;
it = std::find(listForDelete.begin(), listForDelete.end(), listForDetachedParent.at(count));
if(listForDelete.end()==it) {
listForDelete.push_back(listForDetached.at(count));
- LogDebug("Add the detached event id to the delete list: "<<listForDetached.at(count));
+ LoggerD("Add the detached event id to the delete list: "<<listForDetached.at(count));
} else {
- LogDebug("The parent id is already included to the delete list: "<<listForDetachedParent.at(count));
+ LoggerD("The parent id is already included to the delete list: "<<listForDetachedParent.at(count));
}
}
count = listForDelete.size();
- LogDebug("Final list count for deletion: "<<count);
+ LoggerD("Final list count for deletion: "<<count);
if(count>0) {
ret = calendar_db_delete_records(dataType, &listForDelete[0], count);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't delete the records: "<<ret);
} else {
- LogDebug("Delete records requst done for delete batch operation.");
+ LoggerD("Delete records requst done for delete batch operation.");
}
}
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
CalendarFilterPtr calendarFilter( new CalendarFilter() );
calendarFilter->setType(getType());
- LogDebug("Default filter created with type "<<getType());
+ LoggerD("Default filter created with type "<<getType());
DeviceAPI::Tizen::IFilterVisitorPtr filterTraversal = DPL::StaticPointerCast<DeviceAPI::Tizen::IFilterVisitor>(calendarFilter);
if(!success) {
ThrowMsg(InvalidArgumentException, "Invalid filter arguments.");
} else {
- LogDebug("Filter validation has passed.");
+ LoggerD("Filter validation has passed.");
}
genericFilter->travel(filterTraversal, 0);
if(getIsUnified()) {
- LogDebug("Set all calendars flag for a unified calendar.");
+ LoggerD("Set all calendars flag for a unified calendar.");
calendarFilter->setCalendarId(CALENDAR_BOOK_FILTER_ALL, true);
} else {
- LogDebug("Set additional calendar id: "<<calendarId);
+ LoggerD("Set additional calendar id: "<<calendarId);
calendarFilter->setCalendarId(calendarId, true);
}
} else {
if(getIsUnified()) {
- LogDebug("Set all calendars flag for a unified calendar.");
+ LoggerD("Set all calendars flag for a unified calendar.");
calendarFilter->setCalendarId(CALENDAR_BOOK_FILTER_ALL, false);
} else {
- LogDebug("Set calendar id: "<<calendarId);
+ LoggerD("Set calendar id: "<<calendarId);
calendarFilter->setCalendarId(calendarId, false);
}
}
calendarFilter->executeQuery();
- LogDebug("Return the query result after conversion.");
+ LoggerD("Return the query result after conversion.");
calendar_list_h resultList = calendarFilter->getResultRecordList();
int ret;
calendar_list_next(resultList);
}
- LogDebug("Length of found items: "<<event->getEvents()->size());
+ LoggerD("Length of found items: "<<event->getEvents()->size());
// Handle the recurring event range filter corner case.
int id = -1, parentCount = -1;
bool found = false;
resultList = calendarFilter->getNormalInstanceResultRecordList();
count = calendarFilter->getNormalInstanceResultRecordCount();
- LogDebug("Number of found normal instances: "<<count);
+ LoggerD("Number of found normal instances: "<<count);
currentRecord = NULL;
calendar_list_first(resultList);
found = false;
while(parentCount--) {
if(id==event->getEvents()->at(parentCount)->getId()) {
- LogDebug("Found the id: "<<id<<", thus skip this.");
+ LoggerD("Found the id: "<<id<<", thus skip this.");
found = true;
break;
}
}
if(false==found) {
- LogDebug("Add the normal instance parent: "<<id);
+ LoggerD("Add the normal instance parent: "<<id);
DPL::ScopedPtr<EventWrapper> eventWrapper(new EventWrapper(getType()));
eventWrapper->loadEvent(id);
event->addEvent(eventWrapper->convertPlatformEventToAbstractEvent());
calendar_list_next(resultList);
}
- LogDebug("Length of found items including normal instances: "<<event->getEvents()->size());
+ LoggerD("Length of found items including normal instances: "<<event->getEvents()->size());
resultList = calendarFilter->getAlldayInstanceResultRecordList();
count = calendarFilter->getAlldayInstanceResultRecordCount();
- LogDebug("Number of found allday instances: "<<count);
+ LoggerD("Number of found allday instances: "<<count);
currentRecord = NULL;
calendar_list_first(resultList);
found = false;
while(parentCount--) {
if(id==event->getEvents()->at(parentCount)->getId()) {
- LogDebug("Found the id: "<<id<<", thus skip this.");
+ LoggerD("Found the id: "<<id<<", thus skip this.");
found = true;
break;
}
}
if(false==found) {
- LogDebug("Add the allday instance parent: "<<id);
+ LoggerD("Add the allday instance parent: "<<id);
DPL::ScopedPtr<EventWrapper> eventWrapper(new EventWrapper(getType()));
eventWrapper->loadEvent(id);
event->addEvent(eventWrapper->convertPlatformEventToAbstractEvent());
calendar_list_next(resultList);
}
- LogDebug("Length of found items including allday instances: "<<event->getEvents()->size());
+ LoggerD("Length of found items including allday instances: "<<event->getEvents()->size());
event->setResult(true);
}
Catch (InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
}
Catch(PlatformException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
- LogDebug("eventString: " + event->getEventString());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerD("eventString: " + event->getEventString());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
- LogDebug("eventString: " + event->getEventString());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerD("eventString: " + event->getEventString());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
static void eventChangedCb(const char *view_uri, void *user_data)
{
- LogDebug("Items change cb with view_uri: "<<view_uri);
+ LoggerD("Items change cb with view_uri: "<<view_uri);
OnEventsChangedPtr eventPtr(new OnEventsChanged());
calendar_list_h list = NULL;
Try
{
if (user_data == NULL) {
- LogDebug("user_data is NULL.");
+ LoggerD("user_data is NULL.");
return;
}
if(thisCalendar->getIsUnified()) {
- LogDebug("Set the all calendar id for a unified calendar.");
+ LoggerD("Set the all calendar id for a unified calendar.");
calendarId = CALENDAR_BOOK_FILTER_ALL;
} else {
std::stringstream ss(thisCalendar->getId());
ss>>calendarId;
}
- LogDebug("Getting items with calendar id: "<<calendarId<<", version: "<<thisCalendar->getLastChangedVersion()<<", type: "<<thisCalendar->getType());
+ LoggerD("Getting items with calendar id: "<<calendarId<<", version: "<<thisCalendar->getLastChangedVersion()<<", type: "<<thisCalendar->getType());
if (CalendarEvent::TASK_TYPE==thisCalendar->getType()) {
ret = calendar_db_get_changes_by_version(_calendar_todo._uri, calendarId, thisCalendar->getLastChangedVersion(), &list, &updatedVersion);
} else {
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get the item count: "<<ret);
} else {
- LogDebug("Item count: "<<count);
+ LoggerD("Item count: "<<count);
}
calendar_list_first(list);
ThrowMsg(PlatformException, "Can't get updated info modified status: "<<ret);
}
- LogDebug("id "<<id<<", type "<<type);
+ LoggerD("id "<<id<<", type "<<type);
if ( CALENDAR_EVENT_MODIFIED_STATUS_INSERTED==type ) {
eventPtr->setStatus(OnEventsChanged::ON_ADD);
} else if ( CALENDAR_EVENT_MODIFIED_STATUS_UPDATED==type ) {
} else if ( CALENDAR_EVENT_MODIFIED_STATUS_DELETED==type ) {
eventPtr->setStatus(OnEventsChanged::ON_DELETE);
} else {
- LogWarning("Wrong change type.");
+ LoggerW("Wrong change type.");
calendar_list_next(list);
continue;
}
Try {
eventWrapper->loadEvent(id);
} Catch (NotFoundException){
- LogDebug("Handling deleted event with index: "<<id);
+ LoggerD("Handling deleted event with index: "<<id);
}
eventPtr->addEvent(eventWrapper->getAbstractEvent());
}
thisCalendar->setLastChangedVersion(updatedVersion);
- LogDebug("Last change fetch version: "<<thisCalendar->getLastChangedVersion());
+ LoggerD("Last change fetch version: "<<thisCalendar->getLastChangedVersion());
eventPtr->setResult(true);
eventPtr->setCalendarType(thisCalendar->getType());
if( eventPtr->getEventList()->size() > 0 ) {
thisCalendar->m_changeEmitters.emit(eventPtr);
} else {
- LogDebug("No actual changes. Skip signal emission.");
+ LoggerD("No actual changes. Skip signal emission.");
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
if( list ) {
ThrowMsg(PlatformException, "Can't get version: "<<ret);
} else {
setLastChangedVersion(version);
- LogDebug("Last change fetch version: "<<getLastChangedVersion());
+ LoggerD("Last change fetch version: "<<getLastChangedVersion());
}
}
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
if( CALENDAR_ERROR_NONE!=calendar_db_remove_changed_cb(dataType, eventChangedCb, this) ) {
ThrowMsg(PlatformException, "Can't remove change cb.");
} else {
- LogDebug("Platform watch cleared successfully.");
+ LoggerD("Platform watch cleared successfully.");
}
}
event->setResult(true);
} else {
- LogDebug("Wrong watch Id.");
+ LoggerD("Wrong watch Id.");
event->setResult(false);
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get the item count: "<<ret);
} else {
- LogDebug("Item count: "<<count<<", isAllDay: "<<isAllDay);
+ LoggerD("Item count: "<<count<<", isAllDay: "<<isAllDay);
}
calendar_list_first(list);
ThrowMsg(PlatformException, "Can't get current record end time: "<<ret);
}
- LogDebug("Found a valid event instance with rid: "<<recurringEventWrapper->getAbstractEvent()->getRecurrenceId());
+ LoggerD("Found a valid event instance with rid: "<<recurringEventWrapper->getAbstractEvent()->getRecurrenceId());
event->addExpandedEvent(recurringEventWrapper->getAbstractEvent());
} else {
- LogDebug("Skip unmatched instance with event_id: "<<currentRecordIndex<<" and parent id: "<<calEvent->getId());
+ LoggerD("Skip unmatched instance with event_id: "<<currentRecordIndex<<" and parent id: "<<calEvent->getId());
}
calendar_list_next(list);
}
- LogDebug("Length of expanded events from parent: "<<event->getExpandedEventList()->size());
+ LoggerD("Length of expanded events from parent: "<<event->getExpandedEventList()->size());
if(query) {
calendar_query_destroy(query);
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get the item count: "<<ret);
} else {
- LogDebug("Item count: "<<count);
+ LoggerD("Item count: "<<count);
}
calendar_list_first(list);
}
if (st.time.utime>=startDate && et.time.utime<=endDate) {
- LogDebug("Found a valid detached event: "<<st.time.utime);
+ LoggerD("Found a valid detached event: "<<st.time.utime);
DPL::ScopedPtr<EventWrapper> detachedEventWrapper(new EventWrapper(getType()));
detachedEventWrapper->loadEvent(currentRecordIndex);
calendar_list_next(list);
}
- LogDebug("Length of total expanded events: "<<event->getExpandedEventList()->size());
+ LoggerD("Length of total expanded events: "<<event->getExpandedEventList()->size());
event->setResult(true);
}
Catch (InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSCalendarEvent.h"
#include <DurationProperties.h>
#include <JSSimpleCoordinates.h>
#include <ContactConverter.h>
-
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
{
StringArrayPtr result = StringArrayPtr(new StringArray());
if(!JSIsArrayValue(m_context, jsValue)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid string array type.");
}
{
NumberArrayPtr result = NumberArrayPtr(new NumberArray());
if(!JSIsArrayValue(m_context, jsValue)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid number array type.");
}
{
NumberArrayPtr result = NumberArrayPtr(new NumberArray());
if(!JSIsArrayValue(m_context, jsValue)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid TZDate array type.");
}
EventAttendeeListPtr CalendarConverter::toVectorOfAttendeesFromDictionary(JSValueRef attendees)
{
if(!JSIsArrayValue(m_context, attendees)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
EventAttendeeListPtr result(new EventAttendeeList());
JSObjectRef objArg = toJSObjectRef(attendees);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
result->push_back(toAttendee(element));
EventAttendeeListPtr CalendarConverter::toVectorOfAttendeesFromReference(JSValueRef attendees)
{
if(!JSIsArrayValue(m_context, attendees)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
EventAttendeeListPtr result(new EventAttendeeList());
JSObjectRef objArg = toJSObjectRef(attendees);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
if (JSValueIsObjectOfClass(m_context, element, JSCalendarAttendee::getClassRef())) {
result->push_back(JSCalendarAttendee::getPrivateObject(JSValueToObject(m_context, element, NULL)));
} else {
- LogDebug("Invalid attendee type. Skip this with index: "<<i);
+ LoggerD("Invalid attendee type. Skip this with index: "<<i);
continue;
}
}
EventAlarmListPtr CalendarConverter::toVectorOfEventAlarmsFromDictionary(JSValueRef alarms)
{
if(!JSIsArrayValue(m_context, alarms)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
EventAlarmListPtr result(new EventAlarmList());
JSObjectRef objArg = toJSObjectRef(alarms);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
result->push_back(toEventAlarm(element));
EventAlarmListPtr CalendarConverter::toVectorOfEventAlarmsFromReference(JSValueRef alarms)
{
if(!JSIsArrayValue(m_context, alarms)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
EventAlarmListPtr result(new EventAlarmList());
JSObjectRef objArg = toJSObjectRef(alarms);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
if (JSValueIsObjectOfClass(m_context, element, JSCalendarAlarm::getClassRef())) {
result->push_back(JSCalendarAlarm::getPrivateObject(JSValueToObject(m_context, element, NULL)));
} else {
- LogDebug("Invalid alarm type. Skip this with index: "<<i);
+ LoggerD("Invalid alarm type. Skip this with index: "<<i);
continue;
}
}
JSObjectRef arg = toJSObjectRef(value);
if(updateMode) {
- LogDebug("Update mode.");
+ LoggerD("Update mode.");
CalendarEventPtr resultPtr(new CalendarEvent());
result = resultPtr;
result->setRecurrenceId(oldItem->getRecurrenceId());
result->setCalendarType(oldItem->getCalendarType());
} else {
- LogDebug("Constructor mode.");
+ LoggerD("Constructor mode.");
CalendarEventPtr resultPtr(new CalendarEvent());
result = resultPtr;
}
if (!JSValueIsUndefined(m_context, startTimeData) && !JSValueIsNull(m_context, startTimeData)) {
result->setStartTime((long long int) (timeUtilConverter.getTimeInMilliseconds(startTimeData)/1000));
result->setTimeZone(timeUtilConverter.getPropertiesInTZDate(startTimeData).timezone);
- LogInfo("start time converted from TZDate: "<<result->getStartTime()<<", time zone: "<<result->getTimeZone());
+ LoggerI("start time converted from TZDate: "<<result->getStartTime()<<", time zone: "<<result->getTimeZone());
} else {
- LogDebug("Start time undefined.");
+ LoggerD("Start time undefined.");
}
if (!JSValueIsUndefined(m_context, durationData) && !JSValueIsNull(m_context, durationData)) {
long long length = timeUtilConverter.getDurationLength(durationData);
int unit = timeUtilConverter.getDurationUnit(durationData);
- LogDebug("duration length: "<<length<<", unit "<<unit);
+ LoggerD("duration length: "<<length<<", unit "<<unit);
if( MSECS_UNIT==unit ) {
result->setEndTime(result->getStartTime() + length/1000);
} else if( SECONDS_UNIT==unit ) {
if (!JSValueIsUndefined(m_context, progressData)) {
result->setProgress(toInt(progressData));
}
- LogDebug("timezone: "<<result->getTimeZone());
+ LoggerD("timezone: "<<result->getTimeZone());
return result;
}
CalendarEventListPtr CalendarConverter::toVectorOfItems(JSValueRef items)
{
if(!JSIsArrayValue(m_context, items)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
CalendarEventListPtr result(new CalendarEventList());
JSObjectRef objArg = toJSObjectRef(items);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
if (JSValueIsObjectOfClass(m_context, element, JSCalendarEvent::getClassRef())) {
JSObjectRef arg = JSValueToObject(m_context, element, NULL);
result->push_back(JSCalendarTask::getPrivateObject(arg));
} else {
- LogDebug("Invalid item type. Skip this with index: "<<i);
+ LoggerD("Invalid item type. Skip this with index: "<<i);
continue;
}
}
CalendarEventListPtr CalendarConverter::toVectorOfItemsFromDictionary(JSValueRef items)
{
if(!JSIsArrayValue(m_context, items)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
CalendarEventListPtr result(new CalendarEventList());
JSObjectRef objArg = toJSObjectRef(items);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
result->push_back(toItem(JSGetArrayElement(m_context, objArg, i), true));
}
EventIdListPtr CalendarConverter::toVectorOfEventIds(JSValueRef eventIds)
{
if(!JSIsArrayValue(m_context, eventIds)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
EventIdListPtr result(new EventIdList());
JSObjectRef objArg = toJSObjectRef(eventIds);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
idPtr->setCalendarType(CalendarEvent::EVENT_TYPE);
result->push_back(idPtr);
} else {
- LogDebug("Invalid event id type. Skip this index: "<<i);
+ LoggerD("Invalid event id type. Skip this index: "<<i);
continue;
}
}
std::vector<long long int> CalendarConverter::toVectorOfTimeFromTZDate(JSValueRef dates)
{
if(!JSIsArrayValue(m_context, dates)) {
- LogWarning("JSValue is not an array.");
+ LoggerW("JSValue is not an array.");
ThrowMsg(ConversionException, "Invalid array type.");
}
TimeUtilConverter converter(m_context);
JSObjectRef objArg = toJSObjectRef(dates);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
result.push_back((long long int) (converter.getTimeInMilliseconds(element)/1000));
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "CalendarEvent.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
CalendarEvent::CalendarEvent(const CalendarEvent &original)
{
- LogDebug("Copy constructor called.");
+ LoggerD("Copy constructor called.");
m_id = original.getId();
m_parentId = original.getParentId();
m_status = original.getStatus();
- LogDebug("Copying alarms...");
+ LoggerD("Copying alarms...");
EventAlarmListPtr alarmsPtr( new EventAlarmList() );
m_alarms = alarmsPtr;
for( unsigned int i=0; i<original.getAlarms()->size(); i++) {
m_uid = original.getUId();
m_recurrenceId = original.getRecurrenceId();
- LogDebug("Copying attendees...");
+ LoggerD("Copying attendees...");
EventAttendeeListPtr attendeesPtr( new EventAttendeeList() );
m_attendees = attendeesPtr;
for( unsigned int i=0; i<original.getAttendees()->size(); i++) {
m_progress = original.getProgress();
m_calendarType = original.getCalendarType();
- LogDebug("Copying done.");
+ LoggerD("Copying done.");
}
CalendarEvent::~CalendarEvent()
{
if(m_categoriesJSRef) {
- LogDebug("Unprotect JS categories.");
+ LoggerD("Unprotect JS categories.");
JSValueUnprotect(m_context, m_categoriesJSRef);
}
}
std::stringstream ss;
ss<<value;
m_uid = ss.str();
- LogDebug("m_id: "<<m_id<<", m_uid: "<<m_uid);
+ LoggerD("m_id: "<<m_id<<", m_uid: "<<m_uid);
}
void CalendarEvent::resetId()
void CalendarEvent::display() const
{
- LogDebug("m_id " << m_id);
- LogDebug("m_parentId " << m_parentId);
- LogDebug("m_calendarId " << m_calendarId);
- LogDebug("m_calendarType " << m_calendarType);
- LogDebug("m_description " << m_description);
- LogDebug("m_subject " << m_subject);
-
- LogDebug("m_startTime " << m_startTime);
-
- LogDebug("m_endTime " << m_endTime);
- LogDebug("m_location " << m_location);
- LogDebug("m_recurrence " << m_recurrence);
- LogDebug("m_status " << m_status);
- LogDebug("m_isAllDay " << m_isAllDay);
- LogDebug("m_organizer " << m_organizer);
- LogDebug("m_lastModifiedDate " << m_lastModifiedDate);
- LogDebug("m_visibility " << m_visibility);
- LogDebug("m_availability " << m_availability);
+ LoggerD("m_id " << m_id);
+ LoggerD("m_parentId " << m_parentId);
+ LoggerD("m_calendarId " << m_calendarId);
+ LoggerD("m_calendarType " << m_calendarType);
+ LoggerD("m_description " << m_description);
+ LoggerD("m_subject " << m_subject);
+
+ LoggerD("m_startTime " << m_startTime);
+
+ LoggerD("m_endTime " << m_endTime);
+ LoggerD("m_location " << m_location);
+ LoggerD("m_recurrence " << m_recurrence);
+ LoggerD("m_status " << m_status);
+ LoggerD("m_isAllDay " << m_isAllDay);
+ LoggerD("m_organizer " << m_organizer);
+ LoggerD("m_lastModifiedDate " << m_lastModifiedDate);
+ LoggerD("m_visibility " << m_visibility);
+ LoggerD("m_availability " << m_availability);
if(m_recurrence->getFrequency()!=EventRecurrenceRule::NO_RECURRENCE) {
- LogDebug("recurrence frequency " << m_recurrence->getFrequency());
- LogDebug("recurrence interval " << m_recurrence->getInterval());
- LogDebug("recurrence recurrenceCount " << m_recurrence->getOccurrenceCount());
- LogDebug("recurrence endDate " << m_recurrence->getEndDate());
+ LoggerD("recurrence frequency " << m_recurrence->getFrequency());
+ LoggerD("recurrence interval " << m_recurrence->getInterval());
+ LoggerD("recurrence recurrenceCount " << m_recurrence->getOccurrenceCount());
+ LoggerD("recurrence endDate " << m_recurrence->getEndDate());
}
}
bool CalendarEvent::validate() const
{
- LogInfo("Nothing to validate.");
+ LoggerI("Nothing to validate.");
return true;
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include "CalendarFilter.h"
#include <Commons/Exception.h>
-#include <calendar2.h>
-#include <map>
#include <sstream>
-
#include "CalendarUtility.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
CalendarFilter::~CalendarFilter()
{
- LogDebug("Clear internal structs for filters.");
+ LoggerD("Clear internal structs for filters.");
if(m_query) {
calendar_query_destroy(m_query);
}
void CalendarFilter::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth)
{
- LogDebug("Composite type: "<<type);
+ LoggerD("Composite type: "<<type);
if(type == DeviceAPI::Tizen::UNION_FILTER) {
calendar_filter_add_operator(m_filter, CALENDAR_FILTER_OPERATOR_OR);
calendar_filter_add_operator(m_normalInstanceFilter, CALENDAR_FILTER_OPERATOR_OR);
void CalendarFilter::visitAttribute(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& matchValue, int depth)
{
if(NULL==matchValue) {
- LogWarning("Empty match value.");
+ LoggerW("Empty match value.");
return;
}
- LogDebug("attrName: "<<attrName<<", value string: "<<matchValue->toString()<<", matchFlag: "<<matchFlag<<", depth:"<<depth);
+ LoggerD("attrName: "<<attrName<<", value string: "<<matchValue->toString()<<", matchFlag: "<<matchFlag<<", depth:"<<depth);
calendar_match_str_flag_e strMatchFlag = CALENDAR_MATCH_EXACTLY;
calendar_match_int_flag_e intMatchFlag = CALENDAR_MATCH_EQUAL;
}else if( DeviceAPI::Tizen::MATCH_EXISTS==matchFlag) {
strMatchFlag = CALENDAR_MATCH_EXISTS;
} else {
- LogWarning("Invalid matchFlag!");
+ LoggerW("Invalid matchFlag!");
}
if(CALENDAR_FILTER_ATTRIBUTE_VISIBILITY==attrName ||
calendar_filter_add_int(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], intMatchFlag, value);
calendar_filter_add_int(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], intMatchFlag, value);
}
- LogDebug("Added int filter with value: "<<value);
+ LoggerD("Added int filter with value: "<<value);
} else if(CALENDAR_FILTER_ATTRIBUTE_ID_UID==attrName ||
CALENDAR_FILTER_ATTRIBUTE_ID==attrName) {
int id;
calendar_filter_add_operator(m_alldayInstanceFilter, CALENDAR_FILTER_OPERATOR_OR);
calendar_filter_add_int(m_alldayInstanceFilter, _calendar_instance_allday_calendar_book.original_event_id, CALENDAR_MATCH_EQUAL, id);
}
- LogDebug("Added int filter with id: "<<id);
+ LoggerD("Added int filter with id: "<<id);
} else if(CALENDAR_FILTER_ATTRIBUTE_LAST_MODIFIED_DATE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_COMPLETED_DATE==attrName) {
long long int time = getTimeTFromTZDateAny(matchValue);
calendar_filter_add_lli(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], intMatchFlag, time);
calendar_filter_add_lli(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], intMatchFlag, time);
}
- LogDebug("Added lli filter with value: "<<time);
+ LoggerD("Added lli filter with value: "<<time);
} else if(CALENDAR_FILTER_ATTRIBUTE_DESCRIPTION==attrName ||
CALENDAR_FILTER_ATTRIBUTE_SUMMARY==attrName ||
CALENDAR_FILTER_ATTRIBUTE_LOCATION==attrName ||
calendar_filter_add_str(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], strMatchFlag, matchValue->getString().c_str());
calendar_filter_add_str(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], strMatchFlag, matchValue->getString().c_str());
}
- LogDebug("Added str filter with value: "<<matchValue->getString());
+ LoggerD("Added str filter with value: "<<matchValue->getString());
} else if(CALENDAR_FILTER_ATTRIBUTE_IS_ALL_DAY==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_int(m_filter, m_taskAttributeMap[attrName], CALENDAR_MATCH_EQUAL, matchValue->getBool() ? 1 : 0);
calendar_filter_add_int(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[CALENDAR_FILTER_ATTRIBUTE_ID_UID], CALENDAR_MATCH_EQUAL, -999);
}
}
- LogDebug("Added int filter with value: "<<matchValue->getBool());
+ LoggerD("Added int filter with value: "<<matchValue->getBool());
} else if(CALENDAR_FILTER_ATTRIBUTE_START_DATE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_DUE_DATE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_END_DATE==attrName) {
calendar_filter_add_caltime(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], intMatchFlag, calTime);
calendar_filter_add_caltime(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], intMatchFlag, calTime);
}
- LogDebug("Added caltime filter with value: "<<time);
+ LoggerD("Added caltime filter with value: "<<time);
} else if(CALENDAR_FILTER_ATTRIBUTE_LATITUDE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_LONGITUDE==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_double(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], intMatchFlag, matchValue->getDouble());
calendar_filter_add_double(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], intMatchFlag, matchValue->getDouble());
}
- LogDebug("Added double filter with value: "<<matchValue->getDouble());
+ LoggerD("Added double filter with value: "<<matchValue->getDouble());
} else if(CALENDAR_FILTER_ATTRIBUTE_ALARMS==attrName ||
CALENDAR_FILTER_ATTRIBUTE_ATTENDEES==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_int(m_alldayInstanceFilter, m_normalInstanceAttributeMap[attrName], CALENDAR_MATCH_EQUAL, 1);
}
}
- LogDebug("Added int filter.");
+ LoggerD("Added int filter.");
} else if(CALENDAR_FILTER_ATTRIBUTE_CATEGORIES==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_str(m_filter, m_taskAttributeMap[attrName], CALENDAR_MATCH_CONTAINS, matchValue->getString().c_str());
calendar_filter_add_str(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], CALENDAR_MATCH_CONTAINS, matchValue->getString().c_str());
calendar_filter_add_str(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_CONTAINS, matchValue->getString().c_str());
}
- LogDebug("Added str filter for categories with value: "<<matchValue->getString());
+ LoggerD("Added str filter for categories with value: "<<matchValue->getString());
} else if(CALENDAR_FILTER_ATTRIBUTE_IS_DETACHED==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
- LogWarning("isDetached not supported for a task.");
+ LoggerW("isDetached not supported for a task.");
} else {
calendar_filter_add_int(m_filter, m_eventAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
calendar_filter_add_int(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
calendar_filter_add_int(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
}
- LogDebug("Added int filter for isDetached with value 0.");
+ LoggerD("Added int filter for isDetached with value 0.");
} else if(CALENDAR_FILTER_ATTRIBUTE_RECURRENCE_RULE==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
- LogWarning("rrule not supported for a task.");
+ LoggerW("rrule not supported for a task.");
} else {
if( DeviceAPI::Tizen::MATCH_EXACTLY==matchFlag ) {
if( matchValue->isNullOrUndefined() ) {
calendar_filter_add_int(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
calendar_filter_add_int(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
}
- LogDebug("Added int filter for rrule EXACTLY flag.");
+ LoggerD("Added int filter for rrule EXACTLY flag.");
} else {
calendar_filter_add_int(m_filter, m_eventAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
calendar_filter_add_int(m_normalInstanceFilter, m_normalInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
calendar_filter_add_int(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_GREATER_THAN, 0);
- LogDebug("Added int filter for rrule.");
+ LoggerD("Added int filter for rrule.");
}
}
} else {
- LogWarning("Not supported filter attribute: "<<attrName);
+ LoggerW("Not supported filter attribute: "<<attrName);
}
- LogDebug("Attribute visit done.");
+ LoggerD("Attribute visit done.");
}
void CalendarFilter::visitAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth)
{
if(initialValue == NULL && endValue == NULL) {
- LogWarning("Both initial/end values are empty.");
+ LoggerW("Both initial/end values are empty.");
return;
}
- LogDebug("attrName: " <<attrName<<", initialValue: "<<initialValue->toString()<<", endValue: " <<endValue->toString()<<", depth: "<<depth);
+ LoggerD("attrName: " <<attrName<<", initialValue: "<<initialValue->toString()<<", endValue: " <<endValue->toString()<<", depth: "<<depth);
if(CALENDAR_FILTER_ATTRIBUTE_START_DATE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_DUE_DATE==attrName ||
calendar_filter_add_filter(m_filter, subFilter);
- LogDebug("Query for normal instances.");
+ LoggerD("Query for normal instances.");
calendar_filter_h subFilterNormal = NULL;
calendar_filter_create(_calendar_instance_normal_calendar_book._uri, &subFilterNormal);
}
calendar_filter_add_filter(m_normalInstanceFilter, subFilterNormal);
- LogDebug("Query for allday instances.");
+ LoggerD("Query for allday instances.");
calendar_filter_h subFilterAllday = NULL;
calendar_filter_create(_calendar_instance_allday_calendar_book._uri, &subFilterAllday);
}
calendar_filter_add_filter(m_alldayInstanceFilter, subFilterAllday);
- LogDebug("Enable the instance table search.");
+ LoggerD("Enable the instance table search.");
m_enableInstanceSearch = true;
}
- LogDebug("Added caltime range filter with initial value: "<<startTime.time.utime<<", end value: "<<endTime.time.utime);
+ LoggerD("Added caltime range filter with initial value: "<<startTime.time.utime<<", end value: "<<endTime.time.utime);
} else if(CALENDAR_FILTER_ATTRIBUTE_LATITUDE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_LONGITUDE==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_double(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_LESS_THAN_OR_EQUAL, endValue->getDouble());
}
}
- LogDebug("Added double range filter with initial value: "<<initialValue->getDouble()<<", end value: "<<endValue->getDouble());
+ LoggerD("Added double range filter with initial value: "<<initialValue->getDouble()<<", end value: "<<endValue->getDouble());
} else if(CALENDAR_FILTER_ATTRIBUTE_COMPLETED_DATE==attrName ||
CALENDAR_FILTER_ATTRIBUTE_LAST_MODIFIED_DATE==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_filter_add_lli(m_alldayInstanceFilter, m_alldayInstanceAttributeMap[attrName], CALENDAR_MATCH_LESS_THAN_OR_EQUAL, getTimeTFromTZDateAny(endValue));
}
}
- LogDebug("Added lli range filter with initial value: "<<getTimeTFromTZDateAny(initialValue)<<", end value: "<<getTimeTFromTZDateAny(endValue));
+ LoggerD("Added lli range filter with initial value: "<<getTimeTFromTZDateAny(initialValue)<<", end value: "<<getTimeTFromTZDateAny(endValue));
} else if(CALENDAR_FILTER_ATTRIBUTE_PROGRESS==attrName) {
if(CalendarEvent::TASK_TYPE==m_type) {
if (!initialValue->isNullOrUndefined()) {
calendar_filter_add_int(m_filter, m_taskAttributeMap[attrName], CALENDAR_MATCH_LESS_THAN_OR_EQUAL, endValue->getLong());
}
} else {
- LogWarning("progress not supported for an event");
+ LoggerW("progress not supported for an event");
}
- LogDebug("Added double range filter with initial value: "<<initialValue->getLong()<<", end value: "<<endValue->getLong());
+ LoggerD("Added double range filter with initial value: "<<initialValue->getLong()<<", end value: "<<endValue->getLong());
} else {
- LogWarning("Not supported filter attribute: "<<attrName);
+ LoggerW("Not supported filter attribute: "<<attrName);
}
- LogDebug("Attribute range visit done.");
+ LoggerD("Attribute range visit done.");
}
void CalendarFilter::setType(CalendarEvent::CalendarType type)
// The first sort mode only.
attrName = (*it)->getAttributeName();
if (attrName.compare("") != 0) {
- LogDebug("Setting the sort mode with attrName: "<<attrName);
+ LoggerD("Setting the sort mode with attrName: "<<attrName);
if ((*it)->getOrder()==DeviceAPI::Tizen::ASCENDING_SORT_ORDER) {
if(CalendarEvent::TASK_TYPE==m_type) {
calendar_query_set_sort(m_query, m_taskAttributeMap[attrName], true);
}
}
} else {
- LogWarning("Empty attribute name.");
+ LoggerW("Empty attribute name.");
}
}
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get the item count: "<<ret);
} else {
- LogDebug("Item count: "<<m_recordCount);
+ LoggerD("Item count: "<<m_recordCount);
}
if(m_enableInstanceSearch) {
- LogDebug("Perform query for instances.");
+ LoggerD("Perform query for instances.");
ret = calendar_query_set_filter(m_normalInstanceQuery, m_normalInstanceFilter);
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Setting a normal instance filter failed: "<<ret);
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get a normal instance item count: "<<ret);
} else {
- LogDebug("Normal instance item count: "<<m_normalInstanceRecordCount);
+ LoggerD("Normal instance item count: "<<m_normalInstanceRecordCount);
}
ret = calendar_query_set_filter(m_alldayInstanceQuery, m_alldayInstanceFilter);
if( CALENDAR_ERROR_NONE!=ret ) {
ThrowMsg(PlatformException, "Can't get an allday instance item count: "<<ret);
} else {
- LogDebug("Allday instance item count: "<<m_alldayInstanceRecordCount);
+ LoggerD("Allday instance item count: "<<m_alldayInstanceRecordCount);
}
} else {
- LogDebug("No need to perform query for instances.");
+ LoggerD("No need to perform query for instances.");
}
}
int CalendarFilter::convertStringToIntValue(const std::string attrName, const std::string valueString)
{
- LogDebug("attrName: "<<attrName<<", valueString: "<<valueString);
+ LoggerD("attrName: "<<attrName<<", valueString: "<<valueString);
if(attrName==CALENDAR_FILTER_ATTRIBUTE_VISIBILITY)
{
} else if(valueString=="CONFIDENTIAL") {
return CALENDAR_SENSITIVITY_CONFIDENTIAL;
} else {
- LogWarning("Wrong visibility value.");
+ LoggerW("Wrong visibility value.");
}
}
else if(attrName==CALENDAR_FILTER_ATTRIBUTE_STATUS)
} else if(valueString=="COMPLETED") {
return CALENDAR_TODO_STATUS_COMPLETED;
} else {
- LogWarning("Wrong status value.");
+ LoggerW("Wrong status value.");
}
}
else if(attrName==CALENDAR_FILTER_ATTRIBUTE_PRIORITY)
} else if(valueString=="LOW") {
return CALENDAR_EVENT_PRIORITY_LOW;
} else {
- LogWarning("Wrong priority value.");
+ LoggerW("Wrong priority value.");
}
}
else if(attrName==CALENDAR_FILTER_ATTRIBUTE_AVAILABILITY)
} else if(valueString=="FREE") {
return CALENDAR_EVENT_BUSY_STATUS_FREE;
} else {
- LogWarning("Wrong availability value.");
+ LoggerW("Wrong availability value.");
}
} else {
- LogWarning("Invalid attrName");
+ LoggerW("Invalid attrName");
}
return -1;
#define _CALENDAR_FILTER_H_
#include <string>
+#include <map>
#include <dpl/shared_ptr.h>
#include <IFilterVisitor.h>
#include <SortMode.h>
#include "CalendarFilterConverter.h"
-#include <dpl/log/log.h>
#include <TimeUtilConverter.h>
#include <JSTZDate.h>
-#include "CalendarFilter.h"
+#include "CalendarFilter.h"\r
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "CalendarResponseDispatcher.h"
#include "JSCalendar.h"
#include "ICalendar.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
{
CalendarPrivObject *privateObject = static_cast<CalendarPrivObject*>(JSObjectGetPrivate(m_object));
if (!privateObject) {
- LogWarning("Object is null.");
+ LoggerW("Object is null.");
return;
}
ICalendarPtr calendar = privateObject->getObject();
Try {
- LogDebug("Remove change listeners for calendar.");
+ LoggerD("Remove change listeners for calendar.");
IEventClearWatchPtr dplEvent(new IEventClearWatch());
dplEvent->setWatchId(m_watchId);
dplEvent->setForSynchronousCall();
calendar->clearWatch(dplEvent);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
#include "CalendarManager.h"
#include <vector>
#include <sstream>
-#include <dpl/log/log.h>
#include <calendar2.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
{
DPL::Mutex::ScopedLock mx(&m_constructorMutex);
if (m_instanceCount == 0) {
- LogDebug("Connect to the calendar DB.");
+ LoggerD("Connect to the calendar DB.");
if (CALENDAR_ERROR_NONE != calendar_connect()) {
- LogError("Calendar DB connection failed.");
+ LoggerE("Calendar DB connection failed.");
}
}
m_instanceCount++;
DPL::Mutex::ScopedLock mx(&m_constructorMutex);
m_instanceCount--;
if (m_instanceCount == 0) {
- LogDebug("Disconnect calendar DB.");
+ LoggerD("Disconnect calendar DB.");
if (CALENDAR_ERROR_NONE != calendar_disconnect()) {
- LogError("Calendar DB disconnect failed.");
+ LoggerE("Calendar DB disconnect failed.");
}
}
}
if(CALENDAR_ERROR_NONE!=ret){
ThrowMsg(PlatformException, "Getting calendar list count failed: "<<ret);
} else {
- LogDebug("Calendar list count: "<<count);
+ LoggerD("Calendar list count: "<<count);
}
calendar_record_h calendar = NULL;
while(count--)
{
if(CALENDAR_ERROR_NONE!=calendar_list_get_current_record_p(list, &calendar)) {
- LogWarning("Getting current record failed.");
+ LoggerW("Getting current record failed.");
break;
}
ret = calendar_record_get_str(calendar, _calendar_book.name, &name);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar name: "<<ret);
+ LoggerW("Can't get calendar name: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.id, &id);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar id: "<<ret);
+ LoggerW("Can't get calendar id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.account_id, &accountId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar account id: "<<ret);
+ LoggerW("Can't get calendar account id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.store_type, &storeType);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar store type: "<<ret);
+ LoggerW("Can't get calendar store type: "<<ret);
}
if (name != NULL) {
- LogDebug("Got calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
+ LoggerD("Got calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
if( (CALENDAR_BOOK_TYPE_EVENT==storeType && CalendarEvent::EVENT_TYPE==event->getType()) ||
(CALENDAR_BOOK_TYPE_TODO==storeType && CalendarEvent::TASK_TYPE==event->getType()) ) {
newCalendar->setType(event->getType());
event->addCalendar(newCalendar);
} else {
- LogDebug("Different calendar type.");
+ LoggerD("Different calendar type.");
}
free(name);
} else {
- LogError("Calendar contains invalid parameters");
+ LoggerE("Calendar contains invalid parameters");
}
calendar = NULL;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
if(CALENDAR_ERROR_NONE!=ret){
ThrowMsg(PlatformException, "Getting calendar list count failed: "<<ret);
} else {
- LogDebug("Calendar list count: "<<count);
+ LoggerD("Calendar list count: "<<count);
}
calendar_record_h calendar = NULL;
while(count--)
{
if(CALENDAR_ERROR_NONE!=calendar_list_get_current_record_p(list, &calendar)) {
- LogWarning("Getting current record failed.");
+ LoggerW("Getting current record failed.");
break;
}
ret = calendar_record_get_str(calendar, _calendar_book.name, &name);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar name: "<<ret);
+ LoggerW("Can't get calendar name: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.id, &id);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar id: "<<ret);
+ LoggerW("Can't get calendar id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.account_id, &accountId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar account id: "<<ret);
+ LoggerW("Can't get calendar account id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.store_type, &storeType);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar store type: "<<ret);
+ LoggerW("Can't get calendar store type: "<<ret);
}
if (name != NULL) {
- LogDebug("Got default calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
+ LoggerD("Got default calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
if( (CALENDAR_BOOK_TYPE_EVENT==storeType && CalendarEvent::EVENT_TYPE==event->getType()) ||
(CALENDAR_BOOK_TYPE_TODO==storeType && CalendarEvent::TASK_TYPE==event->getType()) ) {
event->setCalendar(newCalendar);
break;
} else {
- LogDebug("Different calendar type.");
+ LoggerD("Different calendar type.");
}
free(name);
} else {
- LogError("Calendar contains invalid parameters");
+ LoggerE("Calendar contains invalid parameters");
}
calendar = NULL;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
newCalendar->setType(event->getType());
newCalendar->setIsUnified(true);
- LogDebug("Setting empty values, id: "<<newCalendar->getId()<<", name: "<<newCalendar->getName()<<", account id: "<<newCalendar->getAccountId()<<", type: "<<newCalendar->getType());
+ LoggerD("Setting empty values, id: "<<newCalendar->getId()<<", name: "<<newCalendar->getName()<<", account id: "<<newCalendar->getAccountId()<<", type: "<<newCalendar->getType());
event->setCalendar(newCalendar);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
int calendarId = -1;
ss>>calendarId;
- LogInfo("Given id: "<<event->getId()<<", converted id: "<<calendarId);
+ LoggerI("Given id: "<<event->getId()<<", converted id: "<<calendarId);
ICalendarPtr newCalendar(new Calendar());
ret = calendar_list_get_count(list, &count);
if(CALENDAR_ERROR_NONE!=ret){
- LogWarning("Getting calendar list count failed: "<<ret);
+ LoggerW("Getting calendar list count failed: "<<ret);
} else {
- LogDebug("Calendar list count: "<<count);
+ LoggerD("Calendar list count: "<<count);
}
calendar_record_h calendar = NULL;
while(count--)
{
if(CALENDAR_ERROR_NONE!=calendar_list_get_current_record_p(list, &calendar)) {
- LogWarning("Getting current record failed.");
+ LoggerW("Getting current record failed.");
break;
}
ret = calendar_record_get_str(calendar, _calendar_book.name, &name);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar name: "<<ret);
+ LoggerW("Can't get calendar name: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.id, &id);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar id: "<<ret);
+ LoggerW("Can't get calendar id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.account_id, &accountId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar account id: "<<ret);
+ LoggerW("Can't get calendar account id: "<<ret);
}
ret = calendar_record_get_int(calendar, _calendar_book.store_type, &storeType);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calendar store type: "<<ret);
+ LoggerW("Can't get calendar store type: "<<ret);
}
if (name != NULL) {
- LogDebug("Got a calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
+ LoggerD("Got a calendar, id: "<<id<<", name: "<<name<<", account id: "<<accountId<<", storeType: "<<storeType);
if( (CALENDAR_BOOK_TYPE_EVENT==storeType && CalendarEvent::EVENT_TYPE==event->getType()) ||
(CALENDAR_BOOK_TYPE_TODO==storeType && CalendarEvent::TASK_TYPE==event->getType()) ) {
break;
}
} else {
- LogDebug("Different calendar type.");
+ LoggerD("Different calendar type.");
}
free(name);
} else {
- LogError("Calendar contains invalid parameters");
+ LoggerE("Calendar contains invalid parameters");
}
calendar = NULL;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
// limitations under the License.
//
-
#include "CalendarResponseDispatcher.h"
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include "JSCalendarEventId.h"
#include "CalendarMultiCallback.h"
#include "EventId.h"
-
#include "CalendarAsyncCallbackManager.h"
-
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
{
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
if (event->getResult()) {
CalendarConverter converter(cbm->getContext());
const std::vector<ICalendarPtr> &results = event->getCalendars();
- LogDebug("found calendars: " << results.size());
+ LoggerD("found calendars: " << results.size());
JSValueRef result = converter.toJSValueRef(results);
cbm->callOnSuccess(result);
return;
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
}
JSValueRef errorObject = DeviceAPI::Common::JSTizenExceptionFactory::makeErrorObject(
cbm->getContext(), DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
Try
{
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
CalendarAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
CalendarConverter converter(cbm->getContext());
JSValueRef result;
cbm->callOnSuccess(result);
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
}
Catch(ConversionException)
{
- LogError("cannot convert event");
+ LoggerE("cannot convert event");
}
JSValueRef errorObject = DeviceAPI::Common::JSTizenExceptionFactory::makeErrorObject(
cbm->getContext(), DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
{
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
{
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
{
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
Try
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
JSValueRef errorObject = DeviceAPI::Common::JSTizenExceptionFactory::makeErrorObject(
cbm->getContext(), DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
cbm->callOnError(errorObject);
Try
{
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
JSValueRef errorObject = DeviceAPI::Common::JSTizenExceptionFactory::makeErrorObject(
cbm->getContext(), DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
cbm->callOnError(errorObject);
//case OnEventsChanged::ON_CALENDAR_RESET:
default:
{
- LogDebug("Invalid status!");
+ LoggerD("Invalid status!");
break;
}
}
}
Catch(ConversionException)
{
- LogError("cannot convert change event");
+ LoggerE("cannot convert change event");
}
Catch(Exception)
{
- LogError("exception occurred while handling change noti callback!");
+ LoggerE("exception occurred while handling change noti callback!");
}
}
#include "CalendarUtility.h"
-
-#include <dpl/log/log.h>
-
#include <unicode/ucal.h>
#include <unicode/ustring.h>
#include <unicode/ustdio.h>
#include <unicode/udat.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
_tzid = (UChar*)calloc(strlen(tzid) + 1, sizeof(UChar));
if (_tzid == NULL)
{
- LogError("Failed to calloc");
+ LoggerE("Failed to calloc");
return ct;
}
u_uastrcpy(_tzid, tzid);
- LogDebug("tzid: "<<tzid);
+ LoggerD("tzid: "<<tzid);
ucal = ucal_open(_tzid, u_strlen(_tzid), "en_US", UCAL_TRADITIONAL, &status);
if (U_FAILURE(status)) {
- LogError("ucal_open failed with "<<u_errorName(status));
+ LoggerE("ucal_open failed with "<<u_errorName(status));
return ct;
}
ucal_setMillis(ucal, sec2ms(lli), &status);
if (U_FAILURE(status)) {
- LogError("ucal_setMillis failed with "<<u_errorName(status));
+ LoggerE("ucal_setMillis failed with "<<u_errorName(status));
return ct;
}
ct.time.date = {y, mon, d};
- LogDebug("y: "<<y<<", mon: "<<mon<<", d: "<<d);
+ LoggerD("y: "<<y<<", mon: "<<mon<<", d: "<<d);
ucal_close(ucal);
if (_tzid) free(_tzid);
_tzid = (UChar*)calloc(strlen(tzid) + 1, sizeof(UChar));
if (_tzid == NULL)
{
- LogError("Failed to calloc");
+ LoggerE("Failed to calloc");
return -1;
}
u_uastrcpy(_tzid, tzid);
- LogDebug("tzid: "<<tzid);
+ LoggerD("tzid: "<<tzid);
ucal = ucal_open(_tzid, u_strlen(_tzid), "en_US", UCAL_TRADITIONAL, &status);
if (U_FAILURE(status)) {
- LogError("ucal_open failed with "<<u_errorName(status));
+ LoggerE("ucal_open failed with "<<u_errorName(status));
return -1;
}
ucal_close(ucal);
if (_tzid) free(_tzid);
- LogDebug("converted time: "<<lli);
+ LoggerD("converted time: "<<lli);
return lli;
}
#include "EventAlarm.h"
#include "EventRecurrenceRule.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
// limitations under the License.
//
-
#include "EventAttendee.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
#include "EventRecurrenceRule.h"
#include <Commons/Exception.h>
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
EventRecurrenceRule::~EventRecurrenceRule()
{
if(m_daysOfTheWeekJSRef) {
- LogDebug("Unprotect JS daysOfTheWeek.");
+ LoggerD("Unprotect JS daysOfTheWeek.");
JSValueUnprotect(m_context, m_daysOfTheWeekJSRef);
}
if(m_setPositionsJSRef) {
- LogDebug("Unprotect JS setPositions.");
+ LoggerD("Unprotect JS setPositions.");
JSValueUnprotect(m_context, m_setPositionsJSRef);
}
if(m_exceptionsJSRef) {
- LogDebug("Unprotect JS exceptions.");
+ LoggerD("Unprotect JS exceptions.");
JSValueUnprotect(m_context, m_exceptionsJSRef);
}
}
// limitations under the License.
//
-
#include <sstream>
#include <algorithm>
#include <time.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "EventWrapper.h"
#include "Calendar.h"
#include "CalendarUtility.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
}
int itemId = m_abstractEvent->getId();
- LogDebug("Before saving/update eventId: " << itemId);
+ LoggerD("Before saving/update eventId: " << itemId);
//displayPlatformEvent();
ThrowMsg(PlatformException, "Can't insert new item: "<<ret);
}
m_abstractEvent->setId(itemId);
- LogDebug("New calendar item inserted with id: "<<itemId);
+ LoggerD("New calendar item inserted with id: "<<itemId);
} else {
ret = calendar_db_update_record(m_platformEvent);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't update new item: "<<ret);
}
- LogDebug("Calendar item updated.");
+ LoggerD("Calendar item updated.");
}
}
void EventWrapper::loadEvent(int id)
{
- LogDebug("Item id to load: " << id);
+ LoggerD("Item id to load: " << id);
freePlatformEvent();
const char *dataType;
// If the recurrenceId is set, delete the instance of recurring event only.
int itemId = m_abstractEvent->getId();
long long int recurrenceId = m_abstractEvent->getRecurrenceId();
- LogDebug("itemId to delete: " << itemId << ", recurrenceId: " << recurrenceId << ", type: " << getType());
+ LoggerD("itemId to delete: " << itemId << ", recurrenceId: " << recurrenceId << ", type: " << getType());
calendar_record_h item = NULL;
const char *dataType;
if(ret!=CALENDAR_ERROR_NONE) {
ThrowMsg(PlatformException, "Can't delete the instance: "<<ret);
} else {
- LogDebug("Set the exdate: "<<exdate);
+ LoggerD("Set the exdate: "<<exdate);
}
ret = calendar_db_update_record(m_platformEvent);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't update the exdate "<<ret);
}
- LogDebug("Calendar item instance deleted.");
+ LoggerD("Calendar item instance deleted.");
}
}
if (value.empty()) {
ThrowMsg(NullPointerException, "Failed to create an item from string.");
} else {
- LogDebug("string to convert: "<<value);
+ LoggerD("string to convert: "<<value);
}
calendar_list_h list = NULL;
int count = -1;
if(CALENDAR_ERROR_NONE!=calendar_list_get_count(list, &count)){
- LogWarning("Getting list count failed.");
+ LoggerW("Getting list count failed.");
} else {
- LogDebug("List count: "<<count);
+ LoggerD("List count: "<<count);
}
calendar_record_h currentItem = NULL;
ret = calendar_list_get_current_record_p(list, ¤tItem);
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Getting current record failed: "<<ret);
+ LoggerW("Getting current record failed: "<<ret);
}
// Filter out the extended features.
uri = NULL;
ret = calendar_record_get_uri_p(currentItem, &uri);
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Getting uri failed: "<<ret);
+ LoggerW("Getting uri failed: "<<ret);
}
if ( 0==strcmp(uri, _calendar_event._uri) && CalendarEvent::EVENT_TYPE==getType()) {
- LogDebug("Found an event.");
+ LoggerD("Found an event.");
} else if ( 0==strcmp(uri, _calendar_todo._uri) && CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("Found a task.");
+ LoggerD("Found a task.");
} else {
- LogDebug("Skip an extended feature.");
+ LoggerD("Skip an extended feature.");
calendar_list_next(list);
continue;
}
ret = calendar_record_clone(currentItem, &m_platformEvent);
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Clonning failed: "<<ret);
+ LoggerW("Clonning failed: "<<ret);
}
}
{
if (m_platformEvent != NULL) {
if (CALENDAR_ERROR_NONE != calendar_record_destroy(m_platformEvent, true)) {
- LogWarning("Can't destroy calendar record.");
+ LoggerW("Can't destroy calendar record.");
}
m_platformEvent = NULL;
} else {
- LogDebug("Null platform event.");
+ LoggerD("Null platform event.");
}
}
if (CALENDAR_ERROR_NONE!=ret) {
ThrowMsg(NotFoundException, "Can't load the item with id: "<<m_abstractEvent->getId()<<", error code: "<<ret);
} else {
- LogDebug("Item loaded with id: "<<m_abstractEvent->getId());
+ LoggerD("Item loaded with id: "<<m_abstractEvent->getId());
}
} else {
ret = calendar_record_create(dataType, &m_platformEvent);
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't create platform record: "<<ret);
} else {
- LogDebug("Platform item created with dataType: "<<dataType);
+ LoggerD("Platform item created with dataType: "<<dataType);
}
}
ret = calendar_record_set_int(m_platformEvent, _calendar_event.calendar_book_id, m_abstractEvent->getCalendarId());
}
if (CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Can't set calendarId.");
+ LoggerW("Can't set calendarId.");
}
}
ret = calendar_record_set_str(m_platformEvent, _calendar_event.description, m_abstractEvent->getDescription().c_str());
}
if (CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Can't set item description.");
+ LoggerW("Can't set item description.");
}
}
ret = calendar_record_set_str(m_platformEvent, _calendar_event.summary, m_abstractEvent->getSubject().c_str());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set item subject.");
+ LoggerW("Can't set item subject.");
}
}
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't set start time: "<<ret);
} else {
- LogDebug("Set start time.");
+ LoggerD("Set start time.");
}
if(CalendarEvent::TASK_TYPE==getType()) {
if (CALENDAR_ERROR_NONE != ret) {
ThrowMsg(PlatformException, "Can't set start time zone: "<<ret);
} else {
- LogDebug("Set time zone: "<<timeZone);
+ LoggerD("Set time zone: "<<timeZone);
}
}
ret = calendar_record_set_caltime(m_platformEvent, _calendar_event.end_time, cal);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set end/due time: "<<ret);
+ LoggerW("Can't set end/due time: "<<ret);
}
}
ret = calendar_record_set_str(m_platformEvent, _calendar_event.location, m_abstractEvent->getLocation().c_str());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set location.");
+ LoggerW("Can't set location.");
}
}
void EventWrapper::setRecurrenceRuleToPlatformEvent()
{
if (CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set rrule for a task.");
+ LoggerD("No need to set rrule for a task.");
return;
}
EventRecurrenceRulePtr rrule = m_abstractEvent->getRecurrenceRule();
if (NULL==rrule) {
- LogWarning("No way! Rrule is not set!");
+ LoggerW("No way! Rrule is not set!");
return;
} else if(EventRecurrenceRule::NO_RECURRENCE==rrule->getFrequency()) {
- LogDebug("No recurrence frequency.");
+ LoggerD("No recurrence frequency.");
} else if(EventRecurrenceRule::UNDEFINED_RECURRENCE==rrule->getFrequency()) {
- LogDebug("Undefined recurrence frequency.");
+ LoggerD("Undefined recurrence frequency.");
} else {
- LogDebug("frequency "<<rrule->getFrequency());
+ LoggerD("frequency "<<rrule->getFrequency());
}
// set frequency
case EventRecurrenceRule::NO_RECURRENCE:
case EventRecurrenceRule::UNDEFINED_RECURRENCE:
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_NONE)) {
- LogWarning("Failed setting frequency.");
+ LoggerW("Failed setting frequency.");
}
break;
case EventRecurrenceRule::DAILY_RECURRENCE:
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_DAILY)) {
- LogWarning("Failed setting frequency.");
+ LoggerW("Failed setting frequency.");
}
break;
case EventRecurrenceRule::WEEKLY_RECURRENCE:
{
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_WEEKLY)) {
- LogWarning("Failed setting frequency.");
+ LoggerW("Failed setting frequency.");
}
break;
}
case EventRecurrenceRule::MONTHLY_RECURRENCE:
{
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_MONTHLY)) {
- LogWarning("Failed setting frequency.");
+ LoggerW("Failed setting frequency.");
}
break;
}
case EventRecurrenceRule::YEARLY_RECURRENCE:
{
if(CALENDAR_ERROR_NONE!=calendar_record_set_int(m_platformEvent, _calendar_event.freq, CALENDAR_RECURRENCE_YEARLY)) {
- LogWarning("Failed setting frequency.");
+ LoggerW("Failed setting frequency.");
}
break;
}
default:
- LogWarning("Invalid reccurence rule frequency "<<rrule->getFrequency());
+ LoggerW("Invalid reccurence rule frequency "<<rrule->getFrequency());
break;
}
}
}
- LogDebug("byday: "<<byday);
+ LoggerD("byday: "<<byday);
if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.byday, byday.c_str())) {
- LogWarning("Can't set byday.");
+ LoggerW("Can't set byday.");
}
}
// set the ocurrence count
if (-1 != rrule->getOccurrenceCount()) {
- LogDebug("Set the occurrence count: "<<rrule->getOccurrenceCount());
+ LoggerD("Set the occurrence count: "<<rrule->getOccurrenceCount());
if (CALENDAR_ERROR_NONE != calendar_record_set_int(m_platformEvent, _calendar_event.range_type, CALENDAR_RANGE_COUNT)) {
- LogWarning("Can't set rrule range type.");
+ LoggerW("Can't set rrule range type.");
}
if (CALENDAR_ERROR_NONE != calendar_record_set_int(m_platformEvent, _calendar_event.count, rrule->getOccurrenceCount())) {
- LogWarning("Can't set occurrence count.");
+ LoggerW("Can't set occurrence count.");
}
}
// set the exceptions
if ( !rrule->getExceptions()->empty() )
{
- LogDebug("Set the exceptions of length: "<<rrule->getExceptions()->size());
+ LoggerD("Set the exceptions of length: "<<rrule->getExceptions()->size());
std::string exdate = "";
for( unsigned int i=0; i<rrule->getExceptions()->size(); i++ )
exdate.append(",");
}
}
- LogDebug("exdate: "<<exdate);
+ LoggerD("exdate: "<<exdate);
if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.exdate, exdate.c_str())) {
- LogWarning("Can't save exceptions.");
+ LoggerW("Can't save exceptions.");
}
}
// set the setPositions
if ( !rrule->getSetPositions()->empty() )
{
- LogDebug("Set the setPositions of length: "<<rrule->getSetPositions()->size());
+ LoggerD("Set the setPositions of length: "<<rrule->getSetPositions()->size());
std::string bysetpos = "";
for( unsigned int i=0; i<rrule->getSetPositions()->size(); i++ )
bysetpos.append(",");
}
}
- LogDebug("bysetpos: "<<bysetpos);
+ LoggerD("bysetpos: "<<bysetpos);
if (CALENDAR_ERROR_NONE!=calendar_record_set_str(m_platformEvent, _calendar_event.bysetpos, bysetpos.c_str())) {
- LogWarning("Can't save setPositions.");
+ LoggerW("Can't save setPositions.");
}
}
_calendar_event.interval,
rrule->getInterval()))
{
- LogWarning("Can't set interval.");
+ LoggerW("Can't set interval.");
}
// set the recurrence end date. This is automatically calculated by platform if empty.
if (UNDEFINED_TIME!=rrule->getEndDate()) {
- LogDebug("Setting the end date: "<<rrule->getEndDate());
+ LoggerD("Setting the end date: "<<rrule->getEndDate());
if (CALENDAR_ERROR_NONE != calendar_record_set_int(m_platformEvent, _calendar_event.range_type, CALENDAR_RANGE_UNTIL)) {
- LogWarning("Can't set rrule range type.");
+ LoggerW("Can't set rrule range type.");
}
int ret;
cal.time.utime = m_abstractEvent->getRecurrenceRule()->getEndDate();
ret = calendar_record_set_caltime(m_platformEvent, _calendar_event.until_time, cal);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set rrule until time: "<<ret);
+ LoggerW("Can't set rrule until time: "<<ret);
}
}
}
ret = calendar_record_get_child_record_count(m_platformEvent, _calendar_event.calendar_alarm, &count);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get alarms count: "<<ret);
+ LoggerW("Can't get alarms count: "<<ret);
}
if(0==count) {
- LogDebug("No alarms to remove.");
+ LoggerD("No alarms to remove.");
} else {
- LogDebug("Number of alarms to remove: "<<count);
+ LoggerD("Number of alarms to remove: "<<count);
}
calendar_record_h alarm = NULL;
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_event.calendar_alarm, 0, &alarm);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get the alarm: "<<ret);
+ LoggerW("Can't get the alarm: "<<ret);
continue;
}
ret = calendar_record_remove_child_record(m_platformEvent, _calendar_event.calendar_alarm, alarm);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't remove the alarm: "<<ret);
+ LoggerW("Can't remove the alarm: "<<ret);
continue;
}
}
if( 0 != m_abstractEvent->getAlarms()->size() ) {
for( i=0; i<m_abstractEvent->getAlarms()->size(); i++ )
{
- LogDebug("Set the alarms #"<<i);
+ LoggerD("Set the alarms #"<<i);
alarm = NULL;
ret = calendar_record_create(_calendar_alarm._uri, &alarm);
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Alarm creation failed: "<<ret);
+ LoggerW("Alarm creation failed: "<<ret);
continue;
}
tickUnit = CALENDAR_ALARM_TIME_UNIT_DAY;
tick = theAlarm->getDuration().length;
} else {
- LogWarning("Wrong alarm time unit: "<<theAlarm->getDuration().unit);
+ LoggerW("Wrong alarm time unit: "<<theAlarm->getDuration().unit);
}
}
if( CALENDAR_ALARM_TIME_UNIT_SPECIFIC==tickUnit ) {
long long int time = theAlarm->getAbsoluteDate();
- LogDebug("Save absolute date: "<<time);
+ LoggerD("Save absolute date: "<<time);
ret = calendar_record_set_lli(alarm, _calendar_alarm.time, time);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set alarm time: "<<ret);
+ LoggerW("Can't set alarm time: "<<ret);
}
} else {
ret = calendar_record_set_int(alarm, _calendar_alarm.tick, tick);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set alarm tick: "<<ret);
+ LoggerW("Can't set alarm tick: "<<ret);
}
}
ret = calendar_record_set_int(alarm, _calendar_alarm.tick_unit, tickUnit);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set alarm tick unit: "<<ret);
+ LoggerW("Can't set alarm tick unit: "<<ret);
}
// Set the alarm type.
ret = calendar_record_set_int(alarm, _calendar_alarm.type, theAlarm->getMethod());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set alarm type: "<<ret);
+ LoggerW("Can't set alarm type: "<<ret);
}
// Set the display text
ret = calendar_record_set_str(alarm, _calendar_alarm.description, theAlarm->getDescription().c_str());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set alarm description: "<<ret);
+ LoggerW("Can't set alarm description: "<<ret);
}
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_add_child_record(m_platformEvent, _calendar_event.calendar_alarm, alarm);
}
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Cannot add alarm child record: "<<ret);
+ LoggerW("Cannot add alarm child record: "<<ret);
if(alarm) {
calendar_record_destroy(alarm, true);
}
}
}
} else {
- LogDebug("No alarms to save.");
+ LoggerD("No alarms to save.");
}
}
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set item status.");
+ LoggerW("Can't set item status.");
}
}
}
}
- LogDebug("Saving categories: "<<categories);
+ LoggerD("Saving categories: "<<categories);
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_set_str(m_platformEvent, _calendar_todo.categories, categories.c_str());
ret = calendar_record_set_str(m_platformEvent, _calendar_event.categories, categories.c_str());
}
if (CALENDAR_ERROR_NONE !=ret) {
- LogWarning("Cannot save categories.");
+ LoggerW("Cannot save categories.");
}
}
{
int ret;
if (CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set recurrence id for a task.");
+ LoggerD("No need to set recurrence id for a task.");
return;
}
ss<<m_abstractEvent->getRecurrenceId();
ret = calendar_record_set_str(m_platformEvent, _calendar_event.recurrence_id, ss.str().c_str());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set recurrence id.");
+ LoggerW("Can't set recurrence id.");
} else {
- LogDebug("Set the recurrence id: "<<ss.str());
+ LoggerD("Set the recurrence id: "<<ss.str());
}
} else {
- LogDebug("Recurrence id not defined.");
+ LoggerD("Recurrence id not defined.");
}
}
{
int ret;
if (CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set parent id for a task.");
+ LoggerD("No need to set parent id for a task.");
return;
}
if(UNDEFINED_ITEM_ID!=m_abstractEvent->getParentId()) {
ret = calendar_record_set_int(m_platformEvent, _calendar_event.original_event_id, m_abstractEvent->getParentId());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set parent Id.");
+ LoggerW("Can't set parent Id.");
} else {
- LogDebug("Set the parent id: "<<m_abstractEvent->getParentId());
+ LoggerD("Set the parent id: "<<m_abstractEvent->getParentId());
}
} else {
- LogDebug("Parent id not defined.");
+ LoggerD("Parent id not defined.");
}
}
void EventWrapper::setIsAllDayToPlatformEvent()
{
- LogDebug("All day flag is set in the start time struct: "<<m_abstractEvent->getIsAllDay());
+ LoggerD("All day flag is set in the start time struct: "<<m_abstractEvent->getIsAllDay());
}
void EventWrapper::setOrganizerToPlatformEvent()
ret = calendar_record_set_str(m_platformEvent, _calendar_event.organizer_name, m_abstractEvent->getOrganizer().c_str());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set item organizer.");
+ LoggerW("Can't set item organizer.");
}
}
visibility = CALENDAR_SENSITIVITY_CONFIDENTIAL;
break;
default:
- LogDebug("Use the default visibility");
+ LoggerD("Use the default visibility");
break;
}
ret = calendar_record_set_int(m_platformEvent, _calendar_event.sensitivity, visibility);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set visibility.");
+ LoggerW("Can't set visibility.");
}
}
void EventWrapper::setAvailabilityToPlatformEvent()
{
if(CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set availability for a task.");
+ LoggerD("No need to set availability for a task.");
return;
}
availability = CALENDAR_EVENT_BUSY_STATUS_TENTATIVE;
break;
default:
- LogDebug("Use the default availability");
+ LoggerD("Use the default availability");
break;
}
int ret = calendar_record_set_int(m_platformEvent, _calendar_event.busy_status, availability);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set availability.");
+ LoggerW("Can't set availability.");
}
}
ret = calendar_record_set_str(m_platformEvent, _calendar_event.uid, m_abstractEvent->getUId().c_str());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set item uid.");
+ LoggerW("Can't set item uid.");
}
}
ret = calendar_record_get_child_record_count(m_platformEvent, _calendar_event.calendar_attendee, &count);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get attendees count: "<<ret);
+ LoggerW("Can't get attendees count: "<<ret);
}
if(0==count) {
- LogDebug("No attendees to remove.");
+ LoggerD("No attendees to remove.");
} else {
- LogDebug("Number of attendees to remove: "<<count);
+ LoggerD("Number of attendees to remove: "<<count);
}
calendar_record_h attendee = NULL;
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_event.calendar_attendee, 0, &attendee);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get the attendee: "<<ret);
+ LoggerW("Can't get the attendee: "<<ret);
continue;
}
ret = calendar_record_remove_child_record(m_platformEvent, _calendar_event.calendar_attendee, attendee);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't remove the attendee: "<<ret);
+ LoggerW("Can't remove the attendee: "<<ret);
continue;
}
}
if( 0!=attendeeList->size() ) {
for (i = 0; i < attendeeList->size(); ++i) {
- LogDebug("Adding attendee "<<i+1<<" over "<<attendeeList->size());
+ LoggerD("Adding attendee "<<i+1<<" over "<<attendeeList->size());
attendee = NULL;
ret = calendar_record_create(_calendar_attendee._uri, &attendee);
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Attendee creation failed: "<<ret);
+ LoggerW("Attendee creation failed: "<<ret);
continue;
}
// save name
ret = calendar_record_set_str(attendee, _calendar_attendee.name, theAttendee->getName().c_str());
if (CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Cannot set attendee name: "<<ret);
+ LoggerW("Cannot set attendee name: "<<ret);
}
// save uri
ret = calendar_record_set_str(attendee, _calendar_attendee.email, theAttendee->getURI().c_str());
if (CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Cannot set attendee URI: "<<ret);
+ LoggerW("Cannot set attendee URI: "<<ret);
}
// save role
role = CALENDAR_ATTENDEE_ROLE_CHAIR;
break;
default:
- LogDebug("Use the default role");
+ LoggerD("Use the default role");
break;
}
ret = calendar_record_set_int(attendee, _calendar_attendee.role, role);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee role: "<<ret);
+ LoggerW("Cannot set attendee role: "<<ret);
}
// save status
status = CALENDAR_ATTENDEE_STATUS_IN_PROCESS;
break;
default:
- LogDebug("Use the default status");
+ LoggerD("Use the default status");
break;
}
ret = calendar_record_set_int(attendee, _calendar_attendee.status, status);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee status: "<<ret);
+ LoggerW("Cannot set attendee status: "<<ret);
}
// save RSVP
ret = calendar_record_set_int(attendee, _calendar_attendee.rsvp, theAttendee->getRSVP());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee RSVP: "<<ret);
+ LoggerW("Cannot set attendee RSVP: "<<ret);
}
// save type
ret = calendar_record_set_int(attendee, _calendar_attendee.type, theAttendee->getType());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee type: "<<ret);
+ LoggerW("Cannot set attendee type: "<<ret);
}
// save group
ret = calendar_record_set_str(attendee, _calendar_attendee.group, theAttendee->getGroup().c_str());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee group: "<<ret);
+ LoggerW("Cannot set attendee group: "<<ret);
}
// save delegatorURI
ret = calendar_record_set_str(attendee, _calendar_attendee.delegator_uri, theAttendee->getDelegatorURI().c_str());
if (CALENDAR_ERROR_NONE != ret ) {
- LogWarning("Cannot set attendee delegator uri "<<ret);
+ LoggerW("Cannot set attendee delegator uri "<<ret);
}
// save delegateURI
ret = calendar_record_set_str(attendee, _calendar_attendee.delegate_uri, theAttendee->getDelegateURI().c_str());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee delegate uri: "<<ret);
+ LoggerW("Cannot set attendee delegate uri: "<<ret);
}
// save contactId
ret = calendar_record_set_str(attendee, _calendar_attendee.uid, theAttendee->getContactId().c_str());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee uid: "<<ret);
+ LoggerW("Cannot set attendee uid: "<<ret);
}
// save addressBookId
std::stringstream ss(attendeeList->at(i)->getAddressBookId());
int addressBookId;
ss>>addressBookId;
- LogDebug("addressBookId: "<<addressBookId);
+ LoggerD("addressBookId: "<<addressBookId);
ret = calendar_record_set_int(attendee, _calendar_attendee.person_id, addressBookId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot set attendee address book id "<<ret);
+ LoggerW("Cannot set attendee address book id "<<ret);
}
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_add_child_record(m_platformEvent, _calendar_event.calendar_attendee, attendee);
}
if(CALENDAR_ERROR_NONE!=ret) {
- LogWarning("Cannot add attendee child record: "<<ret);
+ LoggerW("Cannot add attendee child record: "<<ret);
if(attendee) {
calendar_record_destroy(attendee, true);
}
}
}
} else {
- LogDebug("No attendee to save.");
+ LoggerD("No attendee to save.");
}
}
ret = calendar_record_set_double(m_platformEvent, _calendar_event.latitude, m_abstractEvent->getGeolocation()->getLatitude());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set latitude: "<<ret);
+ LoggerW("Can't set latitude: "<<ret);
}
if(CalendarEvent::TASK_TYPE==getType()) {
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set longitude: "<<ret);
+ LoggerW("Can't set longitude: "<<ret);
}
}
ret = calendar_record_set_int(m_platformEvent, _calendar_todo.priority, todoPriority);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set task priority: "<<ret);
+ LoggerW("Can't set task priority: "<<ret);
}
} else {
calendar_event_priority_e eventPriority = CALENDAR_EVENT_PRIORITY_NORMAL;
ret = calendar_record_set_int(m_platformEvent, _calendar_event.priority, eventPriority);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set event priority: "<<ret);
+ LoggerW("Can't set event priority: "<<ret);
}
}
}
ret = calendar_record_set_lli(m_platformEvent, _calendar_event.created_time, m_abstractEvent->getCreatedDate());
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set createde time: "<<ret);
+ LoggerW("Can't set createde time: "<<ret);
}
}
void EventWrapper::setCompletedDateToPlatformEvent()
{
if(CalendarEvent::EVENT_TYPE==getType()) {
- LogDebug("No need to set the completed date for an event.");
+ LoggerD("No need to set the completed date for an event.");
return;
}
int ret = calendar_record_set_lli(m_platformEvent, _calendar_todo.completed_time, m_abstractEvent->getCompletedDate());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning( "Can't set createde time: "<<ret);
+ LoggerW( "Can't set createde time: "<<ret);
}
}
void EventWrapper::setProgressToPlatformEvent()
{
if(CalendarEvent::EVENT_TYPE==getType()) {
- LogDebug("No need to set the progress for an event.");
+ LoggerD("No need to set the progress for an event.");
return;
}
int ret = calendar_record_set_int(m_platformEvent, _calendar_todo.progress, m_abstractEvent->getProgress());
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't set progress: "<<ret);
+ LoggerW("Can't set progress: "<<ret);
}
}
CalendarEventPtr EventWrapper::convertPlatformEventToAbstractEvent()
{
- LogDebug("Convert to abstract item.");
+ LoggerD("Convert to abstract item.");
setCalendarIdFromPlatformEvent();
setDescriptionFromPlatformEvent();
ret = calendar_record_get_int(m_platformEvent, _calendar_event.calendar_book_id, &calendarId);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get calenadrId: "<<ret);
+ LoggerW("Can't get calenadrId: "<<ret);
}
m_abstractEvent->setCalendarId(calendarId);
ret = calendar_record_get_str(m_platformEvent, _calendar_event.description, &description);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get description: "<<ret);
+ LoggerW("Can't get description: "<<ret);
}
if (description) {
ret = calendar_record_get_str(m_platformEvent, _calendar_event.summary, &summary);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get summary: "<<ret);
+ LoggerW("Can't get summary: "<<ret);
}
if (summary) {
ret = calendar_record_get_str(m_platformEvent, _calendar_event.start_tzid, &timeZone);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get time zone: "<<ret);
+ LoggerW("Can't get time zone: "<<ret);
}
if( timeZone ) {
- LogDebug("timeZone: "<<timeZone);
+ LoggerD("timeZone: "<<timeZone);
m_abstractEvent->setTimeZone(std::string(timeZone));
}
ret = calendar_record_get_caltime(m_platformEvent, _calendar_event.start_time, &cal);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get start time: "<<ret);
+ LoggerW("Can't get start time: "<<ret);
}
// Set the isAllDay flag also.
ret = calendar_record_get_caltime(m_platformEvent, _calendar_event.end_time, &cal);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get due/end time: "<<ret);
+ LoggerW("Can't get due/end time: "<<ret);
return;
}
ret = calendar_record_get_str(m_platformEvent, _calendar_event.location, &location);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get location: "<<ret);
+ LoggerW("Can't get location: "<<ret);
}
if (location) {
void EventWrapper::setRecurrenceRuleFromPlatformEvent()
{
if (CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set rrule for a task.");
+ LoggerD("No need to set rrule for a task.");
return;
}
int frequency;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.freq, &frequency);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get frequency: "<<ret);
+ LoggerW("Can't get frequency: "<<ret);
return;
}
- LogDebug("frequency "<<frequency);
+ LoggerD("frequency "<<frequency);
switch (frequency) {
case CALENDAR_RECURRENCE_NONE:
rrule->setFrequency(EventRecurrenceRule::NO_RECURRENCE);
rrule->setFrequency(EventRecurrenceRule::YEARLY_RECURRENCE);
break;
default:
- LogWarning("Unknown recurrence frequency.");
+ LoggerW("Unknown recurrence frequency.");
rrule->setFrequency(EventRecurrenceRule::NO_RECURRENCE);
return;
break;
char* byday = NULL;
ret = calendar_record_get_str(m_platformEvent, _calendar_event.byday, &byday);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get byday: "<<ret);
+ LoggerW("Can't get byday: "<<ret);
}
- LogDebug("Loaded byday: "<<byday);
+ LoggerD("Loaded byday: "<<byday);
if (byday) {
char *saveptr = NULL;
char* pch = strtok_r(byday, ",", &saveptr);
free(byday);
}
rrule->setDaysOfTheWeek(daysOfTheWeek);
- LogDebug("Number of daysOfTheWeek: "<<rrule->getDaysOfTheWeek()->size());
+ LoggerD("Number of daysOfTheWeek: "<<rrule->getDaysOfTheWeek()->size());
// load the recurrence interval
int interval;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.interval, &interval);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get interval: "<<ret);
+ LoggerW("Can't get interval: "<<ret);
}
rrule->setInterval(interval);
int occurrrenceCount;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.count, &occurrrenceCount);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get occurrrence count: "<<ret);
+ LoggerW("Can't get occurrrence count: "<<ret);
}
rrule->setOccurrenceCount(occurrrenceCount);
calendar_time_s cal = {CALENDAR_TIME_UTIME, {0}};
ret = calendar_record_get_caltime(m_platformEvent, _calendar_event.until_time, &cal);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get recurrence end date: "<<ret);
+ LoggerW("Can't get recurrence end date: "<<ret);
}
if(cal.time.utime>0) {
if(CALENDAR_RECORD_NO_UNTIL==cal.time.utime) {
} else {
rrule->setEndDate(UNDEFINED_TIME);
}
- LogDebug("endDate from platform = "<<rrule->getEndDate());
+ LoggerD("endDate from platform = "<<rrule->getEndDate());
// load the exceptions
NumberArrayPtr exceptions(new NumberArray());
char* exdate = NULL;
ret = calendar_record_get_str(m_platformEvent, _calendar_event.exdate, &exdate);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get exdate: "<<ret);
+ LoggerW("Can't get exdate: "<<ret);
}
- LogDebug("Loaded exdate: "<<exdate);
+ LoggerD("Loaded exdate: "<<exdate);
if (exdate) {
char *saveptr = NULL;
char *pch = strtok_r(exdate, ",", &saveptr);
free(exdate);
}
rrule->setExceptions(exceptions);
- LogDebug("Number of exceptions: "<<rrule->getExceptions()->size());
+ LoggerD("Number of exceptions: "<<rrule->getExceptions()->size());
// load the setPositions
NumberArrayPtr setPositions(new NumberArray());
char* bysetpos = NULL;
ret = calendar_record_get_str(m_platformEvent, _calendar_event.bysetpos, &bysetpos);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get bysetpos: "<<ret);
+ LoggerW("Can't get bysetpos: "<<ret);
}
- LogDebug("Loaded bysetpos: "<<bysetpos);
+ LoggerD("Loaded bysetpos: "<<bysetpos);
if (bysetpos) {
char *saveptr = NULL;
char *pch = strtok_r(bysetpos, ",", &saveptr);
free(bysetpos);
}
rrule->setSetPositions(setPositions);
- LogDebug("Number of setPositions: "<<rrule->getSetPositions()->size());
+ LoggerD("Number of setPositions: "<<rrule->getSetPositions()->size());
// set the loaded recurrence rule
m_abstractEvent->setRecurrenceRule(rrule);
ret = calendar_record_get_child_record_count(m_platformEvent, _calendar_event.calendar_alarm, &count);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get alarms count: "<<ret);
+ LoggerW("Can't get alarms count: "<<ret);
}
if(0==count) {
- LogDebug("No alarms to set.");
+ LoggerD("No alarms to set.");
return;
} else {
- LogDebug("Number of alarms: "<<count);
+ LoggerD("Number of alarms: "<<count);
}
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_clone_child_record_list(m_platformEvent, _calendar_event.calendar_alarm, &list);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get alarms list: "<<ret);
+ LoggerW("Can't get alarms list: "<<ret);
return;
}
calendar_record_h alarm = NULL;
for(i=0; i<count; i++)
{
- LogDebug("Processing the alarm #"<<i);
+ LoggerD("Processing the alarm #"<<i);
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_todo.calendar_alarm, i, &alarm);
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_event.calendar_alarm, i, &alarm);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get the alarm: "<<ret);
+ LoggerW("Can't get the alarm: "<<ret);
continue;
}
ret = calendar_record_get_int(alarm, _calendar_alarm.tick_unit, &tickUnit);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read alarm tick unit: "<<ret);
+ LoggerW("Cannot read alarm tick unit: "<<ret);
continue;
}
long long int time;
ret = calendar_record_get_lli(alarm, _calendar_alarm.time, &time);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get alarm tick: "<<ret);
+ LoggerW("Can't get alarm tick: "<<ret);
continue;
}
theAlarm->setAbsoluteDate(time);
- LogDebug("Loaded absolute date: "<<theAlarm->getAbsoluteDate());
+ LoggerD("Loaded absolute date: "<<theAlarm->getAbsoluteDate());
} else {
ret = calendar_record_get_int(alarm, _calendar_alarm.tick, &tick);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read alarm tick. Stop processing alarms.");
+ LoggerW("Cannot read alarm tick. Stop processing alarms.");
continue;
}
duration.unit = Time::DAYS_UNIT;
duration.length = tick*30;
} else {
- LogWarning("Wrong tick unit: "<<tickUnit);
+ LoggerW("Wrong tick unit: "<<tickUnit);
}
theAlarm->setDuration(duration);
int type;
ret = calendar_record_get_int(alarm, _calendar_alarm.type, &type);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read alarm type: "<<ret);
+ LoggerW("Cannot read alarm type: "<<ret);
continue;
}
theAlarm->setMethod((EventAlarm::EventAlarmType)type);
char* description = NULL;
ret = calendar_record_get_str(alarm, _calendar_alarm.description, &description);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read alarm description: "<<ret);
+ LoggerW("Cannot read alarm description: "<<ret);
theAlarm->setDescription("");
free(description);
} else {
- LogDebug("Alarm description: "<<description);
+ LoggerD("Alarm description: "<<description);
if(description) {
theAlarm->setDescription(description);
}
if(list) {
calendar_list_destroy(list, true);
}
- LogDebug("Number of alarms: "<<m_abstractEvent->getAlarms()->size());
+ LoggerD("Number of alarms: "<<m_abstractEvent->getAlarms()->size());
}
void EventWrapper::setStatusFromPlatformEvent()
ret = calendar_record_get_int(m_platformEvent, _calendar_event.event_status, &status);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get status: "<<ret);
+ LoggerW("Can't get status: "<<ret);
return;
}
ret = calendar_record_get_str(m_platformEvent, _calendar_event.categories, &categories);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get categories: "<<ret);
+ LoggerW("Can't get categories: "<<ret);
}
if( categories ) {
- LogDebug("Loaded categories: "<<categories);
+ LoggerD("Loaded categories: "<<categories);
char *saveptr = NULL;
char* pch = strtok_r(categories, ",", &saveptr);
free(categories);
}
- LogDebug("Number of categories: "<<m_abstractEvent->getCategories()->size());
+ LoggerD("Number of categories: "<<m_abstractEvent->getCategories()->size());
}
void EventWrapper::setIdFromPlatformEvent()
void EventWrapper::setRecurrenceIdFromPlatformEvent()
{
if(CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set the recurrence id for a task.");
+ LoggerD("No need to set the recurrence id for a task.");
return;
}
char* recurrenceId = NULL;
ret = calendar_record_get_str(m_platformEvent, _calendar_event.recurrence_id, &recurrenceId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get recurrence id: "<<ret);
+ LoggerW("Can't get recurrence id: "<<ret);
return;
}
std::stringstream ss(recurrenceId);
ss>>rid;
m_abstractEvent->setRecurrenceId(rid);
- LogDebug("Set the recurrence id: "<<rid);
+ LoggerD("Set the recurrence id: "<<rid);
} else {
m_abstractEvent->setRecurrenceId(UNDEFINED_TIME);
}
void EventWrapper::setParentIdFromPlatformEvent()
{
if(CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set the parent id for a task.");
+ LoggerD("No need to set the parent id for a task.");
return;
}
int ret, parentId;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.original_event_id, &parentId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get parent id: "<<ret);
+ LoggerW("Can't get parent id: "<<ret);
return;
}
void EventWrapper::setIsAllDayFromPlatformEvent()
{
- LogDebug("All day flag is set when getting the start time: "<<m_abstractEvent->getIsAllDay());
+ LoggerD("All day flag is set when getting the start time: "<<m_abstractEvent->getIsAllDay());
}
void EventWrapper::setOrganizerFromPlatformEvent()
ret = calendar_record_get_str(m_platformEvent, _calendar_event.organizer_name, &organizer);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get organizer: "<<ret);
+ LoggerW("Can't get organizer: "<<ret);
}
if (organizer) {
ret = calendar_record_get_lli(m_platformEvent, _calendar_event.last_modified_time, &lastModifiedDate);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get last modification time: "<<ret);
+ LoggerW("Can't get last modification time: "<<ret);
return;
}
ret = calendar_record_get_int(m_platformEvent, _calendar_event.sensitivity, &visibility);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get visibility: "<<ret);
+ LoggerW("Can't get visibility: "<<ret);
return;
}
void EventWrapper::setAvailabilityFromPlatformEvent()
{
if(CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set availability for a task.");
+ LoggerD("No need to set availability for a task.");
return;
}
int ret, availability;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.busy_status, &availability);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get visibility: "<<ret);
+ LoggerW("Can't get visibility: "<<ret);
return;
}
ret = calendar_record_get_str(m_platformEvent, _calendar_event.uid, &uid);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get uid: "<<ret);
+ LoggerW("Can't get uid: "<<ret);
}
if (uid) {
ret = calendar_record_get_child_record_count(m_platformEvent, _calendar_event.calendar_attendee, &count);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get attendee count: "<<ret);
+ LoggerW("Can't get attendee count: "<<ret);
return;
}
if(0==count) {
- LogDebug("No attendees to set.");
+ LoggerD("No attendees to set.");
return;
}
ret = calendar_record_clone_child_record_list(m_platformEvent, _calendar_event.calendar_attendee, &list);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get attendee list: "<<ret);
+ LoggerW("Can't get attendee list: "<<ret);
return;
}
for (i=0; i<count; i++)
{
- LogDebug("Processing the attendee #"<<i);
+ LoggerD("Processing the attendee #"<<i);
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_todo.calendar_attendee, i, &attendee);
ret = calendar_record_get_child_record_at_p(m_platformEvent, _calendar_event.calendar_attendee, i, &attendee);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get attendee record: "<<ret);
+ LoggerW("Can't get attendee record: "<<ret);
continue;
}
char* attendeeName = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.name, &attendeeName);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee name. Setting an empty string.");
+ LoggerW("Cannot read attendee name. Setting an empty string.");
attendeePtr->setName("");
} else {
if(attendeeName) {
char* attendeeURI = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.email, &attendeeURI);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee URI. Setting an empty string.");
+ LoggerW("Cannot read attendee URI. Setting an empty string.");
attendeePtr->setURI("");
} else {
if(attendeeURI) {
int attendeeRole;
ret = calendar_record_get_int(attendee, _calendar_attendee.role, &attendeeRole);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee role. Setting the default value.");
+ LoggerW("Cannot read attendee role. Setting the default value.");
}
switch (attendeeRole) {
case CALENDAR_ATTENDEE_ROLE_REQ_PARTICIPANT:
int attendeeStatus;
ret = calendar_record_get_int(attendee, _calendar_attendee.status, &attendeeStatus);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee status. Setting the default value.");
+ LoggerW("Cannot read attendee status. Setting the default value.");
}
switch (attendeeStatus) {
case CALENDAR_ATTENDEE_STATUS_PENDING:
int attendeeRSVP;
ret = calendar_record_get_int(attendee, _calendar_attendee.rsvp, &attendeeRSVP);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee RSVP. Setting the default value.");
+ LoggerW("Cannot read attendee RSVP. Setting the default value.");
}
attendeePtr->setRSVP(attendeeRSVP>0 ? true : false);
int attendeeType;
ret = calendar_record_get_int(attendee, _calendar_attendee.type, &attendeeType);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee type. Setting the default value.");
+ LoggerW("Cannot read attendee type. Setting the default value.");
}
attendeePtr->setType((EventAttendee::EventAttendeeType)attendeeType);
char* attendeeGroup = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.group, &attendeeGroup);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee group. Setting an empty string.");
+ LoggerW("Cannot read attendee group. Setting an empty string.");
attendeePtr->setGroup("");
} else {
if(attendeeGroup) {
char* attendeeDelegatorURI = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.delegator_uri, &attendeeDelegatorURI);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee delegatorURI. Setting an empty string.");
+ LoggerW("Cannot read attendee delegatorURI. Setting an empty string.");
attendeePtr->setDelegatorURI("");
} else {
if(attendeeDelegatorURI) {
char* attendeeDelegateURI = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.delegate_uri, &attendeeDelegateURI);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee delegateURI. Setting an empty string.");
+ LoggerW("Cannot read attendee delegateURI. Setting an empty string.");
attendeePtr->setDelegateURI("");
} else {
if(attendeeDelegateURI) {
char* attendeeContactId = NULL;
ret = calendar_record_get_str(attendee, _calendar_attendee.uid, &attendeeContactId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee UId. Setting an empty string.");
+ LoggerW("Cannot read attendee UId. Setting an empty string.");
attendeePtr->setContactId("");
} else {
if(attendeeContactId) {
// load addressBookId
int attendeeAddressBookId;
ret = calendar_record_get_int(attendee, _calendar_attendee.person_id, &attendeeAddressBookId);
- LogDebug("attendeeAddressBookId: "<<attendeeAddressBookId);
+ LoggerD("attendeeAddressBookId: "<<attendeeAddressBookId);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Cannot read attendee address book id. Setting an empty string.");
+ LoggerW("Cannot read attendee address book id. Setting an empty string.");
attendeeAddressBookId = -1;
}
std::stringstream ss;
ret = calendar_record_get_double(m_platformEvent, _calendar_event.latitude, &value);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get item latitude.");
+ LoggerW("Can't get item latitude.");
return;
}
m_abstractEvent->getGeolocation()->setLatitude(value);
ret = calendar_record_get_double(m_platformEvent, _calendar_event.longitude, &value);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get item longitude.");
+ LoggerW("Can't get item longitude.");
return;
}
m_abstractEvent->getGeolocation()->setLongitude(value);
if(CalendarEvent::TASK_TYPE==getType()) {
ret = calendar_record_get_int(m_platformEvent, _calendar_todo.priority, &priority);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get task priority: "<<ret);
+ LoggerW("Can't get task priority: "<<ret);
return;
}
} else {
ret = calendar_record_get_int(m_platformEvent, _calendar_event.priority, &priority);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get event priority: "<<ret);
+ LoggerW("Can't get event priority: "<<ret);
return;
}
ret = calendar_record_get_lli(m_platformEvent, _calendar_event.created_time, &createdDate);
}
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get created date: "<<ret);
+ LoggerW("Can't get created date: "<<ret);
return;
}
void EventWrapper::setCompletedDateFromPlatformEvent()
{
if(CalendarEvent::EVENT_TYPE==getType()) {
- LogDebug("No need to set completedDate for an event.");
+ LoggerD("No need to set completedDate for an event.");
return;
}
ret = calendar_record_get_lli(m_platformEvent, _calendar_todo.completed_time, &completedDate);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get completed date: "<<ret);
+ LoggerW("Can't get completed date: "<<ret);
return;
}
void EventWrapper::setProgressFromPlatformEvent()
{
if(CalendarEvent::EVENT_TYPE==getType()) {
- LogDebug("No need to set progress for an event.");
+ LoggerD("No need to set progress for an event.");
return;
}
int progress = 0;
ret = calendar_record_get_int(m_platformEvent, _calendar_todo.progress, &progress);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get progress: "<<ret);
+ LoggerW("Can't get progress: "<<ret);
return;
}
void EventWrapper::setIsDetachedFromPlatformEvent()
{
if(CalendarEvent::TASK_TYPE==getType()) {
- LogDebug("No need to set isDetached flag for a task.");
+ LoggerD("No need to set isDetached flag for a task.");
return;
}
int isDetached;
ret = calendar_record_get_int(m_platformEvent, _calendar_event.original_event_id, &isDetached);
if (CALENDAR_ERROR_NONE != ret) {
- LogWarning("Can't get isDetached: "<<ret);
+ LoggerW("Can't get isDetached: "<<ret);
return;
}
if (isDetached>0) {
m_abstractEvent->setIsDetached(true);
- LogDebug("This is a detached event.");
+ LoggerD("This is a detached event.");
} else {
m_abstractEvent->setIsDetached(false);
}
void EventWrapper::displayPlatformEvent()
{
- LogDebug("Displaying platform itemt disabled.");
+ LoggerD("Displaying platform itemt disabled.");
}
CalendarEvent::CalendarType EventWrapper::getType()
#include "ICalendar.h"
#include <Commons/ThreadPool.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
#include <string>
#include <sstream>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include "CalendarEvent.h"
#include "IEventAddEvent.h"
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include "ICalendar.h"
#include "EventId.h"
#include "CalendarFactory.h"
#include "CalendarAsyncCallbackManager.h"
#include "CalendarListenerManager.h"
-
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
void JSCalendar::initialize(JSContextRef context, JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar private object.");
+ LoggerD("Create calendar private object.");
ICalendarPtr calendar = CalendarFactory::getInstance().createCalendarObject();
CalendarPrivObject *priv = new CalendarPrivObject(context, calendar);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
calendar->addEvent(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Add result successful.");
+ LoggerD("Add result successful.");
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} else {
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
cbm->setObject(thisObject);
- LogDebug("Proceed the event to the platform.");
+ LoggerD("Proceed the event to the platform.");
IEventAddEventsPtr dplEvent(new IEventAddEvents());
dplEvent->setCalendarType(calendar->getType());
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
cbm->setObject(thisObject);
- LogDebug("Proceed the event to the platform.");
+ LoggerD("Proceed the event to the platform.");
IEventUpdateEventsPtr dplEvent(new IEventUpdateEvents());
dplEvent->setEvents(items);
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
calendar->deleteEvent(dplEvent);
if (dplEvent->getResult()) {
- LogInfo("Successfully deleted.");
+ LoggerI("Successfully deleted.");
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} else {
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
if (!itemIds) {
ThrowMsg(ConversionException, "Parameter conversion failed.");
} else {
- LogDebug("Array length: "<<itemIds->size());
+ LoggerD("Array length: "<<itemIds->size());
}
} else if (JSValueIsString(context, element)) {
std::vector<std::string> idStrings = converter.toVectorOfStrings(arguments[0]);
cbm->setObject(thisObject);
- LogDebug("Proceed the event to the platform.");
+ LoggerD("Proceed the event to the platform.");
IEventDeleteEventsPtr dplEvent(new IEventDeleteEvents());
dplEvent->setEventIds(itemIds);
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
cbm->setObject(thisObject);
- LogDebug("Proceed the find event to the platform.");
+ LoggerD("Proceed the find event to the platform.");
IEventFindEventsPtr dplEvent(new IEventFindEvents());
dplEvent->setCalendarType(calendar->getType());
if (JSValueIsObject(context, arguments[2])) {
dplEvent->setGenericFilter(filterConverter->toFilter(arguments[2]));
} else if (JSValueIsNull(context, arguments[2]) || JSValueIsUndefined(context, arguments[2])) {
- LogDebug("Use default filter.");
+ LoggerD("Use default filter.");
} else {
ThrowMsg(ConversionException, "Wrong third parameter type.");
}
sortModes->push_back(filterConverter->toSortMode(arguments[3]));
dplEvent->setSortModes(sortModes);
} else if (JSValueIsNull(context, arguments[3]) || JSValueIsUndefined(context, arguments[3])) {
- LogDebug("Use default sort mode.");
+ LoggerD("Use default sort mode.");
} else {
ThrowMsg(ConversionException, "Wrong fourth parameter type.");
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
// Process the found item.
if (dplEvent->getResult()) {
- LogDebug("Successfully got an item.");
+ LoggerD("Successfully got an item.");
if (CalendarEvent::EVENT_TYPE==calendar->getType()) {
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
// Use global context for the expandRecurrence api in event.
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
JSCallbackManagerPtr onUpdatedCbm = JSCallbackManager::createObject(globalContext, result.onUpdated, NULL);
JSCallbackManagerPtr onDeletedCbm = JSCallbackManager::createObject(globalContext, result.onDeleted, NULL);
- LogDebug("Make change emitter and process sync operation.");
+ LoggerD("Make change emitter and process sync operation.");
CalendarChangeCallbackPrivateDataPtr privData(new CalendarChangeCallbackPrivateData(
onAddedCbm, onUpdatedCbm, onDeletedCbm));
DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast<DeviceAPI::Common::IListenerItem>(canceller);
CalendarListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
- LogDebug("Returning the watchId "<<watchId);
+ LoggerD("Returning the watchId "<<watchId);
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return converter.toJSValueRefLong(watchId);
} else {
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
ThrowMsg(ConversionException, "Wrong parameter type.");
}
- LogDebug("Make sync operation with watchId: "<<watchId);
+ LoggerD("Make sync operation with watchId: "<<watchId);
IEventClearWatchPtr dplEvent(new IEventClearWatch());
dplEvent->setWatchId(watchId);
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
#include "JSCalendarAlarm.h"
#include "CalendarConverter.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include <TimeUtilConverter.h>
#include <JSTZDate.h>
#include <JSTimeDuration.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
}
Catch(Exception)
{
- LogError("Error during replacing alarm object.");
+ LoggerE("Error during replacing alarm object.");
}
}
EventAlarmPtr alarm( new EventAlarm() );
if (JSValueIsObjectOfClass(context, arguments[0], JSTZDate::getClassRef())){
- LogDebug("absoluteDate case");
+ LoggerD("absoluteDate case");
long long int absoluteDate = (long long int) (timeConverter.getTimeInMilliseconds(arguments[0])/1000);
alarm->setAbsoluteDate(absoluteDate);
alarm->setTimeZone(timeConverter.getPropertiesInTZDate(arguments[0]).timezone);
alarm->setDescription(converter.toString(arguments[2]));
}
} else if (JSValueIsObjectOfClass(context, arguments[0], JSTimeDuration::getClassRef())){
- LogDebug("before case");
+ LoggerD("before case");
alarm->setDuration(timeConverter.getDurationPropertis(arguments[0]));
if (argumentCount>=2) {
}
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());
}
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar alarm private object.");
+ LoggerD("Create calendar alarm private object.");
EventAlarmPtr alarm( new EventAlarm() );
EventAlarmPrivateObject *priv = new EventAlarmPrivateObject(context, alarm);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_DESCRIPTION)) {
return converter.toJSValueRef(alarm->getDescription());
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_CALENDAR_ALARM_METHOD)) {
- LogDebug("Alarm method: "<<converter.toTizenValue(alarm->getMethod()));
+ LoggerD("Alarm method: "<<converter.toTizenValue(alarm->getMethod()));
return converter.toJSValueRef(converter.toTizenValue(alarm->getMethod()));
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
// limitations under the License.
//
-
#include "JSCalendarAttendee.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include <ContactConverter.h>
#include <DurationProperties.h>
#include <ContactRef.h>
-
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar attendee private object.");
+ LoggerD("Create calendar attendee private object.");
EventAttendeePtr attendee( new EventAttendee() );
AttendeePrivateObject *priv = new AttendeePrivateObject(context, attendee);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
}
Catch(Exception)
{
- LogError("Error during replacing attendee object");
+ LoggerE("Error during replacing attendee object");
}
}
}
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());
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
// limitations under the License.
//
-
#include <ctime>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <SecurityExceptions.h>
-
#include "CalendarAsyncCallbackManager.h"
#include <GlobalContextManager.h>
#include <TimeTracer.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar event private object.");
+ LoggerD("Create calendar event private object.");
CalendarEventPtr event( new CalendarEvent() );
CalendarEventPrivObject *priv = new CalendarEventPrivObject(context, event);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
if (m_calendar) {
m_calendar->setType(CalendarEvent::EVENT_TYPE);
- LogDebug("Calendar object type is set to event.");
+ LoggerD("Calendar object type is set to event.");
}
}
CalendarEventPtr result(new CalendarEvent());
event = result;
} else if (argumentCount==1) {
- LogInfo("eventInitDict case");
+ LoggerI("eventInitDict case");
if (JSValueIsUndefined(context, arguments[0]) || JSValueIsNull(context, arguments[0])) {
CalendarEventPtr result(new CalendarEvent());
event = result;
ThrowMsg(ConversionException, "Parameter conversion failed.");
}
} else if (argumentCount>=2) {
- LogInfo("event stringRepresentation case");
+ LoggerI("event stringRepresentation case");
std::string eventStr;
CalendarEvent::VObjectFormat format = CalendarEvent::UNDEFINED_FORMAT;
eventStr = converter.toString(arguments[0]);
// Process the returned object.
if (dplEvent->getResult()) {
- LogInfo("Successfully created an event.");
+ LoggerI("Successfully created an event.");
event = dplEvent->getEvent();
} else {
if (dplEvent->getExceptionCode()==ExceptionCodes::InvalidArgumentException) {
}
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());
}
}
Catch(Exception)
{
- LogError("Error during replacing event object");
+ LoggerE("Error during replacing event object");
}
}
if (argumentCount>=1) {
if (JSValueIsObjectOfClass(context, arguments[0], JSTZDate::getClassRef())) {
startDate = (long long int) (timeConverter.getTimeInMilliseconds(arguments[0])/1000);
- LogInfo("startDate: "<<startDate);
+ LoggerI("startDate: "<<startDate);
} else {
ThrowMsg(ConversionException, "Wrong first parameter type.");
}
if (argumentCount>=2) {
if (JSValueIsObjectOfClass(context, arguments[1], JSTZDate::getClassRef())) {
endDate = (long long int) (timeConverter.getTimeInMilliseconds(arguments[1])/1000);
- LogInfo("endDate: "<<endDate);
+ LoggerI("endDate: "<<endDate);
} else {
ThrowMsg(ConversionException, "Wrong second parameter type.");
}
cbm->setObject(thisObject);
- LogDebug("Proceed the expand event to the platform.");
+ LoggerD("Proceed the expand event to the platform.");
IEventExpandEventRecurrencePtr dplEvent(new IEventExpandEventRecurrence());
dplEvent->setPrivateData(DPL::StaticPointerCast<IEventPrivateData>(cbm));
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
CalendarEventPtr event = getPrivateObject(object);
EventRecurrenceRulePtr rrule;
if (event->getIsDetached()) {
- LogDebug("This is a detached event.");
+ LoggerD("This is a detached event.");
return JSValueMakeUndefined(context);
} else {
rrule = event->getRecurrenceRule();
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
{
event = getPrivateObject(object);
if (event->getIsDetached()) {
- LogWarning("Can't set the recurrenceRule of a detached event!");
+ LoggerW("Can't set the recurrenceRule of a detached event!");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::NOT_SUPPORTED_ERROR);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
// limitations under the License.
//
-
#include "JSCalendarEventId.h"
#include "CalendarConverter.h"
-#include <dpl/log/log.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include <CommonsJavaScript/Converter.h>
#include <TimeUtilConverter.h>
#include <JSTZDate.h>
#include <sstream>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
Catch(Exception)
{
- LogError("Error during replacing event id object.");
+ LoggerE("Error during replacing event id object.");
}
}
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar event id private object.");
+ LoggerD("Create calendar event id private object.");
EventIdPtr eventId( new EventId() );
EventIdPrivateObject *priv = new EventIdPrivateObject(context, eventId);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
}
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());
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
// limitations under the License.
//
-
#include <ctime>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSCalendarEvent.h"
#include "JSCalendarTask.h"
#include "plugin_config.h"
-
#include <GlobalContextManager.h>
#include <TimeTracer.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar item private object.");
+ LoggerD("Create calendar item private object.");
CalendarEventPtr item( new CalendarEvent() );
CalendarItemPropertiesPrivObject *priv = new CalendarItemPropertiesPrivObject(context, item);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
}
Catch(Exception)
{
- LogError("Error during replacing event object");
+ LoggerE("Error during replacing event object");
}
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
TimeUtilConverter timeConverter(context);
CalendarEventPtr event = privateObject->getObject();
- LogInfo("start time before converted to TZDate: "<<event->getStartTime()<<", time zone: "<<event->getTimeZone());
+ LoggerI("start time before converted to TZDate: "<<event->getStartTime()<<", time zone: "<<event->getTimeZone());
if (UNDEFINED_TIME==event->getStartTime()) {
return JSValueMakeUndefined(context);
} else {
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
if(item->getCategoriesJSRef()) {
return item->getCategoriesJSRef();
} else {
- LogDebug("Create a JS object for categories.");
+ LoggerD("Create a JS object for categories.");
StringArrayPtr categories = item->getCategories();
JSValueRef jsCategories = converter.toJSValueRefStringArray(categories);
item->setCategoriesJSRef(converter.toJSObjectRef(jsCategories));
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
CalendarEventPtr item = getPrivateObject(object);
if(UNDEFINED_TIME==item->getStartTime() || UNDEFINED_TIME==item->getEndTime()) {
- LogDebug("Start or end time is not defined.");
+ LoggerD("Start or end time is not defined.");
return JSValueMakeUndefined(context);
}
TimeUtilConverter converter(context);
long long length = item->getEndTime() - item->getStartTime(); // in seconds only
- LogDebug("item->getStartTime():"<< item->getStartTime() << ", length:" << length);
+ LoggerD("item->getStartTime():"<< item->getStartTime() << ", length:" << length);
return converter.makeMillisecondDurationObject( length*1000 );
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar manager private object.");
+ LoggerD("Create calendar manager private object.");
ICalendarManagerPtr calendarManager = CalendarFactory::getInstance().createCalendarManagerObject();
CalendarManagerPrivObject *privateObject = new CalendarManagerPrivObject(context, calendarManager);
if (!JSObjectSetPrivate(object, static_cast<void*>(privateObject))) {
delete privateObject;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return converter.toJSValueRefCalendar(dplEvent->getCalendar());
} else {
- LogError("Default calendar not found.");
+ LoggerE("Default calendar not found.");
}
} else {
ThrowMsg(UnknownException, "Getting a default calendar failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
if (dplEvent->getResult()) {
if( dplEvent->getCalendar() ) {
- LogDebug("Successfully got a unified calendar.");
+ LoggerD("Successfully got a unified calendar.");
return converter.toJSValueRefCalendar(dplEvent->getCalendar());
} else {
- LogError("Unified calendar not found.");
+ LoggerE("Unified calendar not found.");
}
} else {
ThrowMsg(UnknownException, "Getting a unified calendar failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
// limitations under the License.
//
-
#include "JSCalendarRecurrenceRule.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include "CalendarConverter.h"
#include <TimeUtilConverter.h>
#include <JSTZDate.h>
-
#include <GlobalContextManager.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
void JSCalendarRecurrenceRule::initialize(JSContextRef context, JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar rrule private object.");
+ LoggerD("Create calendar rrule private object.");
EventRecurrenceRulePtr rrule( new EventRecurrenceRule() );
RecurrenceRulePrivateObject *priv = new RecurrenceRulePrivateObject(context, rrule);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
}
Catch(Exception)
{
- LogError("Error during replacing rrule object.");
+ LoggerE("Error during replacing rrule object.");
}
}
}
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());
}
if(rrule->getDaysOfTheWeekJSRef()) {
return rrule->getDaysOfTheWeekJSRef();
} else {
- LogDebug("Create a JS object for daysOfTheWeek.");
+ LoggerD("Create a JS object for daysOfTheWeek.");
StringArrayPtr daysOfTheWeek = rrule->getDaysOfTheWeek();
JSValueRef jsDaysOfTheWeek = converter.toJSValueRefStringArray(daysOfTheWeek);
rrule->setDaysOfTheWeekJSRef(converter.toJSObjectRef(jsDaysOfTheWeek));
if(rrule->getSetPositionsJSRef()) {
return rrule->getSetPositionsJSRef();
} else {
- LogDebug("Create a JS object for setPositions.");
+ LoggerD("Create a JS object for setPositions.");
NumberArrayPtr setPositions = rrule->getSetPositions();
JSValueRef jsSetPositions = converter.toJSValueRefNumberArray(setPositions);
rrule->setSetPositionsJSRef(converter.toJSObjectRef(jsSetPositions));
if(rrule->getExceptionsJSRef()) {
return rrule->getExceptionsJSRef();
} else {
- LogDebug("Create a JS object for exceptions with time zone: "<<rrule->getTimeZone());
+ LoggerD("Create a JS object for exceptions with time zone: "<<rrule->getTimeZone());
NumberArrayPtr exceptions = rrule->getExceptions();
JSValueRef jsExceptions = converter.toJSValueRefTZDateArray(exceptions, rrule->getTimeZone());
rrule->setExceptionsJSRef(converter.toJSObjectRef(jsExceptions));
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return true;
// limitations under the License.
//
-
#include <ctime>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTZDate.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
-
#include <GlobalContextManager.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create calendar task private object.");
+ LoggerD("Create calendar task private object.");
CalendarEventPtr task( new CalendarEvent() );
CalendarTaskPrivObject *priv = new CalendarTaskPrivObject(context, task);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
if (m_calendar) {
m_calendar->setType(CalendarEvent::TASK_TYPE);
- LogDebug("Calendar object type is set to task.");
+ LoggerD("Calendar object type is set to task.");
}
}
CalendarEventPtr result(new CalendarEvent());
task = result;
} else if (argumentCount==1) {
- LogInfo("taskInitDict case");
+ LoggerI("taskInitDict case");
if (JSValueIsUndefined(context, arguments[0]) || JSValueIsNull(context, arguments[0])) {
CalendarEventPtr result(new CalendarEvent());
task = result;
ThrowMsg(ConversionException, "Parameter conversion failed.");
}
} else if (argumentCount>=2) {
- LogInfo("task stringRepresentation case");
+ LoggerI("task stringRepresentation case");
std::string eventStr;
CalendarEvent::VObjectFormat format = CalendarEvent::UNDEFINED_FORMAT;
eventStr = converter.toString(arguments[0]);
// Process the returned object.
if (dplEvent->getResult()) {
- LogInfo("Successfully created a task.");
+ LoggerI("Successfully created a task.");
task = dplEvent->getEvent();
} else {
if (dplEvent->getExceptionCode()==ExceptionCodes::InvalidArgumentException) {
}
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());
}
}
Catch(Exception)
{
- LogError("Error during replacing task object");
+ LoggerE("Error during replacing task object");
}
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include <TimeTracer.h>
#include <GlobalContextManager.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Calendar {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Calendar] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Calendar] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Calendar] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Calendar] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Calendar");
TIME_TRACER_RELEASE();
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Calendar] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\Calendar] on_frame_load_callback (" << context << ")");
DeviceAPI::Common::GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Calendar] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\Calendar] on_frame_unload_callback (" << context << ")");
CalendarAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
CalendarListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
CallHistory::CallHistory()
{
- LogDebug("Enter ");
+ LoggerD("Enter ");
if (contacts_connect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to connect Call history DB ");
+ LoggerD("Successful to connect Call history DB ");
} else {
- LogDebug("Failed to connect Call history DB ");
+ LoggerD("Failed to connect Call history DB ");
}
EventCallHistoryPtr event(new EventCallHistory());
CallHistory::~CallHistory()
{
- LogDebug("Enter ");
+ LoggerD("Enter ");
if (contacts_disconnect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to disconnect Call history DB ");
+ LoggerD("Successful to disconnect Call history DB ");
} else {
- LogDebug("Failed to disconnect Call history DB ");
+ LoggerD("Failed to disconnect Call history DB ");
}
int ret = CONTACTS_ERROR_NONE;
ret = contacts_db_remove_changed_cb_with_info(_contacts_phone_log._uri, callhistoryListenerCB, it->Get());
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory remove listener error [" << ret << "]");
+ LoggerD("callhistory remove listener error [" << ret << "]");
}
it = CallHistory::m_watchers.erase(it);
}
- LogDebug("CallHistory Watcher is removed. (" << CallHistory::m_watchers.size() << ")");
+ LoggerD("CallHistory Watcher is removed. (" << CallHistory::m_watchers.size() << ")");
}
EventCallHistoryPtr event(new EventCallHistory());
void CallHistory::removeBatchCB(int error, void *user_data)
{
- LogDebug("enter");
+ LoggerD("enter");
if (user_data != NULL) {
CallHistory* chManager = (CallHistory *)((EventCallHistoryPtrs<EventRemoveBatch> *)user_data)->getThisPtr();
void CallHistory::removeAllCB(int error, void *user_data)
{
- LogDebug("enter");
+ LoggerD("enter");
if (user_data != NULL) {
CallHistory* chManager = (CallHistory *)((EventCallHistoryPtrs<EventRemoveAll> *)user_data)->getThisPtr();
for (;it < CallHistory::m_watchers.end();) {
- LogDebug("removeListener : id ["<<id<<"]");
- LogDebug("removeListener : handle() ["<<(*it)->getHandle()<<"]");
+ LoggerD("removeListener : id ["<<id<<"]");
+ LoggerD("removeListener : handle() ["<<(*it)->getHandle()<<"]");
if (id == (*it)->getHandle()) {
flag = true;
ret = contacts_db_remove_changed_cb_with_info(_contacts_phone_log._uri, callhistoryListenerCB, it->Get());
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory remove listener error [" << ret << "]");
+ LoggerD("callhistory remove listener error [" << ret << "]");
}
it = CallHistory::m_watchers.erase(it);
if (record == NULL) {
ret = contacts_list_next(*recordList);
if (ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NO_DATA) {
- LogDebug("callhistory parse error [" << ret << "]");
+ LoggerD("callhistory parse error [" << ret << "]");
return false;
} else {
continue;
ret = contacts_list_next(*recordList);
if (ret != CONTACTS_ERROR_NONE && ret != CONTACTS_ERROR_NO_DATA) {
- LogDebug("callhistory parse error [" << ret << "]");
+ LoggerD("callhistory parse error [" << ret << "]");
return false;
}
}
try {
if (event->getCmdType() == EventCallHistory::CONNECT) {
if (contacts_connect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to connect Call history DB by sub thread");
+ LoggerD("Successful to connect Call history DB by sub thread");
} else {
- LogDebug("Failed to connect Call history DB by sub thread");
+ LoggerD("Failed to connect Call history DB by sub thread");
}
} else if (event->getCmdType() == EventCallHistory::DISCONNECT) {
if (contacts_disconnect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to disconnect Call history DB by sub thread");
+ LoggerD("Successful to disconnect Call history DB by sub thread");
} else {
- LogDebug("Failed to disconnect Call history DB by sub thread");
+ LoggerD("Failed to disconnect Call history DB by sub thread");
}
}
} catch (const Commons::PlatformException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
void CallHistory::OnRequestReceived(const EventFindCallHistoryPtr& event)
{
try {
- LogDebug("enter");
+ LoggerD("enter");
CallHistoryEntryListPtr callHistoryListPtr(new CallHistoryEntryList());
int ret = CONTACTS_ERROR_NONE;
}
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory query error [" << ret << "]");
+ LoggerD("callhistory query error [" << ret << "]");
}
ret = contacts_db_get_records_with_query(query, offset, limit, &recordList);
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory query error [" << ret << "]");
+ LoggerD("callhistory query error [" << ret << "]");
}
if (parseRecord(&recordList, callHistoryListPtr)) {
contacts_query_destroy(query);
contacts_filter_destroy(filter);
} catch (const Commons::PlatformException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
m_removeBatchEvent.push_back(eventData);
event->switchToManualAnswer();
} else {
- LogDebug("callhistory remove Batch error [" << ret << "]");
+ LoggerD("callhistory remove Batch error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
} else {
ret = contacts_db_delete_records(_contacts_phone_log._uri, list, entryIds.size());
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory remove Batch error [" << ret << "]");
+ LoggerD("callhistory remove Batch error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
}
} catch (const Commons::PlatformException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
contacts_list_get_count(record_list, &total);
list = new int[total];
- LogDebug("total [" << total << "]");
+ LoggerD("total [" << total << "]");
for (unsigned int i = 0; i < total; i++) {
ret = contacts_list_get_current_record_p(record_list, &record);
if (record == NULL) {
ret = contacts_list_next(record_list);
if ( !(ret==CONTACTS_ERROR_NONE || ret==CONTACTS_ERROR_NO_DATA) ){
- LogDebug("callhistory remove All error [" << ret << "]");
+ LoggerD("callhistory remove All error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
continue;
value = 0;
ret = contacts_list_next(record_list);
if ( !(ret==CONTACTS_ERROR_NONE || ret==CONTACTS_ERROR_NO_DATA) ){
- LogDebug("callhistory remove All error [" << ret << "]");
+ LoggerD("callhistory remove All error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
- LogDebug("cnt [" << cnt << "]");
+ LoggerD("cnt [" << cnt << "]");
if (cnt > 0) {
EventRemoveAllDataPtr eventData( new EventCallHistoryPtrs<EventRemoveAll>(event, this));
m_removeAllEvent.push_back(eventData);
event->switchToManualAnswer();
} else {
- LogDebug("callhistory remove All error [" << ret << "]");
+ LoggerD("callhistory remove All error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
} else {
ret = contacts_db_delete_records(_contacts_phone_log._uri, list, cnt);
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory remove All error [" << ret << "]");
+ LoggerD("callhistory remove All error [" << ret << "]");
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
}
contacts_list_destroy(record_list, true);
} catch (const Commons::PlatformException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
for (it = m_removeBatchEvent.begin(); it != m_removeBatchEvent.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
m_removeBatchEvent.erase(it);
- LogDebug("event is removed. (" << m_removeBatchEvent.size() << ")");
+ LoggerD("event is removed. (" << m_removeBatchEvent.size() << ")");
break;
}
}
for (it = m_removeAllEvent.begin(); it != m_removeAllEvent.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
m_removeAllEvent.erase(it);
- LogDebug("event is removed. (" << m_removeAllEvent.size() << ")");
+ LoggerD("event is removed. (" << m_removeAllEvent.size() << ")");
break;
}
}
{
m_missedCallList = MissedCallListPtr(new MissedCallList());
if (contacts_connect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to connect Call history DB ");
+ LoggerD("Successful to connect Call history DB ");
} else {
- LogDebug("Failed to connect Call history DB ");
+ LoggerD("Failed to connect Call history DB ");
}
}
CallHistory::Watcher::~Watcher()
{
if (contacts_disconnect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to disconnect Call history DB ");
+ LoggerD("Successful to disconnect Call history DB ");
} else {
- LogDebug("Failed to disconnect Call history DB ");
+ LoggerD("Failed to disconnect Call history DB ");
}
}
if (entryList == NULL)
return;
- LogDebug("enter");
+ LoggerD("enter");
EventCallHistoryListenerPtr event(new EventCallHistoryListener());
event->setResultState(state);
if (entryList == NULL)
return;
- LogDebug("enter");
+ LoggerD("enter");
EventCallHistoryListenerPtr event(new EventCallHistoryListener());
event->setResultState(state);
void CallHistory::Watcher::ListenerCB(char* changes)
{
- LogDebug("enter");
+ LoggerD("enter");
char seps[] = ",:";
char* tokenType = NULL;
while( tokenType != NULL )
{
tokenId = strtok( NULL, seps );
- LogDebug("[ %s / %s ]", tokenType , tokenId );
+ LoggerD("[ %s / %s ]", tokenType , tokenId );
changeType = atoi((const char*)tokenType);
changeId = atoi((const char*)tokenId);
ret = contacts_query_set_sort(query, _contacts_phone_log.id, false);
if (ret != CONTACTS_ERROR_NONE) {
- LogDebug("callhistory query error [" << ret << "]");
+ LoggerD("callhistory query error [" << ret << "]");
}
ret = contacts_db_get_records_with_query(query, 0, 1, &recordList);
contacts_list_destroy(recordList, true);
contacts_query_destroy(query);
contacts_filter_destroy(filter);
- LogDebug("callhistory query error [" << ret << "]");
+ LoggerD("callhistory query error [" << ret << "]");
return;
}
// limitations under the License.
//
-
#include "CallHistoryEntry.h"
-
#include <Commons/Exception.h>
#include <dpl/shared_ptr.h>
-#include <dpl/log/log.h>
#include <contacts.h>
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
using namespace WrtDeviceApis;
CallHistoryEntry::CallHistoryEntry()
{
if (contacts_connect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to connect Call history DB ");
+ LoggerD("Successful to connect Call history DB ");
} else {
- LogDebug("Failed to connect Call history DB ");
+ LoggerD("Failed to connect Call history DB ");
}
}
CallHistoryEntry::~CallHistoryEntry()
{
if (contacts_disconnect2() == CONTACTS_ERROR_NONE) {
- LogDebug("Successful to disconnect Call history DB ");
+ LoggerD("Successful to disconnect Call history DB ");
} else {
- LogDebug("Failed to disconnect Call history DB ");
+ LoggerD("Failed to disconnect Call history DB ");
}
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <iomanip>
-
#include "CallHistoryDefine.h"
#include "CallHistoryFilter.h"
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
void CallHistoryFilter::visitPreComposite(FilterType& type, int depth)
{
- LogDebug(" type [" << type << "] depth[" << depth << "]");
+ LoggerD(" type [" << type << "] depth[" << depth << "]");
contacts_filter_h filter = NULL;
contacts_filter_create(_contacts_phone_log._uri, &filter);
if (filter != NULL) {
m_filterStack.push(filter);
}
- LogDebug("filter stack size [" << m_filterStack.size() << "]");
+ LoggerD("filter stack size [" << m_filterStack.size() << "]");
}
void CallHistoryFilter::visitInComposite(FilterType& type, int depth)
{
- LogDebug("type [" << type << "] depth[" << depth << "]");
+ LoggerD("type [" << type << "] depth[" << depth << "]");
contacts_filter_h filter = m_filterStack.top();
if(type == DeviceAPI::Tizen::UNION_FILTER)
contacts_filter_add_operator(filter, CONTACTS_FILTER_OPERATOR_OR);
else if(type == DeviceAPI::Tizen::INTERSECTION_FILTER)
contacts_filter_add_operator(filter, CONTACTS_FILTER_OPERATOR_AND);
- LogDebug("filter stack size [" << m_filterStack.size() << "]");
+ LoggerD("filter stack size [" << m_filterStack.size() << "]");
}
void CallHistoryFilter::visitPostComposite(FilterType& type, int depth)
{
- LogDebug(" type [" << type << "] depth[" << depth << "]");
+ LoggerD(" type [" << type << "] depth[" << depth << "]");
contacts_filter_h filter = m_filterStack.top();
if (m_filterStack.size() > 1) {
m_filterStack.pop();
contacts_filter_add_filter(filterParent, filter);
contacts_filter_destroy(filter);
}
- LogDebug("filter stack size [" << m_filterStack.size() << "]");
+ LoggerD("filter stack size [" << m_filterStack.size() << "]");
}
void CallHistoryFilter::visitAttribute(std::string& attrName, MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& matchValue, int depth)
return;
}
- LogDebug("attrName [" << attrName << "] matchValue[" << matchValue->toString() << "] depth[" << depth << "]");
+ LoggerD("attrName [" << attrName << "] matchValue[" << matchValue->toString() << "] depth[" << depth << "]");
contacts_filter_h filter = m_filterStack.top();
contacts_filter_h subFilter = NULL;
contacts_filter_create(_contacts_phone_log._uri, &subFilter);
if(initialValue == NULL || endValue == NULL)
return;
- LogDebug("attrName [" << attrName << "] initialValue[" << initialValue->toString() << "] endValue[" << endValue->toString() << "] depth[" << depth <<"]");
+ LoggerD("attrName [" << attrName << "] initialValue[" << initialValue->toString() << "] endValue[" << endValue->toString() << "] depth[" << depth <<"]");
contacts_filter_h filter = m_filterStack.top();
unsigned int propertyId = 0;
iValue = atoi(initialValue->getString().c_str());
}
}
- LogDebug("attrName [" << attrName << "] initialValue[" << initialValue->toString() << "] iValue[" << iValue << "]");
+ LoggerD("attrName [" << attrName << "] initialValue[" << initialValue->toString() << "] iValue[" << iValue << "]");
}
if (!endValue->isNullOrUndefined()) {
eValue = atoi(endValue->getString().c_str());
}
}
- LogDebug("attrName [" << attrName << "] endValue[" << endValue->toString() << "] eValue[" << eValue << "]");
+ LoggerD("attrName [" << attrName << "] endValue[" << endValue->toString() << "] eValue[" << eValue << "]");
}
contacts_filter_h subFilter = NULL;
contacts_filter_h CallHistoryFilter::getResult() const
{
- LogDebug("filter stack size [" << m_filterStack.size() << "]");
+ LoggerD("filter stack size [" << m_filterStack.size() << "]");
contacts_filter_h filter = m_filterStack.top();
return filter;
}
*/
#include "CallHistoryFilterConverter.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace CallHistory {
CallHistoryFilterConverter::~CallHistoryFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
} // CallHistory
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSCallHistory.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace CallHistory {
JSCallHistoryPriv *priv = static_cast<JSCallHistoryPriv*> (JSObjectGetPrivate(m_object));
if (!priv) {
- LogWarning("Object has no private object");
+ LoggerW("Object has no private object");
return;
}
ICallHistoryPtr callHistory(priv->getObject());
callHistory->removeListener(m_watchId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
//
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/IEvent.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "CallHistoryStaticController.h"
#include "Converter.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
}
}
} catch(ConversionException) {
- LogError("Conversion exception while processing EventCallHistoryListener");
+ LoggerE("Conversion exception while processing EventCallHistoryListener");
}
}
// limitations under the License.
//
-
#include "Converter.h"
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include "CallHistoryDefine.h"
#include "JSCallHistoryEntry.h"
#include "JSRemoteParty.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
Converter::toEventCallHistoryListenerPrivateData(const JSValueRef &jsValue, JSContextRef context)
{
- LogDebug("enter");
+ LoggerD("enter");
if (JSValueIsNull(m_context, jsValue) || JSValueIsUndefined(m_context, jsValue)) {
ThrowMsg(Commons::ConversionException, "Type missmatch error : Listener callback is null or undefined");
if (!JSValueIsNull(m_context, result.onRemoved) && !JSValueIsUndefined(m_context, result.onRemoved)) {
if (JSObjectIsFunction(m_context, toJSObjectRef(result.onRemoved))) {
onRemovedCbm->setOnSuccess(result.onRemoved);
- LogDebug("onRemoved register");
+ LoggerD("onRemoved register");
} else {
ThrowMsg(Commons::ConversionException, "Type missmatch error : onremoved callback");
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "JSCallHistoryEntry.h"
#include "JSRemoteParty.h"
#include "Converter.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "RemoteParty.h"
#include "JSRemoteParty.h"
#include "Converter.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
// See the License for the specific language governing permissions and
// limitations under the License.
//
-
#include "ResponseDispatcher.h"
-
-#include <dpl/log/log.h>
#include <dpl/assert.h>
-
#include <Commons/Exception.h>
#include <Commons/IEvent.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSCallHistory.h"
#include "Converter.h"
#include "CallHistoryAsyncCallbackManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSCallHistory.h"
#include "CallHistoryAsyncCallbackManager.h"
#include "CallHistoryListenerManager.h"
+#include <Logger.h>
#define CALLHISTORY "callhistory"
using namespace WrtDeviceApis::CommonsJavaScript;
void on_widget_start_callback(int widgetId) {
- LogDebug("[Tizen\\callhistory] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\callhistory] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
try {
WrtAccessSingleton::Instance().initialize(widgetId);
} catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId) {
- LogDebug("[Tizen\\callhistory] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\callhistory] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"CallHistory");
TIME_TRACER_RELEASE();
try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\callhistory] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\callhistory] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\callhistory] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\callhistory] on_frame_unload_callback (" << context << ")");
DeviceAPI::CallHistory::CallHistoryAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::CallHistory::CallHistoryListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
#include <math.h>
#include <stdarg.h>
-
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
-
using namespace std;
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis::Commons;
#ifndef _TIZEN_COMMONS_ASYNC_CALLBACK_MANAGER_H_
#define _TIZEN_COMMONS_ASYNC_CALLBACK_MANAGER_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/type_list.h>
#include <CommonsJavaScript/JSCallbackManager.h>
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
virtual void registerCallbackManager(WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr &cbm, const JSContextRef context)
{
- LogDebug("Registering an callback manager on context:" << context);
+ LoggerD("Registering an callback manager on context:" << context);
m_map.insert(JSCallbackManagerPair(cbm, context));
}
virtual void unregisterContext(const JSContextRef context)
{
- LogDebug("Unregistering all callback managers on context:" << context);
+ LoggerD("Unregistering all callback managers on context:" << context);
for(JSCallbackManagerMapIter i=m_map.begin(); i!=m_map.end(); i++)
{
if(i->second == context)
{
- LogDebug("unregister a callback manager");
+ LoggerD("unregister a callback manager");
i->first->setOnSuccess(NULL);
i->first->setOnError(NULL);
// This function does not remove cbm from multimap.
virtual void unregisterCallbackManager(const WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr &cbm)
{
- LogDebug("Unregistering an callback manager");
+ LoggerD("Unregistering an callback manager");
JSCallbackManagerMapIter i = m_map.find(cbm);
if(i == m_map.end())
{
- LogWarning("nothing to unregister");
+ LoggerW("nothing to unregister");
// Something wrong
return;
}
#include "CallbackUserData.h"
#include "MultiCallbackUserData.h"
-
-#include <dlog.h>
#include <stdarg.h>
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
-
using namespace std;
namespace DeviceAPI {
//
#include "GlobalContextManager.h"
-
-#include <dlog.h>
-
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
+#include "Logger.h"
using namespace std;
JSContextRef GlobalContextManager::getGlobalContext(JSContextRef ctx){
if( ctx == NULL ){
- LOGE("local context is NULL");
+ LoggerE("local context is NULL");
return NULL;
}
JSObjectRef global = JSContextGetGlobalObject(ctx);
ContextMapT::iterator itr;
itr = mContexts.find(global);
if( itr == mContexts.end() ){
- LOGE("Can not found global Context");
+ LoggerE("Can not found global Context");
return NULL;
}
return itr->second;
JSObjectRef global = JSContextGetGlobalObject(ctx);
itr = mContexts.find(global);
if( itr != mContexts.end() ){
- LOGD("already added global context");
+ LoggerD("already added global context");
return;
}
mContexts[global] = ctx;
JSObjectRef global = JSContextGetGlobalObject(ctx);
itr = mContexts.find(global);
if( itr == mContexts.end() ){
- LOGD("does not exist context");
+ LoggerD("does not exist context");
return;
}
if( itr->second == ctx )
mContexts.erase(itr);
else
- LOGE("passed context is not global context");
+ LoggerE("passed context is not global context");
}
}
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
virtual void protectObject()
{
- LogDebug("Protect object:" << m_object);
+ LoggerD("Protect object:" << m_object);
JSValueProtect(m_context, m_object);
}
virtual void unprotectObject()
{
- LogDebug("Unprotect object:" << m_object);
+ LoggerD("Unprotect object:" << m_object);
JSValueUnprotect(m_context, m_object);
}
virtual void cancelListener()
{
- LogWarning("IListenerItem MUST be used as an inherited shape.");
- LogWarning("If this log has been printed, it must be used with wrong usage.");
+ LoggerW("IListenerItem MUST be used as an inherited shape.");
+ LoggerW("If this log has been printed, it must be used with wrong usage.");
}
virtual bool equal(const DeviceAPI::Common::IListenerItemPtr &other) const
virtual void registerListener(IListenerItemPtr &canceller, const JSContextRef context)
{
- LogDebug("Registering a listener on context:" << context);
+ LoggerD("Registering a listener on context:" << context);
canceller->protectObject();
m_map.insert(ListenerPair(context, canceller));
virtual void unregisterContext(const JSContextRef context)
{
- LogDebug("Unregistering all listeners on context:" << context);
+ LoggerD("Unregistering all listeners on context:" << context);
ListenerMapIterPair iterPair = m_map.equal_range(context);
for(ListenerMapIter i=iterPair.first; i!=iterPair.second; i++)
{
- LogDebug("Unregistering a listener");
+ LoggerD("Unregistering a listener");
i->second->cancelListener();
i->second->unprotectObject();
}
virtual void unregisterListener(const IListenerItemPtr &canceller)
{
- LogDebug("Unregistering a listener");
+ LoggerD("Unregistering a listener");
for(ListenerMapIter i=m_map.begin(); i!=m_map.end(); i++)
{
if(i->second->equal(canceller))
{
- LogDebug("Found object");
+ LoggerD("Found object");
i->second->unprotectObject();
m_map.erase(i);
}
void JSArrayBase::resize(size_t size){
- JSUtil::setProperty(mContext, mArray, "length", JSUtil::toJSValueRef(mContext, static_cast<double>(size)), NULL, NULL);
+ JSUtil::setProperty(mContext, mArray, "length", JSUtil::toJSValueRef(mContext, static_cast<double>(size)), kJSPropertyAttributeNone, NULL);
}
JSValueRef JSArrayBase::get(int index) const{
//
#include "JSTizenException.h"
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Converter.h>
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
JSValueRef JSTizenException::getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* /*exception*/) {
PrivateObject* privateObject = static_cast<PrivateObject*> (JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSValueMakeUndefined(context);
}
// return converter.toJSValueRef(privateObject->getObject()->getMessage());
// }
// } catch (const WrtDeviceApis::Commons::ConversionException& ex) {
-// LogError("Exception: " << ex.GetMessage());
+// LoggerE("Exception: " << ex.GetMessage());
// }
return JSValueMakeUndefined(context);
//
#include "JSTizenExceptionFactory.h"
-
#include <dpl/assert.h>
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/JSUtils.h>
-
#include "TizenExceptionData.h"
#include "JSWebAPIError.h"
#include "JSWebAPIException.h"
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
return JSValueMakeUndefined(context);
}
}// Common
-}// DeviceAPI
\ No newline at end of file
+}// DeviceAP
\ No newline at end of file
//
#include "JSWebAPIError.h"
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <string>
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
JSValueRef JSWebAPIError::getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* /*exception*/) {
PrivateObject* privateObject = static_cast<PrivateObject*> (JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSValueMakeUndefined(context);
}
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
try {
if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_CODE)) {
- LogDebug("propertyName PROPERTY_CODE");
+ LoggerD("propertyName PROPERTY_CODE");
return converter.toJSValueRef(privateObject->getObject()->getCode());
} else if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_NAME)) {
return converter.toJSValueRef(privateObject->getObject()->getName());
}else if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_DATA_CLONE_ERR)) {
return converter.toJSValueRef(DATA_CLONE_ERR);
}else{
- LogDebug("propertyName not supported");
+ LoggerD("propertyName not supported");
return converter.toJSValueRef(UNKNOWN_ERR);
}
} catch (const WrtDeviceApis::Commons::ConversionException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
return JSValueMakeUndefined(context);
}
int JSWebAPIError::convertToWebAPIErrorCode(const std::string& errorName){
- LogDebug("<<< errorName:[" << errorName << "]");
+ LoggerD("<<< errorName:[" << errorName << "]");
int retErrorCode = -1;
retErrorCode = UNKNOWN_ERR;
}
- LogDebug(">>> retERrorCode:" << retErrorCode );
+ LoggerD(">>> retERrorCode:" << retErrorCode );
return retErrorCode;
}
//
#include "JSWebAPIError2.h"
-
#include <string>
#include <map>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSUtil.h"
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
PrivateObject *priv = new PrivateObject(context, webapiError);
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
return jsObjectRef;
PrivateObject* privateObject = static_cast<PrivateObject*>(JSObjectGetPrivate(object));
if (!privateObject)
{
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSValueMakeUndefined(context);
}
}
catch (const WrtDeviceApis::Commons::ConversionException& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
return JSValueMakeUndefined(context);
PrivateObject* privateObject = static_cast<PrivateObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject)
{
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return NULL;
}
//
#include "JSWebAPIErrorFactory.h"
-
#include <map>
#include <dpl/assert.h>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
-
#include "JSWebAPIError2.h"
+#include "Logger.h"
#define INDEX_SIZE_ERROR_NAME_STR "IndexSizeError"
#define DOMSTRING_SIZE_ERROR_NAME_STR "DOMStringSizeError"
//
#include "JSWebAPIException.h"
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <string>
+#include "Logger.h"
namespace DeviceAPI {
namespace Common {
JSValueRef JSWebAPIException::getStaticProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* /*exception*/) {
PrivateObject* privateObject = static_cast<PrivateObject*> (JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSValueMakeUndefined(context);
}
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
try {
if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_CODE)) {
- LogDebug("propertyName PROPERTY_CODE");
+ LoggerD("propertyName PROPERTY_CODE");
return converter.toJSValueRef(privateObject->getObject()->getCode());
} else if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_NAME)) {
return converter.toJSValueRef(privateObject->getObject()->getName());
}else if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_DATA_CLONE_ERR)) {
return converter.toJSValueRef(DATA_CLONE_ERR);
}else{
- LogDebug("propertyName not supported");
+ LoggerD("propertyName not supported");
return converter.toJSValueRef(UNKNOWN_ERR);
}
} catch (const WrtDeviceApis::Commons::ConversionException& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
return JSValueMakeUndefined(context);
}
int JSWebAPIException::convertToWebAPIExceptionCode(const std::string& errorName){
- LogDebug("<<< errorName:[" << errorName << "]");
+ LoggerD("<<< errorName:[" << errorName << "]");
int retErrorCode = -1;
retErrorCode = UNKNOWN_ERR;
}
- LogDebug(">>> retERrorCode:" << retErrorCode );
+ LoggerD(">>> retERrorCode:" << retErrorCode );
return retErrorCode;
}
#define _LOGGER(prio, fmt, args...) \
do { \
std::ostringstream platformLog; \
- platformLog << "%s: %s(%d) > "; \
platformLog << fmt; \
- print_log(prio, LOG_TAG, platformLog.str().c_str(), __MODULE__, __func__, __LINE__, ##args); \
+ print_log(prio, LOG_TAG, "%s: %s(%d) > %s", __MODULE__, __func__, __LINE__, platformLog.str().c_str(), ##args); \
} while(0)
-#ifdef LogDebug
-#undef LogDebug
-#endif
-#define LogDebug(fmt, args...) _LOGGER(DLOG_DEBUG, fmt, ##args)
-
-#ifdef LogInfo
-#undef LogInfo
-#endif
-#define LogInfo(fmt, args...) _LOGGER(DLOG_INFO, fmt, ##args)
-
-#ifdef LogWarning
-#undef LogWarning
-#endif
-#define LogWarning(fmt, args...) _LOGGER(DLOG_WARN, fmt, ##args)
-
-#ifdef LogError
-#undef LogError
-#endif
-#define LogError(fmt, args...) _LOGGER(DLOG_ERROR, fmt, ##args)
+#define LoggerD(fmt, args...) _LOGGER(DLOG_DEBUG, fmt, ##args)
+#define LoggerI(fmt, args...) _LOGGER(DLOG_INFO, fmt, ##args)
+#define LoggerW(fmt, args...) _LOGGER(DLOG_WARN, fmt, ##args)
+#define LoggerE(fmt, args...) _LOGGER(DLOG_ERROR, fmt, ##args)
#endif // __TIZEN_COMMON_LOGGER_H__
try{
string result = convert.toString(arguments[0]);
- printf("<log[%d.%06d]>%s\n",diff.tv_sec,diff.tv_usec,result.c_str());
+ printf("<log[%d.%06d]>%s\n",(int)diff.tv_sec,(int)diff.tv_usec,result.c_str());
LOGD("%s", result.c_str());
}catch(const ConversionException& err){
}
vector<string> mHistory;
string mLine;
int mHistoryIndex;
- int mCurrentPos;
- int mCurrentPosTmp;
+ unsigned int mCurrentPos;
+ unsigned int mCurrentPosTmp;
int mLineLength;
public:
LineBuffer():mHistoryIndex(0), mCurrentPos(0){
case 49:
//home
mCurrentPos = 0;
- getch();
+ a = getch();
break;
default:
- getch();
+ a = getch();
}
return true;
*/
#include "AddressBook.h"
-
#include <contacts.h>
-
#include <ctime>
#include <cstdlib>
#include <cstddef>
-#include <dpl/log/log.h>
#include <dpl/exception.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "ContactSearchEngine.h"
#include "ContactFilterValidator.h"
#include "ContactUtility.h"
-
#include "ContactQueue.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
m_isUnifiedAddressBook(isUnified),
m_eventMapAcc(100)
{
- LogDebug("entered");
+ LoggerD("entered");
}
AddressBook::~AddressBook()
void AddressBook::OnRequestReceived(const EventAddressBookGetPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_record_h contacts_record = NULL;
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during getting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during getting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void AddressBook::OnRequestReceived(const EventAddressBookAddPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
int id = 0;
}
Catch(InvalidArgumentException)
{
- LogError("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
int contactId = 0;
if (!contacts_record)
{
- LogError("Error during converting contact object");
+ LoggerE("Error during converting contact object");
ThrowMsg(PlatformException, "Error during converting contact object");
}
errorCode = contacts_record_set_int(contacts_record, _contacts_contact.address_book_id, m_id);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_insert_record()");
}
errorCode = contacts_db_insert_record(contacts_record, &contactId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_insert_record()");
}
}
Catch (PlatformException)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Catch (Exception)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
void AddressBook::AddressBookAddBatch(const EventAddressBookAddBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_list_h contacts_list = NULL;
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Catch(Exception)
{
ThrowMsg(NotFoundException, "Error during converting contact object");
-// LogError("Error during converting contact object : " << _rethrown_exception.GetMessage());
+// LoggerE("Error during converting contact object : " << _rethrown_exception.GetMessage());
// continue;
}
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookAddBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch (Exception)
{
- LogError("Error during adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookUpdatePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactPtr contact(NULL);
Try
}
Catch(InvalidArgumentException)
{
- LogError("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
if (!contacts_record)
{
- LogError("Error during converting contact object");
+ LoggerE("Error during converting contact object");
ThrowMsg(PlatformException, "Error during converting contact object");
}
ThrowMsg(NotFoundException, "Error during executing contacts_db_update_record()");
else if (errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_update_record()");
}
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
}
Catch (PlatformException)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void AddressBook::AddressBookUpdateBatch(const EventAddressBookUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_list_h contacts_list = NULL;
ContactArrayPtr contacts(NULL);
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid arguments for updating contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for updating contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
contacts_record = newContactT->getPlatformContactObject();
if(contacts_record == NULL)
{
- LogDebug("id : " << contact->getId());
+ LoggerD("id : " << contact->getId());
int contactIdInt = ContactUtility::strToInt(contact->getId());
errorCode = contacts_db_get_record(_contacts_contact._uri, contactIdInt, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE || contacts_record == NULL)
Catch(Exception)
{
ThrowMsg(NotFoundException, "Error during converting contact object");
-// LogError("Error during converting contact object : " << _rethrown_exception.GetMessage());
+// LoggerE("Error during converting contact object : " << _rethrown_exception.GetMessage());
// continue;
}
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch (Exception)
{
- LogError("Error during updating contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookRemovePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
Try
}
Catch (InvalidArgumentException)
{
- LogError("Invalid contact id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid contact id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
}
Catch (PlatformException)
{
- LogError("Error during updating contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception)
{
- LogError("Error during updating contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void AddressBook::AddressBookRemoveBatch(const EventAddressBookRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
StringArrayPtr contactIds(NULL);
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid arguments for removing contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for removing contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Catch(Exception)
{
ThrowMsg(NotFoundException, "Error during converting contact object");
-// LogError("Error during converting contact object : " << _rethrown_exception.GetMessage());
+// LoggerE("Error during converting contact object : " << _rethrown_exception.GetMessage());
// continue;
}
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid contact id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid contact id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during deleting contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during deleting contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void AddressBook::OnRequestReceived(const EventAddressBookRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch (Exception)
{
- LogError("Error during deleting contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookFindPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
contacts_query_h query = NULL;
contacts_filter_h filter = NULL;
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during finding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during finding contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch (Exception)
{
- LogError("Error during deleting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void AddressBook::OnRequestReceived(const EventAddressBookAddChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
if(m_addressBookEmitters.size() == 0)
{
- LogDebug("Watch registered initially");
+ LoggerD("Watch registered initially");
if(m_isUnifiedAddressBook)
ContactsSvcChangeListenerManagerSingleton::Instance().registerContactsChangeListener(this, -1);
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during deleting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch (Exception)
{
- LogError("Error during deleting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void AddressBook::OnRequestReceived(const EventAddressBookRemoveChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
if(m_addressBookEmitters.size() == 0)
{
- LogDebug("No watcher is registered. unsubscribing from contact service.");
+ LoggerD("No watcher is registered. unsubscribing from contact service.");
ContactsSvcChangeListenerManagerSingleton::Instance().unregisterContactsChangeListener(this);
}
}
Catch (NotFoundException)
{
- LogError("WatchId doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("WatchId doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during deleting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch (Exception)
{
- LogError("Error during deleting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void AddressBook::OnRequestReceived(const EventAddressBookGetGroupPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_record_h contacts_record = NULL;
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during getting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during getting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void AddressBook::OnRequestReceived(const EventAddressBookAddGroupPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
}
Catch(InvalidArgumentException)
{
- LogError("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for adding contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
errorCode = contacts_record_create(_contacts_group._uri, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_record_create()");
}
errorCode = contacts_record_set_int(contacts_record, _contacts_group.address_book_id, m_id);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_record_set_int()");
}
errorCode = contacts_db_insert_record(contacts_record, &groupId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_insert_record()");
}
group->setId(groupId);
}
Catch (PlatformException)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Catch (Exception)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
}
void AddressBook::OnRequestReceived(const EventAddressBookUpdateGroupPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
}
Catch(InvalidArgumentException)
{
- LogError("Invalid arguments for updating group : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for updating group : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
if(group->getReadOnly())
{
- LogWarning("Canceling updating readonly data.");
+ LoggerW("Canceling updating readonly data.");
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Try
{
int id = ContactUtility::strToInt(group->getId());
- LogDebug("Load platform object id : " << id);
+ LoggerD("Load platform object id : " << id);
errorCode = contacts_db_get_record(_contacts_group._uri, id, &contacts_record);
if (errorCode == CONTACTS_ERROR_INVALID_PARAMETER)
ThrowMsg(NotFoundException, "Error during executing contacts_db_get_record()");
else if (errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_get_record()");
}
- LogDebug("Update group : " << id);
+ LoggerD("Update group : " << id);
ContactsSvcObjectConverter::convertToPlatform(group, contacts_record);
errorCode = contacts_db_update_record(contacts_record);
ThrowMsg(NotFoundException, "Error during executing contacts_db_update_record()");
else if (errorCode != CONTACTS_ERROR_NONE)
{
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_update_record()");
}
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (PlatformException)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Catch (Exception)
{
- LogError("Error during adding contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during adding contact : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookRemoveGroupPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
Try
}
Catch (InvalidArgumentException)
{
- LogError("Invalid group id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid group id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
}
Catch (NotFoundException)
{
- LogError("Group doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Group doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (PlatformException)
{
- LogError("Error during removing group : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing group : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Catch (Exception)
{
- LogError("Error during removing group : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing group : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void AddressBook::OnRequestReceived(const EventAddressBookGetGroupsPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
errorCode = contacts_list_get_current_record_p(groups_list, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE || contacts_record == NULL)
{
- LogWarning("Fail to get group record (ret:" << errorCode << ")");
+ LoggerW("Fail to get group record (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_int(contacts_record, _contacts_group.id, &id);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get id from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get id from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_int(contacts_record, _contacts_group.address_book_id, &addressBookId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get address book id from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get address book id from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_str_p(contacts_record, _contacts_group.name, &name);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get name from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get name from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_str_p(contacts_record, _contacts_group.image_path, &photoURI);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get image_path from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get image_path from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_str_p(contacts_record, _contacts_group.ringtone_path, &ringtoneURI);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get ringtone_path from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get ringtone_path from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_bool(contacts_record, _contacts_group.is_read_only, &isReadOnly);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get is_read_only from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get is_read_only from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_list_next(groups_list);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get next address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get next address book (ret:" << errorCode << ")");
break;
}
}
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch (PlatformException)
{
- LogError("Error during getting contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during getting contact : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch (InvalidArgumentException)
{
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void AddressBook::contactsAddBatchResultCallback(int error, int *ids, unsigned int count, void *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogError("user_data is NULL");
+ LoggerE("user_data is NULL");
return;
}
iter = m_addBatchEventMap.find(key);
if(iter == m_addBatchEventMap.end())
{
- LogError("No event for key : " << key);
+ LoggerE("No event for key : " << key);
return;
}
if(error != CONTACTS_ERROR_NONE)
{
- LogError("contacts_db_insert_result_cb gives error : " << error);
+ LoggerE("contacts_db_insert_result_cb gives error : " << error);
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
EventRequestReceiver<EventAddressBookAddBatch>::ManualAnswer(event);
{
int errorCode = 0;
int contactId = ids[i];
- LogDebug("contact id : " << contactId);
+ LoggerD("contact id : " << contactId);
contacts_record_h contacts_record = NULL;
errorCode = contacts_db_get_record(_contacts_contact._uri, contactId, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
+ LoggerD("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
continue;
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
continue;
}
void AddressBook::contactsUpdateBatchResultCallback(int error, void *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogError("user_data is NULL");
+ LoggerE("user_data is NULL");
return;
}
iter = m_updateBatchEventMap.find(key);
if(iter == m_updateBatchEventMap.end())
{
- LogError("No event for key : " << key);
+ LoggerE("No event for key : " << key);
return;
}
if(error != CONTACTS_ERROR_NONE)
{
- LogError("contacts_db_result_cb gives error : " << error);
+ LoggerE("contacts_db_result_cb gives error : " << error);
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
EventRequestReceiver<EventAddressBookUpdateBatch>::ManualAnswer(event);
void AddressBook::contactsRemoveBatchResultCallback(int error, void *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogError("user_data is NULL");
+ LoggerE("user_data is NULL");
return;
}
iter = m_removeBatchEventMap.find(key);
if(iter == m_removeBatchEventMap.end())
{
- LogError("No event for key : " << key);
+ LoggerE("No event for key : " << key);
return;
}
if(error != CONTACTS_ERROR_NONE)
{
- LogError("contacts_db_result_cb gives error : " << error);
+ LoggerE("contacts_db_result_cb gives error : " << error);
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
EventRequestReceiver<EventAddressBookRemoveBatch>::ManualAnswer(event);
* @brief
*/
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "JSAddressBookChangeCallbackManager.h"
#include "ContactAsyncCallbackManager.h"
#include "ContactQueue.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
EventAddressBookChangeListenerListener(ThreadEnum::NULL_THREAD),
AddressBookPrivObject(context, addressBook)
{
- LogDebug("AddressBookController constructed : " << this);
+ LoggerD("AddressBookController constructed : " << this);
if (!addressBook) {
- LogWarning("controller has no addressBook object");
+ LoggerW("controller has no addressBook object");
}
}
AddressBookController::~AddressBookController()
{
- LogDebug("AddressBookController destructed : " << this);
+ LoggerD("AddressBookController destructed : " << this);
}
void AddressBookAsyncAnswerHandler::addBatch(const EventAddressBookAddBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactQueueManagerSingleton::Instance().decreaseQueueList();
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
if(!isEmpty){
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void AddressBookAsyncAnswerHandler::updateBatch(const EventAddressBookUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactQueueManagerSingleton::Instance().decreaseQueueList();
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
if(!isEmpty){
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
void AddressBookAsyncAnswerHandler::removeBatch(const EventAddressBookRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactQueueManagerSingleton::Instance().decreaseQueueList();
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
if(!isEmpty){
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
void AddressBookAsyncAnswerHandler::find(const EventAddressBookFindPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void AddressBookAsyncAnswerHandler::changeListenerError(const EventAddressBookChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSValueRef errorObject;
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
void AddressBookAsyncAnswerHandler::changeListenerContactAdded(const EventAddressBookChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSAddressBookChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSAddressBookChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoAddressBookChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoAddressBookChange::OnContactsAdded)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
if (!eventInfo->getContactsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contacts = converter->toJSValueRef(eventInfo->getContacts());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
void AddressBookAsyncAnswerHandler::changeListenerContactUpdated(const EventAddressBookChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSAddressBookChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSAddressBookChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoAddressBookChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoAddressBookChange::OnContactsUpdated)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
if (!eventInfo->getContactsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contacts = converter->toJSValueRef(eventInfo->getContacts());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
void AddressBookAsyncAnswerHandler::changeListenerContactRemoved(const EventAddressBookChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSAddressBookChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSAddressBookChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoAddressBookChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoAddressBookChange::OnContactsRemoved)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
EventInfoAddressBookChangeRemovedPtr eventInfo = DPL::DynamicPointerCast<EventInfoAddressBookChangeRemoved>(_eventInfo);
if (!eventInfo->getContactIdsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contactIds = converter->toJSValueRef(eventInfo->getContactIds());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
EventInfoAddressBookChangePtr eventInfo = event->getEventInfo();
if(eventInfo == NULL)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
#ifndef _TIZEN_CONTACT_ADDRESS_BOOK_CONTROLLER_H_
#define _TIZEN_CONTACT_ADDRESS_BOOK_CONTROLLER_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include <Commons/EventListener.h>
*/
#include "Contact.h"
-
-#include <dpl/log/log.h>
#include <dpl/exception.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "ContactObjectA2PConverter.h"
#include "ContactObjectP2AConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
, m_platformContactObject(NULL)
, m_platformContactObjectList(NULL)
{
-// LogDebug("entered");
+// LoggerD("entered");
m_numbersJSObjIsSet = false;
m_emailsJSObjIsSet = false;
string Contact::convertToString(const string &format)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
char *vcard_stream = NULL;
void Contact::setContactFromString(const std::string &vObjectStr)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
const char *vcard_stream = vObjectStr.c_str();
*/
#include "ContactConverter.h"
-
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSContactWebSite.h"
#include "JSContactWebSiteArray.h"
#include "JSStringArray.h"
+#include <Logger.h>
#define CONTACT_ATTRIBUTE_ACCOUNT_ID "accountId"
#define CONTACT_ATTRIBUTE_ADDITIONAL_INFORMATION "additionalInformation"
{
if(!JSContact::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a Contact object");
+ LoggerE("Not a Contact object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// from ContactInit to Contact
Validator validator(m_context);
if (validator.isNullOrUndefined(jsValue)) {
- LogError("ContactInit object is null");
+ LoggerE("ContactInit object is null");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
if (!JSValueIsObject(m_context, jsValue) || JSIsArrayValue(m_context, jsValue)) {
- LogError("ContactInit object is not object");
+ LoggerE("ContactInit object is not object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// if (!validator.checkArrayKeys(m_allowedContactInit, jsValue)) {
-// LogError("invalid properties in ContactInit object");
+// LoggerE("invalid properties in ContactInit object");
// ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
// }
{
if(!JSPerson::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a Person object");
+ LoggerE("Not a Person object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactGroup::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactGroup object");
+ LoggerE("Not a ContactGroup object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactRef::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactRef object");
+ LoggerE("Not a ContactRef object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactName::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactName object");
+ LoggerE("Not a ContactName object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// from ContactNameInit to ContactName
Validator validator(m_context);
if (validator.isNullOrUndefined(jsValue)) {
- LogError("ContactNameInit object is null");
+ LoggerE("ContactNameInit object is null");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
if (!JSValueIsObject(m_context, jsValue) || JSIsArrayValue(m_context, jsValue)) {
- LogError("ContactNameInit object is not object");
+ LoggerE("ContactNameInit object is not object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// if (!validator.checkArrayKeys(m_allowedContactNameInit, jsValue)) {
-// LogError("invalid properties in ContactNameInit object");
+// LoggerE("invalid properties in ContactNameInit object");
// ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
// }
{
if(!JSContactOrganization::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactOrganization object");
+ LoggerE("Not a ContactOrganization object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// from ContactOrganizationInit to ContactOrganization
Validator validator(m_context);
if (validator.isNullOrUndefined(jsValue)) {
- LogError("ContactOrganizationInit object is null");
+ LoggerE("ContactOrganizationInit object is null");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
if (!JSValueIsObject(m_context, jsValue) || JSIsArrayValue(m_context, jsValue)) {
- LogError("ContactOrganizationInit object is not object");
+ LoggerE("ContactOrganizationInit object is not object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// if (!validator.checkArrayKeys(m_allowedContactOrganizationInit, jsValue)) {
-// LogError("invalid properties in ContactOrganizationInit object");
+// LoggerE("invalid properties in ContactOrganizationInit object");
// ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
// }
{
if(!JSContactWebSite::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactWebSite object");
+ LoggerE("Not a ContactWebSite object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactAnniversary::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactAnniversary object");
+ LoggerE("Not a ContactAnniversary object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactAddress::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactAddress object");
+ LoggerE("Not a ContactAddress object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// from ContactAddressInit to ContactAddress
Validator validator(m_context);
if (validator.isNullOrUndefined(jsValue)) {
- LogError("ContactAddressInit object is null");
+ LoggerE("ContactAddressInit object is null");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
if (!JSValueIsObject(m_context, jsValue) || JSIsArrayValue(m_context, jsValue)) {
- LogError("ContactAddressInit object is not object");
+ LoggerE("ContactAddressInit object is not object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
// if (!validator.checkArrayKeys(m_allowedContactAddressInit, jsValue)) {
-// LogError("invalid properties in ContactAddressInit object");
+// LoggerE("invalid properties in ContactAddressInit object");
// ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
// }
{
if(!JSContactPhoneNumber::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactPhoneNumber object");
+ LoggerE("Not a ContactPhoneNumber object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
{
if(!JSContactEmailAddress::isObjectOfClass(m_context, jsValue))
{
- LogError("Not a ContactEmailAddress object");
+ LoggerE("Not a ContactEmailAddress object");
ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Wrong attribute");
}
*/
#include "ContactFilterConverter.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
ContactFilterConverter::~ContactFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
PersonFilterConverter::PersonFilterConverter(JSContextRef context) :
PersonFilterConverter::~PersonFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
} // Contact
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "AddressBookController.h"
#include "ContactManagerController.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
controller = static_cast<AddressBookController*>(JSObjectGetPrivate(m_object));
if (!controller) {
- LogWarning("Object has no controller");
+ LoggerW("Object has no controller");
return;
}
addressBook = controller->getObject();
dplEvent->setForSynchronousCall();
Try {
- LogDebug("Remove change listener");
+ LoggerD("Remove change listener");
addressBook->removeChangeListener(dplEvent);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
controller = static_cast<ContactManagerController*>(JSObjectGetPrivate(m_object));
if (!controller) {
- LogWarning("Object has no controller");
+ LoggerW("Object has no controller");
return;
}
addressBook = controller->getObject();
dplEvent->setForSynchronousCall();
Try {
- LogDebug("Remove change listener");
+ LoggerD("Remove change listener");
addressBook->removeChangeListener(dplEvent);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
*/
#include "ContactManager.h"
-
#include <contacts.h>
#include <string>
-#include <dpl/log/log.h>
#include <Commons/Regex.h>
#include "ContactFactory.h"
#include "IAddressBook.h"
#include "PersonSearchEngine.h"
#include "Person.h"
#include "ContactQueue.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
void ContactManager::OnRequestReceived(const EventContactManagerGetAddressBookPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Catch(PlatformException)
{
//when database is not opened then set result as failed
- LogError("Contact DB not opened : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact DB not opened : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
Catch(NotFoundException)
{
//when database is not opened then set result as failed
- LogError("Not found : " << _rethrown_exception.GetMessage());
+ LoggerE("Not found : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogError("Unknown exception : " << _rethrown_exception.GetMessage());
+ LoggerE("Unknown exception : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
return;
void ContactManager::OnRequestReceived(const EventContactManagerGetAddressBooksPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Catch (PlatformException)
{
//when database is not opened then set result as failed
- LogError("Contact DB is not opened.");
+ LoggerE("Contact DB is not opened.");
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception)
{
- LogError("Unknown exception : " << _rethrown_exception.GetMessage());
+ LoggerE("Unknown exception : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
return;
void ContactManager::OnRequestReceived(const EventContactManagerGetDefaultAddressBookPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Catch (PlatformException)
{
//when database is not opened then set result as failed
- LogError("Contact DB is not opened.");
+ LoggerE("Contact DB is not opened.");
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception)
{
- LogError("Unknown exception : " << _rethrown_exception.GetMessage());
+ LoggerE("Unknown exception : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
return;
void ContactManager::OnRequestReceived(const EventContactManagerGetUnifiedAddressBookPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Catch (PlatformException)
{
//when database is not opened then set result as failed
- LogError("Contact DB is not opened.");
+ LoggerE("Contact DB is not opened.");
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception)
{
- LogError("Unknown exception : " << _rethrown_exception.GetMessage());
+ LoggerE("Unknown exception : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::UnknownException);
return;
void ContactManager::OnRequestReceived(const EventContactManagerGetPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_record_h contacts_record = NULL;
event->setResult(true);
} Catch (NotFoundException) {
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
} Catch (PlatformException) {
- LogError("Error during getting person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during getting person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
} Catch (InvalidArgumentException) {
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
} Catch(Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void ContactManager::OnRequestReceived(const EventContactManagerUpdatePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
ThrowMsg(InvalidArgumentException, "Person object is wrong");
} Catch(InvalidArgumentException) {
- LogError("Invalid arguments for updating persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for updating persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Try
{
int id = ContactUtility::strToInt(person->getId());
- LogDebug("Load platform object id : " << id);
+ LoggerD("Load platform object id : " << id);
errorCode = contacts_db_get_record(_contacts_person._uri, id, &contacts_record);
if (errorCode == CONTACTS_ERROR_INVALID_PARAMETER)
ThrowMsg(NotFoundException, "Error during executing contacts_db_get_record()");
else if (errorCode != CONTACTS_ERROR_NONE) {
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_get_record()");
}
if (errorCode == CONTACTS_ERROR_INVALID_PARAMETER)
ThrowMsg(NotFoundException, "Error during executing contacts_db_update_record()");
else if (errorCode != CONTACTS_ERROR_NONE) {
- LogError("error code : " << errorCode);
+ LoggerE("error code : " << errorCode);
ThrowMsg(PlatformException, "Error during executing contacts_db_update_record()");
}
}
Catch (NotFoundException)
{
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch (PlatformException) {
- LogError("Error during updating person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Catch (Exception) {
- LogError("Error during display_contact_id person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during display_contact_id person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void ContactManager::managerUpdateBatch(const EventContactManagerUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_list_h contacts_list = NULL;
PersonArrayPtr persons(NULL);
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid arguments for updating persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for updating persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Try
{
- LogDebug("id : " << person->getId());
+ LoggerD("id : " << person->getId());
int personIdInt = ContactUtility::strToInt(person->getId());
errorCode = contacts_db_get_record(_contacts_person._uri, personIdInt, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
Catch(Exception)
{
ThrowMsg(NotFoundException, "Error during converting contact object");
-// LogError("Error during converting person object : " << _rethrown_exception.GetMessage());
+// LoggerE("Error during converting person object : " << _rethrown_exception.GetMessage());
// continue;
}
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during updating persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during updating persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void ContactManager::OnRequestReceived(const EventContactManagerUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
- LogDebug("isEmpty : " << isEmpty);
+ LoggerD("isEmpty : " << isEmpty);
if(isEmpty){
managerUpdateBatch(event);
}else{
}
Catch (Exception)
{
- LogError("Error during updating persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during updating persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void ContactManager::OnRequestReceived(const EventContactManagerRemovePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int personId;
Try
}
Catch (InvalidArgumentException)
{
- LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
}
Catch (NotFoundException)
{
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
}
Catch (PlatformException) {
- LogError("Error during removing person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception) {
- LogError("Error during removing person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void ContactManager::managerRemoveBatch(const EventContactManagerRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
StringArrayPtr personIds(NULL);
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid arguments for removing persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid arguments for removing persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
Catch(Exception)
{
ThrowMsg(NotFoundException, "Error during converting person object");
-// LogError("Error during converting person object : " << _rethrown_exception.GetMessage());
+// LoggerE("Error during converting person object : " << _rethrown_exception.GetMessage());
// continue;
}
}
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during removing persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
if(!isEmpty){
ContactQueueManagerSingleton::Instance().pop();
}
- LogError("Error during removing persons : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removing persons : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void ContactManager::OnRequestReceived(const EventContactManagerRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
- LogDebug("isEmpty : " << isEmpty);
+ LoggerD("isEmpty : " << isEmpty);
if(isEmpty){
managerRemoveBatch(event);
}else{
}
Catch (Exception)
{
- LogError("Error during deleting contacts : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during deleting contacts : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
void ContactManager::OnRequestReceived(const EventContactManagerFindPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try {
PersonSearchEnginePtr searchEngine(new PersonSearchEngine());
event->setResult(true);
} Catch (NotFoundException) {
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
} Catch (PlatformException) {
- LogError("Error during finding person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during finding person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
} Catch (InvalidArgumentException) {
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
} Catch (Exception) {
- LogError("Error during finding person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during finding person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void ContactManager::OnRequestReceived(const EventContactManagerAddChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try {
if(!event->getEmitterIsSet())
if(m_contactManagerEmitters.size() == 0)
{
- LogDebug("Watch registered initially");
+ LoggerD("Watch registered initially");
ContactsSvcChangeListenerManagerSingleton::Instance().registerPersonsChangeListener(this);
}
event->setResult(true);
} Catch (NotFoundException) {
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
} Catch (PlatformException) {
- LogError("Error during addListner person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during addListner person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
} Catch (InvalidArgumentException) {
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
} Catch (Exception) {
- LogError("Error during addListner person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during addListner person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void ContactManager::OnRequestReceived(const EventContactManagerRemoveChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try {
if(!event->getIdIsSet())
if(m_contactManagerEmitters.size() == 0)
{
- LogDebug("No watcher is registered. unsubscribing from person service.");
+ LoggerD("No watcher is registered. unsubscribing from person service.");
ContactsSvcChangeListenerManagerSingleton::Instance().unregisterPersonsChangeListener(this);
}
event->setResult(true);
} Catch (NotFoundException) {
- LogError("WatchId doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("WatchId doesn't exist : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
} Catch (PlatformException) {
- LogError("Error during removeListner person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removeListner person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
} Catch (InvalidArgumentException) {
- LogError("Invalid Arguments : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid Arguments : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
} Catch (Exception) {
- LogError("Error during removeListner person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during removeListner person : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
void ContactManager::personsUpdateBatchResultCallback(int error, void *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogError("user_data is NULL");
+ LoggerE("user_data is NULL");
return;
}
iter = m_updateBatchEventMap.find(key);
if(iter == m_updateBatchEventMap.end())
{
- LogError("No event for key : " << key);
+ LoggerE("No event for key : " << key);
return;
}
if(error != CONTACTS_ERROR_NONE)
{
- LogError("persons_db_result_cb gives error : " << error);
+ LoggerE("persons_db_result_cb gives error : " << error);
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
EventRequestReceiver<EventContactManagerUpdateBatch>::ManualAnswer(event);
void ContactManager::personsRemoveBatchResultCallback(int error, void *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogError("user_data is NULL");
+ LoggerE("user_data is NULL");
return;
}
iter = m_removeBatchEventMap.find(key);
if(iter == m_removeBatchEventMap.end())
{
- LogError("No event for key : " << key);
+ LoggerE("No event for key : " << key);
return;
}
if(error != CONTACTS_ERROR_NONE)
{
- LogError("persons_db_result_cb gives error : " << error);
+ LoggerE("persons_db_result_cb gives error : " << error);
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
EventRequestReceiver<EventContactManagerRemoveBatch>::ManualAnswer(event);
* @brief
*/
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactAsyncCallbackManager.h"
#include "JSContactManagerChangeCallbackManager.h"
#include "ContactQueue.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
EventContactManagerChangeListenerListener(ThreadEnum::NULL_THREAD),
ContactManagerPrivObject(context, contactManager)
{
- LogDebug("ContactManagerController constructed : " << this);
+ LoggerD("ContactManagerController constructed : " << this);
}
ContactManagerController::~ContactManagerController()
{
- LogDebug("ContactManagerController destructed : " << this);
+ LoggerD("ContactManagerController destructed : " << this);
}
void ContactManagerAsyncAnswerHandler::getAddressBooks(const EventContactManagerGetAddressBooksPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ContactManagerAsyncAnswerHandler::updateBatch(const EventContactManagerUpdateBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactQueueManagerSingleton::Instance().decreaseQueueList();
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
void ContactManagerAsyncAnswerHandler::removeBatch(const EventContactManagerRemoveBatchPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactQueueManagerSingleton::Instance().decreaseQueueList();
bool isEmpty = ContactQueueManagerSingleton::Instance().empty();
if(!isEmpty){
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
void ContactManagerAsyncAnswerHandler::find(const EventContactManagerFindPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!callbackManager)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
ContactAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
if(event->checkCancelled()) {
- LogDebug("Operation cancelled");
+ LoggerD("Operation cancelled");
return;
}
callbackManager->callOnSuccess(result);
return;
} Catch(Exception) {
- LogError("error during processing answer" << _rethrown_exception.GetMessage());
+ LoggerE("error during processing answer" << _rethrown_exception.GetMessage());
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Internal error");
callbackManager->callOnError(error);
void ContactManagerAsyncAnswerHandler::changeListenerError(const EventContactManagerChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSValueRef errorObject;
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
void ContactManagerAsyncAnswerHandler::changeListenerPersonAdded(const EventContactManagerChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSContactManagerChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSContactManagerChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoContactManagerChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoContactManagerChange::OnPersonsAdded)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
if (!eventInfo->getPersonsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contacts = converter->toJSValueRef(eventInfo->getPersons());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
void ContactManagerAsyncAnswerHandler::changeListenerPersonUpdated(const EventContactManagerChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSContactManagerChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSContactManagerChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoContactManagerChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoContactManagerChange::OnPersonsUpdated)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
if (!eventInfo->getPersonsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contacts = converter->toJSValueRef(eventInfo->getPersons());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
void ContactManagerAsyncAnswerHandler::changeListenerPersonRemoved(const EventContactManagerChangeListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSContactManagerChangeCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSContactManagerChangeCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
EventInfoContactManagerChangePtr _eventInfo = event->getEventInfo();
if(_eventInfo->getCallbackType() != EventInfoContactManagerChange::OnPersonsRemoved)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
EventInfoContactManagerChangeRemovedPtr eventInfo = DPL::DynamicPointerCast<EventInfoContactManagerChangeRemoved>(_eventInfo);
if (!eventInfo->getPersonIdsIsSet())
{
- LogError("no data set");
+ LoggerE("no data set");
return;
}
Try {
contactIds = converter->toJSValueRef(eventInfo->getPersonIds());
} Catch (Exception) {
- LogError("Conversion error");
+ LoggerE("Conversion error");
return;
}
EventInfoContactManagerChangePtr eventInfo = event->getEventInfo();
if(eventInfo == NULL)
{
- LogError("wrong type");
+ LoggerE("wrong type");
return;
}
#include <Commons/Exception.h>
#include "ContactUtility.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
contacts_record_h ContactObjectA2PConverter::getPlatformContact()
{
- LogDebug("enter");
+ LoggerD("enter");
int errorCode = 0;
if(m_abstractContact == NULL)
{
- LogError("Abstract contact object did not set");
+ LoggerE("Abstract contact object did not set");
ThrowMsg(InvalidArgumentException, "Abstract contact object did not set");
}
if(m_abstractContact->getIdIsSet() && (m_forScratch == false))
{
int id = ContactUtility::strToInt(m_abstractContact->getId());
- LogDebug("Load platform object id : " << id);
+ LoggerD("Load platform object id : " << id);
errorCode = contacts_db_get_record(_contacts_contact._uri, id, &m_platformContact);
if(errorCode != CONTACTS_ERROR_NONE)
ThrowMsg(UnknownException, "error on contacts_db_get_record (errorCode:" << errorCode << ")");
}
else
{
- LogDebug("New platform object has been created");
+ LoggerD("New platform object has been created");
errorCode = contacts_record_create(_contacts_contact._uri, &m_platformContact);
if(errorCode != CONTACTS_ERROR_NONE)
ThrowMsg(UnknownException, "error on contacts_record_create (errorCode:" << errorCode << ")");
m_platformContactOwnership = true;
}
- LogDebug("for scratch : " << m_forScratch);
+ LoggerD("for scratch : " << m_forScratch);
Try
{
}
Catch(Exception)
{
- LogError("Error while converting - " << _rethrown_exception.GetMessage());
+ LoggerE("Error while converting - " << _rethrown_exception.GetMessage());
ThrowMsg(PlatformException, "Fail to convert abstract object to platform object.");
}
errorCode = contacts_record_get_child_record_at_p(m_platformContact, _contacts_contact.image, 0, &child_record);
if(errorCode != CONTACTS_ERROR_NONE || child_record == NULL)
{
- LogDebug("Fail to get contacts_record_get_child_record_at_p : " << errorCode);
+ LoggerD("Fail to get contacts_record_get_child_record_at_p : " << errorCode);
errorCode = contacts_record_create(_contacts_image._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
ThrowMsg(UnknownException, "creating name value B (errorCode:" << errorCode << ")");
if(newValueStr != NULL)
{
- LogDebug("image : " << newValueStr);
+ LoggerD("image : " << newValueStr);
errorCode = contacts_record_set_str(child_record, _contacts_image.path, newValueStr);
if(errorCode != CONTACTS_ERROR_NONE)
{
errorCode = contacts_record_get_child_record_at_p(m_platformContact, _contacts_contact.name, 0, &child_record);
if(errorCode != CONTACTS_ERROR_NONE || child_record == NULL)
{
- LogDebug("Fail to get contacts_record_get_child_record_at_p : " << errorCode);
+ LoggerD("Fail to get contacts_record_get_child_record_at_p : " << errorCode);
errorCode = contacts_record_create(_contacts_name._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
ThrowMsg(UnknownException, "creating name value B (errorCode:" << errorCode << ")");
errorCode = contacts_record_create(_contacts_company._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_company._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_company._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_company.name, name.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing company name N (err:" << errorCode << ", str:" << name << ")");
+ LoggerW("importing company name N (err:" << errorCode << ", str:" << name << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_company.department, department.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing department N (err:" << errorCode << ", str:" << department << ")");
+ LoggerW("importing department N (err:" << errorCode << ", str:" << department << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_company.job_title, title.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing title N (err:" << errorCode << ", str:" << title << ")");
+ LoggerW("importing title N (err:" << errorCode << ", str:" << title << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_company.role, role.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing role N (err:" << errorCode << ", str:" << role << ")");
+ LoggerW("importing role N (err:" << errorCode << ", str:" << role << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_company.logo, logoURI.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing logoURI N (err:" << errorCode << ", str:" << logoURI << ")");
+ LoggerW("importing logoURI N (err:" << errorCode << ", str:" << logoURI << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.company, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set company value to child_record");
+ LoggerW("Fail to set company value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_create(_contacts_note._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_note._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_note._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_note.note, note.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing note N (err:" << errorCode << ", str:" << note << ")");
+ LoggerW("importing note N (err:" << errorCode << ", str:" << note << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.note, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set note value to child_record");
+ LoggerW("Fail to set note value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
if(!phoneNumber->getNumberIsSet() || phoneNumber->getNumber().empty())
{
- LogDebug("Number was not set.");
+ LoggerD("Number was not set.");
continue;
}
errorCode = contacts_record_create(_contacts_number._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_number._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_number._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_number.number, number.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set number value to child_record number : " << number);
+ LoggerW("Fail to set number value to child_record number : " << number);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_bool(child_record, _contacts_number.is_default, ctsBoolDefault);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set number value to child_record default : " << ctsBoolDefault);
+ LoggerW("Fail to set number value to child_record default : " << ctsBoolDefault);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_number.type, ctsIntType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set number value to child_record type : " << ctsIntType);
+ LoggerW("Fail to set number value to child_record type : " << ctsIntType);
contacts_record_destroy(child_record, true);
continue;
}
// errorCode = contacts_record_set_str(child_record, _contacts_number.label, ctsStrCustomType);
// if(errorCode != CONTACTS_ERROR_NONE)
// {
- // LogWarning("Fail to set number value to child_record custom type : " << ctsStrCustomType);
+ // LoggerW("Fail to set number value to child_record custom type : " << ctsStrCustomType);
// contacts_record_destroy(child_record, true);
// continue;
// }
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.number, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set number value to child_record");
+ LoggerW("Fail to set number value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
if(!email->getEmailIsSet() || email->getEmail().empty())
{
- LogDebug("email address was not set.");
+ LoggerD("email address was not set.");
continue;
}
errorCode = contacts_record_create(_contacts_email._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_email._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_email._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_email.email, emailAddress.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set email value to child_record email : " << emailAddress);
+ LoggerW("Fail to set email value to child_record email : " << emailAddress);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_bool(child_record, _contacts_email.is_default, ctsBoolDefault);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set email value to child_record default : " << ctsBoolDefault);
+ LoggerW("Fail to set email value to child_record default : " << ctsBoolDefault);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_email.type, ctsIntType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set email value to child_record type : " << ctsIntType);
+ LoggerW("Fail to set email value to child_record type : " << ctsIntType);
contacts_record_destroy(child_record, true);
continue;
}
// errorCode = contacts_record_set_str(child_record, _contacts_email.label, ctsStrCustomType);
// if(errorCode != CONTACTS_ERROR_NONE)
// {
- // LogWarning("Fail to set email value to child_record custom type : " << ctsStrCustomType);
+ // LoggerW("Fail to set email value to child_record custom type : " << ctsStrCustomType);
// contacts_record_destroy(child_record, true);
// continue;
// }
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.email, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set email value to child_record");
+ LoggerW("Fail to set email value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
if(!ContactUtility::checkStrIsUInt(groupId))
{
- LogWarning("groupId (" << groupId << ") is wrong.");
+ LoggerW("groupId (" << groupId << ") is wrong.");
continue;
}
errorCode = contacts_record_create(_contacts_group_relation._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_group_relation._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_group_relation._uri)");
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_group_relation.group_id, groupIdInt);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing group id N (err:" << errorCode << ", str:" << groupIdInt << ")");
+ LoggerW("importing group id N (err:" << errorCode << ", str:" << groupIdInt << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_group_relation.contact_id, contactId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("importing group contact_id N (err:" << errorCode << ", str:" << contactId << ")");
+ LoggerW("importing group contact_id N (err:" << errorCode << ", str:" << contactId << ")");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.group_relation, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set group value to child_record");
+ LoggerW("Fail to set group value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_create(_contacts_event._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_event._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_event._uri)");
return;
}
errorCode = contacts_record_set_int(child_record, _contacts_event.type, CONTACTS_EVENT_TYPE_BIRTH);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record type : " << CONTACTS_EVENT_TYPE_BIRTH);
+ LoggerW("Fail to set event value to child_record type : " << CONTACTS_EVENT_TYPE_BIRTH);
contacts_record_destroy(child_record, true);
return;
}
errorCode = contacts_record_set_int(child_record, _contacts_event.date, birthday);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record date : " << birthday);
+ LoggerW("Fail to set event value to child_record date : " << birthday);
contacts_record_destroy(child_record, true);
return;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.event, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record");
+ LoggerW("Fail to set event value to child_record");
contacts_record_destroy(child_record, true);
return;
}
errorCode = contacts_record_create(_contacts_event._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_event._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_event._uri)");
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_event.type, CONTACTS_EVENT_TYPE_ANNIVERSARY);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record type : CONTACTS_EVENT_TYPE_ANNIVERSARY");
+ LoggerW("Fail to set event value to child_record type : CONTACTS_EVENT_TYPE_ANNIVERSARY");
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_event.date, date);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record date : " << date);
+ LoggerW("Fail to set event value to child_record date : " << date);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_event.label, label.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set label value to child_record label : " << label);
+ LoggerW("Fail to set label value to child_record label : " << label);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.event, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set event value to child_record");
+ LoggerW("Fail to set event value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
( !address->getAdditionalInformationIsSet() || address->getAdditionalInformation().empty() ) &&
( !address->getPostalCodeIsSet() || address->getPostalCode().empty() ) )
{
- LogDebug("No information for address was not set.");
+ LoggerD("No information for address was not set.");
continue;
}
errorCode = contacts_record_create(_contacts_address._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_address._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_address._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.country, country.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set country value to child_record str : " << country);
+ LoggerW("Fail to set country value to child_record str : " << country);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.region, region.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set region value to child_record str : " << region);
+ LoggerW("Fail to set region value to child_record str : " << region);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.locality, city.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set locality value to child_record str : " << city);
+ LoggerW("Fail to set locality value to child_record str : " << city);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.street, streetAddress.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set street value to child_record str : " << streetAddress);
+ LoggerW("Fail to set street value to child_record str : " << streetAddress);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.extended, additionalInformation.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set extended value to child_record str : " << additionalInformation);
+ LoggerW("Fail to set extended value to child_record str : " << additionalInformation);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_address.postal_code, postalCode.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set postal_code value to child_record str : " << postalCode);
+ LoggerW("Fail to set postal_code value to child_record str : " << postalCode);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_bool(child_record, _contacts_address.is_default, ctsBoolDefault);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set favorite value to child_record default : " << ctsBoolDefault);
+ LoggerW("Fail to set favorite value to child_record default : " << ctsBoolDefault);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_address.type, ctsIntType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set default value to child_record type : " << ctsIntType);
+ LoggerW("Fail to set default value to child_record type : " << ctsIntType);
contacts_record_destroy(child_record, true);
continue;
}
// errorCode = contacts_record_set_str(child_record, _contacts_address.label, ctsStrCustomType);
// if(errorCode != CONTACTS_ERROR_NONE)
// {
- // LogWarning("Fail to set custom value to child_record type : " << ctsStrCustomType);
+ // LoggerW("Fail to set custom value to child_record type : " << ctsStrCustomType);
// contacts_record_destroy(child_record, true);
// continue;
// }
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.address, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set address value to child_record");
+ LoggerW("Fail to set address value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
if(!webSite->getUrlIsSet() || webSite->getUrl().empty())
{
- LogDebug("url was not set.");
+ LoggerD("url was not set.");
continue;
}
errorCode = contacts_record_create(_contacts_url._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_url._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_url._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_url.url, url.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set url value to child_record str : " << url);
+ LoggerW("Fail to set url value to child_record str : " << url);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_int(child_record, _contacts_url.type, ctsIntType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set default value to child_record type : " << ctsIntType);
+ LoggerW("Fail to set default value to child_record type : " << ctsIntType);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_url.label, ctsStrCustomType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set custom value to child_record type : " << ctsStrCustomType);
+ LoggerW("Fail to set custom value to child_record type : " << ctsStrCustomType);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.url, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set url value to child_record");
+ LoggerW("Fail to set url value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
if(nickname.empty())
{
- LogDebug("nickname was not set.");
+ LoggerD("nickname was not set.");
continue;
}
errorCode = contacts_record_create(_contacts_nickname._uri, &child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to create child_record with contacts_record_create(_contacts_nickname._uri)");
+ LoggerW("Fail to create child_record with contacts_record_create(_contacts_nickname._uri)");
continue;
}
errorCode = contacts_record_set_str(child_record, _contacts_nickname.name, nickname.c_str());
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set nickname value to ctsValue str : " << nickname);
+ LoggerW("Fail to set nickname value to ctsValue str : " << nickname);
contacts_record_destroy(child_record, true);
continue;
}
errorCode = contacts_record_add_child_record(m_platformContact, _contacts_contact.nickname, child_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to set nickname value to child_record");
+ LoggerW("Fail to set nickname value to child_record");
contacts_record_destroy(child_record, true);
continue;
}
*/
#include "ContactObjectP2AConverter.h"
-
#include <vector>
#include <pcrecpp.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "AddressBook.h"
#include "Contact.h"
#include "ContactUtility.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
ContactPtr ContactObjectP2AConverter::getAbstractContact()
{
- //LogDebug("enter");
+ //LoggerD("enter");
if(m_platformContact == NULL)
{
- LogError("Platform contact object did not set");
+ LoggerE("Platform contact object did not set");
ThrowMsg(InvalidArgumentException, "Platform contact object did not set");
}
if(m_abstractContact == NULL)
{
- //LogDebug("Abstract contact object did not set, so a new object has been created");
+ //LoggerD("Abstract contact object did not set, so a new object has been created");
m_abstractContact = ContactPtr(new Contact());
}
- //LogDebug("for scratch : " << m_forScratch);
+ //LoggerD("for scratch : " << m_forScratch);
Try
{
}
Catch(Exception)
{
- LogError("Error while converting - " << _rethrown_exception.GetMessage());
+ LoggerE("Error while converting - " << _rethrown_exception.GetMessage());
ThrowMsg(PlatformException, "Fail to convert platform object to abstract object.");
}
bool isFavorite = false;
errorCode = contacts_record_get_bool(m_platformContact, _contacts_contact.is_favorite, &isFavorite);
if(errorCode != CONTACTS_ERROR_NONE)
- LogError("contacts_record_get_bool returned " << errorCode);
+ LoggerE("contacts_record_get_bool returned " << errorCode);
m_abstractContact->setIsFavorite(isFavorite);
}
if(child_record == NULL || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have name value");
+ //LoggerD("Platform contact don't have name value");
ContactNamePtr contactName = m_abstractContact->getName();
if(contactName != NULL)
{
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have company list");
+ //LoggerD("Platform contact don't have company list");
return;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have note list");
+ //LoggerD("Platform contact don't have note list");
return;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have number list");
+ //LoggerD("Platform contact don't have number list");
return;
}
}
else
{
- //LogDebug("Platform contact have a empty phone number");
+ //LoggerD("Platform contact have a empty phone number");
continue;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have email list");
+ //LoggerD("Platform contact don't have email list");
return;
}
}
else
{
- //LogDebug("Platform contact have a empty email address");
+ //LoggerD("Platform contact have a empty email address");
continue;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have group list");
+ //LoggerD("Platform contact don't have group list");
return;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have group list");
+ //LoggerD("Platform contact don't have group list");
return;
}
Try {
tmDate = ContactUtility::toDateTmFromDateDbInt(intValueDate);
} Catch(Exception) {
- LogError("date has wrong value");
+ LoggerE("date has wrong value");
}
contacts_record_get_int(child_record, _contacts_event.type, &intValueType);
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have address list");
+ //LoggerD("Platform contact don't have address list");
return;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have address list");
+ //LoggerD("Platform contact don't have address list");
return;
}
if(child_count == 0 || errorCode == CONTACTS_ERROR_NO_DATA)
{
- //LogDebug("Platform contact don't have nickname list");
+ //LoggerD("Platform contact don't have nickname list");
return;
}
#include "ContactQueue.h"
#include <dpl/singleton_impl.h>
+#include <Logger.h>
using namespace DPL;
bool ContactQueueManager::empty()
{
- LogDebug("count : " << count);
+ LoggerD("count : " << count);
if(count > 0)
return false;
void ContactQueueManager::increaseQueueList()
{
count++;
- LogDebug("count : " << count);
+ LoggerD("count : " << count);
}
void ContactQueueManager::decreaseQueueList()
{
if(count > 0)
count--;
- LogDebug("count : " << count);
+ LoggerD("count : " << count);
}
void ContactQueueManager::push(operationType type, AddressBook *addressBook, const EventAddressBookAddBatchPtr &event)
{
- LogDebug("push type : " << type);
+ LoggerD("push type : " << type);
queueProperties properties;
properties.addressBook = addressBook;
}
mapIndex++;
- LogDebug("mapIndex : " << mapIndex);
+ LoggerD("mapIndex : " << mapIndex);
m_addressBookQueueMap.insert(std::make_pair(mapIndex, properties));
}
void ContactQueueManager::push(operationType type, AddressBook *addressBook, const EventAddressBookUpdateBatchPtr &event)
{
- LogDebug("push type : " << type);
+ LoggerD("push type : " << type);
queueProperties properties;
properties.addressBook = addressBook;
}
mapIndex++;
- LogDebug("mapIndex : " << mapIndex);
+ LoggerD("mapIndex : " << mapIndex);
m_addressBookQueueMap.insert(std::make_pair(mapIndex, properties));
}
void ContactQueueManager::push(operationType type, AddressBook *addressBook, const EventAddressBookRemoveBatchPtr &event)
{
- LogDebug("push type : " << type);
+ LoggerD("push type : " << type);
queueProperties properties;
properties.addressBook = addressBook;
}
mapIndex++;
- LogDebug("mapIndex : " << mapIndex);
+ LoggerD("mapIndex : " << mapIndex);
m_addressBookQueueMap.insert(std::make_pair(mapIndex, properties));
}
void ContactQueueManager::push(operationType type, ContactManager *contactManager, const EventContactManagerUpdateBatchPtr &event)
{
- LogDebug("push type : " << type);
+ LoggerD("push type : " << type);
queueProperties properties;
properties.contactManager = contactManager;
}
mapIndex++;
- LogDebug("mapIndex : " << mapIndex);
+ LoggerD("mapIndex : " << mapIndex);
m_addressBookQueueMap.insert(std::make_pair(mapIndex, properties));
}
void ContactQueueManager::push(operationType type, ContactManager *contactManager, const EventContactManagerRemoveBatchPtr &event)
{
- LogDebug("push type : " << type);
+ LoggerD("push type : " << type);
queueProperties properties;
properties.contactManager = contactManager;
}
mapIndex++;
- LogDebug("mapIndex : " << mapIndex);
+ LoggerD("mapIndex : " << mapIndex);
m_addressBookQueueMap.insert(std::make_pair(mapIndex, properties));
}
void ContactQueueManager::pop()
{
currentIndex++;
- LogDebug("currentIndex : " << currentIndex << " / mapIndex : " << mapIndex);
+ LoggerD("currentIndex : " << currentIndex << " / mapIndex : " << mapIndex);
AddressBookQueueMap::iterator iter = m_addressBookQueueMap.find(currentIndex);
queueProperties properties = iter->second;
*/
#include "ContactRef.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
#include <ctime>
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
namespace DeviceAPI {
#include "Contact.h"
#include "ContactObjectP2AConverter.h"
#include "ContactUtility.h"
+#include <Logger.h>
#define _CONTACTS_SVC_QUERY_FUNC_PREFIX(view_uri, query, filter) \
do { \
ContactArrayPtr result(NULL);
unsigned int length = 0;
- LogDebug("entered");
+ LoggerD("entered");
if(m_isFilterSet)
{
if(m_isSortModeSet)
AttributeProperties &property = iter->second;
length = m_filteredContactIds->size();
- LogDebug("length : " << length);
+ LoggerD("length : " << length);
if(length != 0)
{
else
{
length = m_filteredContactIds->size();
- LogDebug("length : " << length);
+ LoggerD("length : " << length);
if(length != 0)
{
result = getContacts(m_filteredContactIds);
result = getAllContacts();
}
}
- LogDebug("End");
+ LoggerD("End");
return result;
}
map<int,ContactPtr>::iterator idPair = contactMap.find(id);
if(idPair == contactMap.end())
{
- LogWarning("no contact id : " << id);
+ LoggerW("no contact id : " << id);
continue;
}
contacts->push_back(idPair->second);
ContactArrayPtr contacts(new ContactArray());
contacts_list_h list = NULL;
- LogDebug("start : " << m_isAddressBookIdSet);
+ LoggerD("start : " << m_isAddressBookIdSet);
if(!m_isAddressBookIdSet)
{
errorCode = contacts_list_get_current_record_p(list, &record);
if(errorCode != CONTACTS_ERROR_NONE || record == NULL)
{
- LogWarning("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerW("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
continue;
}
}
Catch(Exception)
{
- LogWarning("fail to convert contact");
+ LoggerW("fail to convert contact");
continue;
}
if(list != NULL)
contacts_list_destroy(list, true);
- LogDebug("end");
+ LoggerD("end");
return contacts;
}
}
Catch(Exception)
{
- LogWarning(_rethrown_exception.GetMessage());
+ LoggerW(_rethrown_exception.GetMessage());
continue;
}
}
}
Catch(Exception)
{
- LogWarning(_rethrown_exception.GetMessage());
+ LoggerW(_rethrown_exception.GetMessage());
continue;
}
}
errorCode = contacts_db_get_record(_contacts_contact._uri, id, &record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("No contact (id:" << id << ") : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerE("No contact (id:" << id << ") : " << errorCode << " (" << __FUNCTION__ << ")");
return ContactPtr(NULL);
}
errorCode = contacts_record_get_int(record, _contacts_contact.address_book_id, &addressBookId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogError("No contact (id:" << id << ") 2 : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerE("No contact (id:" << id << ") 2 : " << errorCode << " (" << __FUNCTION__ << ")");
return ContactPtr(NULL);
}
const char* view_uri = attributeProperties.viewUri;
unsigned int property_contact_id = attributeProperties.propertyContactId;
unsigned int property_id = attributeProperties.propertyId;
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_query_h query = NULL;
}
_CONTACTS_SVC_QUERY_FUNC_SUFFIX(query, filter, list, property_contact_id, result);
- LogDebug("end");
+ LoggerD("end");
}
void ContactSearchEngine::sortContacts(AttributeProperties& attributeProperties, ContactIdArrayPtr& result,
unsigned int property_contact_id = attributeProperties.propertyContactId;
unsigned int property_id = attributeProperties.propertyId;
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_query_h query = NULL;
if(query != NULL)
contacts_query_destroy(query);
- LogDebug("end");
+ LoggerD("end");
}
void ContactSearchEngine::sortContacts(AttributeProperties& attributeProperties, ContactIdArrayPtr& result,
*/
#include "ContactsSvcChangeListenerManager.h"
-
#include <contacts.h>
-
-#include <dpl/log/log.h>
#include <dpl/singleton_impl.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "ContactObjectP2AConverter.h"
#include "ContactsSvcObjectConverter.h"
#include "Person.h"
+#include <Logger.h>
IMPLEMENT_SINGLETON(DeviceAPI::Contact::ContactsSvcChangeListenerManager)
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
{
if(iter->first == addressBookId)
{
- LogWarning("Callbacks " << callbacks << " is already registered.");
+ LoggerW("Callbacks " << callbacks << " is already registered.");
return;
}
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
if(m_contactsChangeListenerMap.size() == 0)
{
- LogWarning("No callbacks are registered.");
+ LoggerW("No callbacks are registered.");
return;
}
if(iter == m_contactsChangeListenerMap.end())
{
- LogWarning("Callbacks " << callbacks << " are not registered.");
+ LoggerW("Callbacks " << callbacks << " are not registered.");
return;
}
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
PersonsChangeListenerSet::iterator iter = m_personsChangeListenerSet.find(callbacks);
if(iter != m_personsChangeListenerSet.end())
{
- LogWarning("Callbacks " << callbacks << " is already registered.");
+ LoggerW("Callbacks " << callbacks << " is already registered.");
return;
}
{
if(callbacks == NULL)
{
- LogWarning("Parameter is NULL.");
+ LoggerW("Parameter is NULL.");
return;
}
if(m_personsChangeListenerSet.size() == 0)
{
- LogWarning("No callbacks are registered.");
+ LoggerW("No callbacks are registered.");
return;
}
PersonsChangeListenerSet::iterator iter = m_personsChangeListenerSet.find(callbacks);
if(iter == m_personsChangeListenerSet.end())
{
- LogWarning("Callbacks " << callbacks << " are not registered.");
+ LoggerW("Callbacks " << callbacks << " are not registered.");
return;
}
void ContactsSvcChangeListenerManager::contactsDbChangedCallback(const char* view_uri, void* user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogWarning("contacts-service listener passed NULL user_data");
+ LoggerW("contacts-service listener passed NULL user_data");
return;
}
void ContactsSvcChangeListenerManager::contactsDbChangedCallback(const char* view_uri)
{
- LogDebug("entered");
+ LoggerD("entered");
string view_uri_str = view_uri;
if(view_uri_str == _contacts_contact._uri)
void ContactsSvcChangeListenerManager::personsDbChangedCallback(const char* view_uri, char* changes, void* user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
if(user_data == NULL)
{
- LogWarning("contacts-service listener passed NULL user_data");
+ LoggerW("contacts-service listener passed NULL user_data");
return;
}
void ContactsSvcChangeListenerManager::personsDbChangedCallback(const char* view_uri, char* changes)
{
- LogDebug("entered");
+ LoggerD("entered");
personsChangedCallback(changes);
}
void ContactsSvcChangeListenerManager::contactsChangedCallback()
{
- LogDebug("entered");
+ LoggerD("entered");
if(!m_contactsChangedCallbackRegistered)
return;
m_latestVersion, &change_record_list, &latestVersion);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail to get the updated contacts for addressbook : " << addressBookId << ", errorCode : " << errorCode);
+ LoggerD("Fail to get the updated contacts for addressbook : " << addressBookId << ", errorCode : " << errorCode);
if(change_record_list != NULL)
contacts_list_destroy(change_record_list, true);
}else{
errorCode = contacts_list_get_count(change_record_list, &record_count);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("cannot get the updated contact count error : " << errorCode);
+ LoggerD("cannot get the updated contact count error : " << errorCode);
continue;
}
if(record_count == 0)
{
- LogDebug("No updated contacts for address book : " << addressBookId);
+ LoggerD("No updated contacts for address book : " << addressBookId);
continue;
}
errorCode = contacts_list_get_current_record_p(change_record_list, &contact_updated_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_list_get_current_record_p error : " << errorCode);
+ LoggerD("Fail contacts_list_get_current_record_p error : " << errorCode);
continue;
}
_contacts_contact_updated_info.contact_id, &updatedContactId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_record_get_int error contact_id : " << errorCode);
+ LoggerD("Fail contacts_record_get_int error contact_id : " << errorCode);
continue;
}
_contacts_contact_updated_info.address_book_id ,&updatedAddressBookId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_record_get_int error address_book_id : " << errorCode);
+ LoggerD("Fail contacts_record_get_int error address_book_id : " << errorCode);
continue;
}
_contacts_contact_updated_info.type ,&updatedType);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_record_get_int error type : " << errorCode);
+ LoggerD("Fail contacts_record_get_int error type : " << errorCode);
continue;
}
errorCode = contacts_db_get_record(_contacts_contact._uri, updatedContactId, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
+ LoggerD("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
continue;
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
continue;
}
errorCode = contacts_db_get_record(_contacts_contact._uri, updatedContactId, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
+ LoggerD("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
continue;
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
continue;
}
if(absContact != NULL)
errorCode = contacts_db_get_current_version(&m_latestVersion);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_get_current_version returns error : " << errorCode);
+ LoggerW("contacts_db_get_current_version returns error : " << errorCode);
}
}
if(m_contactsChangedCallbackRegistered)
{
- LogWarning("Callback already registered.");
+ LoggerW("Callback already registered.");
return;
}
contactsDbChangedCallback, reinterpret_cast<void *>(this));
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_add_changed_cb(_contacts_contact._uri) returns error : " << errorCode);
+ LoggerW("contacts_db_add_changed_cb(_contacts_contact._uri) returns error : " << errorCode);
ThrowMsg(InvalidArgumentException, "Error while registering listener to contacts-service");
}
errorCode = contacts_db_get_current_version(&m_latestVersion);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_get_current_version returns error : " << errorCode);
+ LoggerW("contacts_db_get_current_version returns error : " << errorCode);
ThrowMsg(InvalidArgumentException, "Error while registering listener to contacts-service");
}
if(!m_contactsChangedCallbackRegistered)
{
- LogWarning("Callback already unregistered.");
+ LoggerW("Callback already unregistered.");
return;
}
contactsDbChangedCallback, reinterpret_cast<void *>(this));
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_remove_changed_cb(_contacts_contact._uri) returns error : " << errorCode);
+ LoggerW("contacts_db_remove_changed_cb(_contacts_contact._uri) returns error : " << errorCode);
ThrowMsg(InvalidArgumentException, "Error while registering listener to contacts-service");
}
}
void ContactsSvcChangeListenerManager::registerContactsSvcPersonsChangedCallback()
{
int errorCode = 0;
- LogDebug("entered");
+ LoggerD("entered");
if(m_personsChangedCallbackRegistered)
{
- LogWarning("Callback already registered.");
+ LoggerW("Callback already registered.");
return;
}
personsDbChangedCallback, reinterpret_cast<void *>(this));
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_add_changed_cb(_contacts_person._uri) returns error : " << errorCode);
+ LoggerW("contacts_db_add_changed_cb(_contacts_person._uri) returns error : " << errorCode);
ThrowMsg(InvalidArgumentException, "Error while registering listener to contacts-service");
}
if(!m_personsChangedCallbackRegistered)
{
- LogWarning("Callback already unregistered.");
+ LoggerW("Callback already unregistered.");
return;
}
personsDbChangedCallback, reinterpret_cast<void *>(this));
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_db_remove_changed_cb(_contacts_person._uri) returns error : " << errorCode);
+ LoggerW("contacts_db_remove_changed_cb(_contacts_person._uri) returns error : " << errorCode);
ThrowMsg(InvalidArgumentException, "Error while registering listener to contacts-service");
}
}
void ContactsSvcChangeListenerManager::personsChangedCallback(char* changes)
{
- LogDebug("entered : " << changes);
+ LoggerD("entered : " << changes);
if(!m_personsChangedCallbackRegistered)
return;
{
int updatedType = it->first;
int updatedContactId = it->second;
-// LogDebug("updatedContactId : " << updatedContactId << " , updatedType : " << updatedType);
+// LoggerD("updatedContactId : " << updatedContactId << " , updatedType : " << updatedType);
if(updatedType == CONTACTS_CHANGE_INSERTED)
{
errorCode = contacts_db_get_record(_contacts_person._uri, updatedContactId, &person_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
+ LoggerD("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
continue;
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
continue;
}
if(absPerson != NULL)
addedPersons->push_back(absPerson);
else
- LogDebug("absPerson is null");
+ LoggerD("absPerson is null");
if(person_record != NULL)
contacts_record_destroy(person_record, true);
errorCode = contacts_db_get_record(_contacts_person._uri, updatedContactId, &person_record);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogDebug("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
+ LoggerD("Fail contacts_db_get_record error _contacts_contact._uri : " << errorCode);
continue;
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
continue;
}
if(absPerson != NULL)
#include <vector>
#include <pcrecpp.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "Contact.h"
#include "ContactUtility.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
if(newValueStr != NULL)
{
- LogDebug("update photoURI : " << newValueStr);
+ LoggerD("update photoURI : " << newValueStr);
int personId = ContactUtility::strToInt(person->getId());
contacts_filter_h filter = NULL;
errorCode = contacts_list_get_current_record_p(list, &record);
if(errorCode != CONTACTS_ERROR_NONE || record == NULL)
{
- LogWarning("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerW("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
continue;
}
contacts_record_get_int(record, _contacts_simple_contact.id, &id);
contacts_record_get_str_p(record, _contacts_simple_contact.image_thumbnail_path, &charValue);
- LogDebug("id : " << id);
- LogDebug("charValue : " << charValue);
+ LoggerD("id : " << id);
+ LoggerD("charValue : " << charValue);
/*
if((charValue == NULL) && g_strcmp0(newValueStr, EMPTY_STRING) == 0){
is_success = true;
query = NULL;
list = NULL;
- LogDebug("targetId : " << targetId);
+ LoggerD("targetId : " << targetId);
errorCode = contacts_query_create(_contacts_image._uri, &query);
if(errorCode != CONTACTS_ERROR_NONE)
errorCode = contacts_list_get_current_record_p(list, &imageRecord);
if(errorCode != CONTACTS_ERROR_NONE || imageRecord == NULL)
{
- LogWarning("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerW("contacts_list_get_current_record_p error : " << errorCode << " (" << __FUNCTION__ << ")");
continue;
}
errorCode = contacts_record_get_int(imageRecord, _contacts_image.id, &imageId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_record_get_int error : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerW("contacts_record_get_int error : " << errorCode << " (" << __FUNCTION__ << ")");
continue;
}
errorCode = contacts_list_next(list);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("contacts_list_next error : " << errorCode << " (" << __FUNCTION__ << ")");
+ LoggerW("contacts_list_next error : " << errorCode << " (" << __FUNCTION__ << ")");
break;
}
}
#include <dpl/exception.h>
#include <dpl/singleton_impl.h>
#include "AddressBook.h"
+#include <Logger.h>
IMPLEMENT_SINGLETON(DeviceAPI::Contact::ContactsSvcWrapper)
if (ret != CONTACTS_ERROR_NONE)
{
//error during closing contacts database
- LogError("Error occurred during closing contacts database. (ret:" << ret << ")");
+ LoggerE("Error occurred during closing contacts database. (ret:" << ret << ")");
}
}
}
if(!m_opened) {
//when database is not opened then set result as failed
- LogError("Contact db is not open.");
+ LoggerE("Contact db is not open.");
ThrowMsg(PlatformException, "Contact DB is not open.");
}
if(!m_opened) {
//when database is not opened then set result as failed
- LogError("Contact db is not open.");
+ LoggerE("Contact db is not open.");
ThrowMsg(PlatformException, "Contact DB is not open.");
}
if(!m_opened) {
//when database is not opened then set result as failed
- LogError("Contact db is not open.");
+ LoggerE("Contact db is not open.");
ThrowMsg(PlatformException, "Contact DB is not open.");
}
if(!m_opened) {
//when database is not opened then set result as failed
- LogError("Contact db is not open.");
+ LoggerE("Contact db is not open.");
ThrowMsg(PlatformException, "Contact DB is not open.");
}
if (m_opened)
return;
- LogDebug("entered");
+ LoggerD("entered");
int ret = contacts_connect2();
if (ret != CONTACTS_ERROR_NONE)
{
//error during opening contacts database
- LogError("Error occurred during opening contacts database. (ret:"
+ LoggerE("Error occurred during opening contacts database. (ret:"
<< ret << ")");
m_opened = false;
}
//contacts-service has properly connected.
- LogDebug("Contact db has properly opened.");
+ LoggerD("Contact db has properly opened.");
m_opened = true;
loadAddressBooks();
void ContactsSvcWrapper::loadAddressBooks()
{
- LogDebug("Loading AddressBook");
+ LoggerD("Loading AddressBook");
int errorCode = 0;
contacts_list_h addressbooks_list = NULL;
errorCode = contacts_list_get_current_record_p(addressbooks_list, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE || contacts_record == NULL)
{
- LogWarning("Fail to get addressbook record (ret:" << errorCode << ")");
+ LoggerW("Fail to get addressbook record (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_int(contacts_record, _contacts_address_book.id, &id);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get id from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get id from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_int(contacts_record, _contacts_address_book.account_id, &accountId);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get account id from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get account id from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_int(contacts_record, _contacts_address_book.mode, &mode);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get mode from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get mode from address book (ret:" << errorCode << ")");
continue;
}
errorCode = contacts_record_get_str_p(contacts_record, _contacts_address_book.name, &name);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get name from address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get name from address book (ret:" << errorCode << ")");
continue;
}
- LogDebug(" AddressBook [id:" << id << ", name:" << name <<
+ LoggerD(" AddressBook [id:" << id << ", name:" << name <<
", accId:" << accountId << ", mode:" << mode << "]");
AddressBook *addressBook = new AddressBook(false);
errorCode = contacts_list_next(addressbooks_list);
if(errorCode != CONTACTS_ERROR_NONE)
{
- LogWarning("Fail to get netx address book (ret:" << errorCode << ")");
+ LoggerW("Fail to get netx address book (ret:" << errorCode << ")");
break;
}
}
}
Catch(Exception)
{
- LogError("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
+ LoggerE("Fail error on converting contact to abs contact : " << _rethrown_exception.GetMessage());
if(addressbooks_list != NULL)
contacts_list_destroy(addressbooks_list, true);
return;
#include <Commons/ThreadPool.h>
#include "IAddressBook.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
EventRequestReceiver< EventAddressBookGetGroups >(ThreadEnum::NULL_THREAD)
{
//Nothing to do
- LogDebug("entered");
+ LoggerD("entered");
}
IAddressBook::~IAddressBook()
{
//Nothing to do
-// LogDebug("entered");
+// LoggerD("entered");
}
void IAddressBook::get(const EventAddressBookGetPtr &event)
#include <vector>
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include "EventAddressBookGet.h"
#include <ctime>
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/enable_shared_from_this.h>
#include "ContactTypes.h"
*/
#include "IPerson.h"
-
#include <Commons/ThreadPool.h>
#include "ContactFactory.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
#include <string>
#include <vector>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include "EventPersonLink.h"
#include "EventPersonUnlink.h"
* @brief Implementation of the JSAddressBook class
*/
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSWebAPIError.h>
#include <JSUtil.h>
#include <TimeTracer.h>
+#include <Logger.h>
using namespace std;
const JSClassRef JSAddressBook::getClassRef()
{
- LogInfo("entered");
+ LoggerI("entered");
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
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);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->get(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << id);
+ LoggerE("Not Found error : " << id);
oss << "No Contact id '" << id << "'";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
Try {
result = converter->toJSValueRef(contact);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(InvalidArgumentException, "1st argument is not a 'Contact object'.");
contact = converter->toContact(arguments[0]);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument must be a 'Contact object'");
}
Try {
addressBook->add(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
dplEvent->setContacts(converter->toContactArray(arguments[0]));
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument must be an array of 'Contact object'");
}
addressBook->addBatch(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(InvalidArgumentException, "1st argument is not a 'Contact object'.");
contact = converter->toContact(arguments[0]);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument is not a 'Contact object'");
}
Try {
addressBook->update(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
dplEvent->setContacts(converter->toContactArray(arguments[0]));
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be an array of 'Contact object'");
}
addressBook->updateBatch(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
}
addressBook = controller->getObject();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->remove(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << contactId);
+ LoggerE("Not Found error : " << contactId);
oss << "No Contact id '" << contactId << "'";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
dplEvent->setContactIds(converter->toStringArray(arguments[0]));
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be an array of 'Contact id'");
}
addressBook->removeBatch(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
if (js3rdParamIsObject)
dplEvent->setFilter(filterConverter->toFilter(arguments[2]));
} Catch(Exception) {
- LogError("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be an 'Filter object' or 'null'");
}
if (js4thParamIsObject)
dplEvent->setSortMode(filterConverter->toSortMode(arguments[3]));
} Catch(Exception) {
- LogError("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "4th argument must be an 'SortMode object' or 'null'");
}
addressBook->find(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(ConversionException, "2nd argument must have at least one function");
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Try {
addressBook->addChangeListener(dplEvent);
} 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");
}
result = JSUtil::toJSValueRef(context, watchId);
// result = converter->toJSValueRefLong(watchId);
} 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);
AddressBookPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->removeChangeListener(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->getGroup(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << id);
+ LoggerE("Not Found error : " << id);
oss << "No Contact id '" << id << "'";
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, oss.str());
Try {
result = converter->toJSValueRef(group);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
group = converter->toContactGroup(arguments[0]);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "1st argument must be a 'ContactGroup object'");
}
Try {
addressBook->addGroup(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(InvalidArgumentException, "1st argument is not a 'ContactGroup object'.");
contact = converter->toContactGroup(arguments[0]);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument is not a 'ContactGroup object'");
}
Try {
addressBook->updateGroup(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
}
addressBook = controller->getObject();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->removeGroup(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << groupId);
+ LoggerE("Not Found error : " << groupId);
oss << "No Contact id '" << groupId << "'";
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, oss.str());
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AddressBookPtr addressBook;
AddressBookController *controller;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->getGroups(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << id);
+ LoggerE("Not Found error : " << id);
oss << "No Contact id '" << id << "'";
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, oss.str());
Try {
result = converter->toJSValueRef(groups);
} 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");
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSAddressBookArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include "JSAddressBookChangeCallbackManager.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
{
if ( m_onContactsAdded == NULL )
{
- //LogDebug("oncontactsadded callback is not set");
+ //LoggerD("oncontactsadded callback is not set");
return;
}
JSValueRef objParam[1] = { contacts };
{
if ( m_onContactsUpdated == NULL )
{
- //LogDebug("oncontactsupdated callback is not set");
+ //LoggerD("oncontactsupdated callback is not set");
return;
}
JSValueRef objParam[1] = { contacts };
{
if ( m_onContactsDeleted == NULL )
{
- //LogDebug("oncontactsdeleted callback is not set");
+ //LoggerD("oncontactsdeleted callback is not set");
return;
}
JSValueRef objParam[1] = { contactIds };
{
if ( m_onError == NULL )
{
- //LogDebug("Error callback is not set");
+ //LoggerD("Error callback is not set");
return;
}
JSValueRef objParam[1] = { error };
if (callback == NULL)
{
- LogError("callback is NULL");
+ LoggerE("callback is NULL");
return;
}
{
if (argc == 0)
{
- //LogDebug("Calling object directly, no arguments");
+ //LoggerD("Calling object directly, no arguments");
JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
}
else
{
- //LogDebug("Calling object directly, one argument");
+ //LoggerD("Calling object directly, one argument");
JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
}
return;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSAttributesOfInterestArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
JSStringRef propertyName,
JSValueRef* exception)
{
- //LogDebug("enter");
+ //LoggerD("enter");
Try
{
JSAttributesOfInterestArrayPriv* priv =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
void JSAttributesOfInterestArray::initialize(JSContextRef context,
JSObjectRef object)
{
- //LogDebug("enter");
+ //LoggerD("enter");
}
void JSAttributesOfInterestArray::finalize(JSObjectRef object)
{
- //LogDebug("enter");
+ //LoggerD("enter");
JSAttributesOfInterestArrayPriv* priv =
static_cast<JSAttributesOfInterestArrayPriv*>(JSObjectGetPrivate(object));
delete priv;
JSObjectRef object,
JSStringRef propertyName)
{
- //LogDebug("enter");
+ //LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
WrtDeviceApis::CommonsJavaScript::BasicConverterFactory::getConverter(context);
Try
JSStringRef propertyName,
JSValueRef* exception)
{
- //LogDebug("enter");
+ //LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
WrtDeviceApis::CommonsJavaScript::BasicConverterFactory::getConverter(context);
Try
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- //LogDebug("enter");
+ //LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
WrtDeviceApis::CommonsJavaScript::BasicConverterFactory::getConverter(context);
Try
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("enter");
+ //LoggerD("enter");
Try
{
AttributesOfInterestArrayPtr typeArray =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
std::string result;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
ContactConverterFactory::ConverterType converter =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("enter");
+ //LoggerD("enter");
Try
{
if (argumentCount < 1) {
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
Try
{
WrtDeviceApis::CommonsJavaScript::BasicConverter converter =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
return join(context, function, thisObject, 0, arguments, exception);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- //LogDebug("entered");
+ //LoggerD("entered");
return JSValueMakeUndefined(context);
}
* @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);
#include "ContactConverter.h"
#include "JSContactAddress.h"
#include "JSContactAddressTypeArray.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "ContactAddress"
JSContactAddressPriv *priv = new JSContactAddressPriv(context, contactAddress);
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 js1stParamIsObject = false;
}
} Catch(Exception ) {
- 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 a 'ContactAddressInit object'");
return NULL;
}
contactEmailAddress = ContactAddressPtr(new ContactAddress());
} Catch(Exception) {
- 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 a 'ContactAddressInit object'");
return NULL;
}
Try {
jsobject = createJSObject(gContext, contactEmailAddress);
} 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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactAddressArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactAddressTypeArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactAnniversary.h"
+#include <Logger.h>
#define FILTER_CLASS_NAME "Anniversary"
#define CONTACT_ATTR_DATE "date"
JSContactAnniversaryPriv *priv = new JSContactAnniversaryPriv(context, contactAnniversary);
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");
JSContactAnniversaryPriv *priv = static_cast<JSContactAnniversaryPriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
date = converter->toDateTm(arguments[0]);
contactAnniversary->setDate(date);
} Catch(Exception) {
- 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 a 'Date object'");
return NULL;
}
Try {
jsobject = createJSObject(gContext, contactAnniversary);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactAnniversaryArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
#include "ContactConverter.h"
#include "JSContactEmailAddressTypeArray.h"
#include "JSContactEmailAddress.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "EmailAddress"
JSContactEmailAddressPriv *priv = new JSContactEmailAddressPriv(context, emailAddress);
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");
JSContactEmailAddressPriv *priv = static_cast<JSContactEmailAddressPriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
Try {
jsobject = createJSObject(gContext, contactEmailAddress);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactEmailAddressArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactEmailAddressTypeArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include "JSContactGroup.h"
-
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "ContactGroup"
#define CONTACT_PROP_ATTR_ID "id"
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");
JSContactGroupPriv *priv = static_cast<JSContactGroupPriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
Try {
jsobject = createJSObject(gContext, contactGroup);
} 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 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);
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactGroupArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
#include "JSContactManager.h"
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include <ArgumentValidator.h>
#include <JSWebAPIError.h>
#include <TimeTracer.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
void JSContactManager::Initialize(JSContextRef context,
JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
ContactManagerPtr contactManager = ContactFactory::getInstance().createContactManager();
ContactManagerController *priv = new ContactManagerController(context, contactManager);
void JSContactManager::Finalize(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
ContactManagerController *priv = static_cast<ContactManagerController*>(JSObjectGetPrivate(object));
- LogInfo("Delete address book manager");
+ LoggerI("Delete address book manager");
delete priv;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr contactManager;
JSContextRef gContext;
contactManager = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
contactManager->getAddressBooks(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerController *priv =
static_cast<ContactManagerController*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
contactManager = priv->getObject();
gContext = priv->getContext();
} Catch(Exception) {
- LogError("contact manager or context is null");
+ LoggerE("contact manager or context is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
contactManager->getDefaultAddressBook(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error");
+ LoggerE("Not Found error");
oss << "No default address book";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
Try {
resultValue = converter->toJSValueRef(defaultAddressBook);
} Catch(Exception){
- LogError("Conversion error.");
+ LoggerE("Conversion error.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerController *priv =
static_cast<ContactManagerController*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
contactManager = priv->getObject();
gContext = priv->getContext();
} Catch(Exception) {
- LogError("contact manager or context is null");
+ LoggerE("contact manager or context is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
contactManager->getUnifiedAddressBook(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error");
+ LoggerE("Not Found error");
oss << "No default address book";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
Try {
resultValue = converter->toJSValueRef(unifiedAddressBook);
} Catch(Exception){
- LogError("Conversion error.");
+ LoggerE("Conversion error.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerController *priv =
static_cast<ContactManagerController*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
contactManager = priv->getObject();
gContext = priv->getContext();
} Catch(Exception) {
- LogError("contact manager or context is null");
+ LoggerE("contact manager or context is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
contactManager->getAddressBook(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << addressBookId);
+ LoggerE("Not Found error : " << addressBookId);
oss << "No Contact id '" << addressBookId << "'";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
Try {
resultValue = converter->toJSValueRef(addressBook);
} Catch(Exception){
- LogError("Conversion error.");
+ LoggerE("Conversion error.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Internal error");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
ContactManagerController *controller;
}
addressBook = controller->getObject();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
if (argumentCount < 1) {
/* 1st Argument must be string. */
- LogError("1st argument must not be undefined.");
+ LoggerE("1st argument must not be undefined.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, "No Contact id 'undefined'");
}
Try {
addressBook->get(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << id);
+ LoggerE("Not Found error : " << id);
oss << "No Person id '" << id << "'";
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, oss.str());
break;
Try {
result = converter->toJSValueRef(person);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
ContactManagerController *controller;
}
addressBook = controller->getObject();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(InvalidArgumentException, "1st argument is not a 'Contact object'.");
person = converter->toPerson(arguments[0]);
} Catch(Exception) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "1st argument is not a 'Contact object'");
}
Try {
addressBook->update(dplEvent);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
dplEvent->setPersons(converter->toPersonArray(arguments[0]));
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be a 'function' or a 'null'");
}
addressBook->updateBatch(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
ContactManagerController *controller;
}
addressBook = controller->getObject();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->remove(dplEvent);
} 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");
}
{
case ExceptionCodes::NotFoundException:
case ExceptionCodes::InvalidArgumentException:
- LogError("Not Found error : " << personId);
+ LoggerE("Not Found error : " << personId);
oss << "No Contact id '" << personId << "'";
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, oss.str());
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
dplEvent->setPersonIds(converter->toStringArray(arguments[0]));
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be an array of 'Contact id'");
}
addressBook->removeBatch(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
if (js3rdParamIsObject)
dplEvent->setFilter(filterConverter->toFilter(arguments[2]));
} Catch(Exception) {
- LogError("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on 3rd parameter conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "3rd argument must be an 'Filter object' or 'null'");
}
if (js4thParamIsObject)
dplEvent->setSortMode(filterConverter->toSortMode(arguments[3]));
} Catch(Exception) {
- LogError("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on 4th parameter conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "4th argument must be an 'SortMode object' or 'null'");
}
addressBook->find(dplEvent);
ContactAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
} 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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
ContactManagerPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
ThrowMsg(ConversionException, "2nd argument must have at least one function");
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Try {
addressBook->addChangeListener(dplEvent);
} 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->toJSValueRefLong(watchId);
} 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);
ContactManagerPtr addressBook;
JSContextRef gContext;
addressBook = controller->getObject();
gContext = controller->getContext();
} Catch(Exception) {
- LogError("No private object");
+ LoggerE("No private object");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong object");
}
Try {
addressBook->removeChangeListener(dplEvent);
} 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");
}
*/
#include "JSContactManagerChangeCallbackManager.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
{
if ( m_onPersonsAdded == NULL )
{
- //LogDebug("onpersonsadded callback is not set");
+ //LoggerD("onpersonsadded callback is not set");
return;
}
JSValueRef objParam[1] = { contacts };
{
if ( m_onPersonsUpdated == NULL )
{
- //LogDebug("onpersonsupdated callback is not set");
+ //LoggerD("onpersonsupdated callback is not set");
return;
}
JSValueRef objParam[1] = { contacts };
{
if ( m_onPersonsDeleted == NULL )
{
- //LogDebug("onpersonsdeleted callback is not set");
+ //LoggerD("onpersonsdeleted callback is not set");
return;
}
JSValueRef objParam[1] = { contactIds };
{
if ( m_onError == NULL )
{
- //LogDebug("Error callback is not set");
+ //LoggerD("Error callback is not set");
return;
}
JSValueRef objParam[1] = { error };
if (callback == NULL)
{
- LogError("callback is NULL");
+ LoggerE("callback is NULL");
return;
}
{
if (argc == 0)
{
- //LogDebug("Calling object directly, no arguments");
+ //LoggerD("Calling object directly, no arguments");
JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
}
else
{
- //LogDebug("Calling object directly, one argument");
+ //LoggerD("Calling object directly, one argument");
JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
}
return;
* @brief Implementation of the JSContactName class
*/
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactName.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "ContactName"
#define CONTACT_PROP_ATTR_PREFIX "prefix"
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 js1stParamIsObject = false;
}
} Catch(Exception ) {
- 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 'object'");
return NULL;
}
contactName = ContactNamePtr(new ContactName());
} 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, contactName);
} 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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
}
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);
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
+#include <Logger.h>
#define ORGANIZATION_CLASS_NAME "ContactOrganization"
JSContactOrganizationPriv *priv = new JSContactOrganizationPriv(context, contactOrganization);
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 js1stParamIsObject = false;
}
} Catch(Exception ) {
- 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 a 'object'");
return NULL;
}
contactOrganization = ContactOrganizationPtr(new ContactOrganization());
} 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, contactOrganization);
} 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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactOrganizationArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
* @brief Implementation of the JSContactPhoneNumber class
*/
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSTizenExceptionFactory.h>
#include "ContactConverter.h"
#include "JSContactPhoneNumberTypeArray.h"
#include "JSContactPhoneNumber.h"
+#include <Logger.h>
#define FILTER_CLASS_NAME "ContactPhoneNumber"
JSContactPhoneNumberPriv *priv = new JSContactPhoneNumberPriv(context, contactPhoneNumber);
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");
JSContactPhoneNumberPriv *priv = static_cast<JSContactPhoneNumberPriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
Try {
jsobject = createJSObject(gContext, contactPhoneNumber);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactPhoneNumberArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactPhoneNumberTypeArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
* @brief Implementation of the JSContactRef class
*/
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactRef.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "ContactRef"
#define CONTACT_PROP_ATTR_ADDRESS_BOOK_ID "addressBookId"
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");
JSContactRefPriv *priv = static_cast<JSContactRefPriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
ThrowMsg(InvalidArgumentException, "2nd argument must be contact id");
} Catch(Exception ) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Wrong arguments");
return NULL;
}
Try {
addressBookId = converter->toString(arguments[0]);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
return NULL;
}
Try {
contactId = converter->toString(arguments[1]);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
return NULL;
}
Try {
jsobject = createJSObject(gContext, contactRef);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
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 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");
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactWebSite.h"
+#include <Logger.h>
#define CONTACT_CLASS_NAME "ContactWebSite"
JSContactWebSitePriv *priv = new JSContactWebSitePriv(context, contactWebSite);
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");
JSContactWebSitePriv *priv = static_cast<JSContactWebSitePriv*>(JSObjectGetPrivate(constructor));
if (!priv) {
Try {
jsobject = createJSObject(gContext, contactWebSite);
} Catch(Exception) {
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Wrong arguments");
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 set incorrect value");
+ LoggerW("trying to set incorrect value");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return true;
}
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");
}
return true;
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSContactWebSiteArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
* @brief Implementation of the JSPerson 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 "Person"
JSPersonPriv *priv = new JSPersonPriv(context, person);
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
return jsObjectRef;
}
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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
PersonPtr person(NULL);
}
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");
}
}
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 'PersonId'");
}
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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
PersonPtr person(NULL);
}
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");
}
}
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 'ContactId'");
}
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");
}
}
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");
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSPersonArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "ContactConverter.h"
#include "JSStringArray.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return JSValueMakeUndefined(context);
}
*/
#include "Person.h"
-
-#include <dpl/log/log.h>
#include <dpl/exception.h>
#include <Commons/Exception.h>
#include <Commons/Regex.h>
#include "ContactUtility.h"
#include "ContactsSvcObjectConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
Person::Person()
: IPerson()
{
- LogDebug("entered");
+ LoggerD("entered");
}
Person::Person(contacts_record_h record)
: IPerson()
{
- LogDebug("entered");
+ LoggerD("entered");
}
Person::~Person()
void Person::OnRequestReceived(const EventPersonLinkPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
contacts_record_h contacts_record = NULL;
contacts_record_destroy(contacts_record, true);
contacts_record = NULL;
- LogDebug("Linking person : " << personId);
+ LoggerD("Linking person : " << personId);
errorCode = contacts_person_link_person(selfPersonId, personId);
if(errorCode == CONTACTS_ERROR_INVALID_PARAMETER)
}
Catch (InvalidArgumentException)
{
- LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
}
Catch (NotFoundException)
{
- LogError("Person doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Person doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
}
Catch (PlatformException) {
- LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception) {
- LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
void Person::OnRequestReceived(const EventPersonUnlinkPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
int errorCode = 0;
int selfPersonId;
ThrowMsg(OutOfRangeException, "Contact (id:" << contactId << ") is not a member of person");
}
- LogDebug("Unlinking contact : " << contactId);
+ LoggerD("Unlinking contact : " << contactId);
int newPersonId = 0;
int errorCode = contacts_person_unlink_contact(selfPersonId, contactId, &newPersonId);
ThrowMsg(NotFoundException, "Error during executing contacts_person_unlink_contact()");
else if (errorCode != CONTACTS_ERROR_NONE)
ThrowMsg(PlatformException, "Error during executing contacts_person_unlink_contact()");
- LogDebug("newPersonId : " << newPersonId);
+ LoggerD("newPersonId : " << newPersonId);
errorCode = contacts_db_get_record(_contacts_person._uri, newPersonId, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE)
}
Catch (InvalidArgumentException)
{
- LogError("Invalid person id : " << _rethrown_exception.GetMessage());
+ LoggerE("Invalid person id : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
return;
}
Catch (NotFoundException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
return;
}
Catch (OutOfRangeException)
{
- LogError("Contact doesn't exist : " << _rethrown_exception.GetMessage());
+ LoggerE("Contact doesn't exist : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::OutOfRangeException);
return;
}
Catch (PlatformException) {
- LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
}
Catch (Exception) {
- LogError("Error during linking person : " << _rethrown_exception.GetMessage());
+ LoggerE("Error during linking person : " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
return;
#include "Person.h"
#include "ContactUtility.h"
#include "ContactsSvcObjectConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
errorCode = contacts_list_get_current_record_p(person_list, &contacts_record);
if(errorCode != CONTACTS_ERROR_NONE || contacts_record == NULL)
{
- LogWarning("Fail to get group record (ret:" << errorCode << ")");
+ LoggerW("Fail to get group record (ret:" << errorCode << ")");
continue;
}
* @brief
*/
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <TimeTracer.h>
#include "JSContactEmailAddress.h"
#include "ContactAsyncCallbackManager.h"
#include "ContactListenerManager.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Contact {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\contact] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\contact] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try
{
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\contact] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\contact] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Contact");
TIME_TRACER_RELEASE();
Try
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
DeviceAPI::Contact::ContactAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::Contact::ContactListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "AudioLyrics.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
// limitations under the License.
//
-
#include "AudioLyricsUtil.h"
-#include <dpl/log/log.h>
#include <dpl/singleton_impl.h>
#include <metadata_extractor.h>
+#include <Logger.h>
using namespace DPL;
metadata_extractor_h m_extractor = NULL;
MediaLyricsUtil::MediaLyricsUtil()
{
- LogDebug("entered ");
+ LoggerD("entered ");
if ( METADATA_EXTRACTOR_ERROR_NONE != metadata_extractor_create(&m_extractor))
{
- LogDebug("MetaData Extractor create Fail...");
+ LoggerD("MetaData Extractor create Fail...");
}
}
MediaLyricsUtil::~MediaLyricsUtil()
{
- LogDebug("entered ");
+ LoggerD("entered ");
if ( m_extractor && METADATA_EXTRACTOR_ERROR_NONE != metadata_extractor_destroy(m_extractor))
{
- LogDebug("Metadata extractor destory Fail...");
+ LoggerD("Metadata extractor destory Fail...");
}
}
if (m_extractor)
{
- LogDebug("Valide Extractor");
+ LoggerD("Valide Extractor");
//setpath
- LogDebug("set Path : " << filepath);
+ LoggerD("set Path : " << filepath);
if ( METADATA_EXTRACTOR_ERROR_NONE == metadata_extractor_set_path(m_extractor, filepath.c_str()) )
{
if ( METADATA_EXTRACTOR_ERROR_NONE == metadata_extractor_get_metadata(m_extractor, attr, &strSyncTextNum)
&& strSyncTextNum )
{
- LogDebug("SYNCHRONIZED");
+ LoggerD("SYNCHRONIZED");
int nSyncTextNum = 0;
istringstream(strSyncTextNum) >> nSyncTextNum;
- LogDebug("nSyncTextNum : " << nSyncTextNum);
+ LoggerD("nSyncTextNum : " << nSyncTextNum);
free(strSyncTextNum);
strSyncTextNum = NULL;
{
lyricsPtr->addMediaLyricsTimeStamp(time_info);
lyricsPtr->addMediaLyricsText(lyrics);
- LogDebug( "timestamp " << time_info << "lyrics : " << lyrics);
+ LoggerD( "timestamp " << time_info << "lyrics : " << lyrics);
}
}
}
else
{
- LogDebug("sync Lyrics Error. text num is 0");
+ LoggerD("sync Lyrics Error. text num is 0");
char* unSyncText = NULL;
attr = METADATA_UNSYNCLYRICS;
if (unSyncText)
{
MediacontentLyricsPtr lyricsPtr(new MediacontentLyrics());
- LogDebug("UNSYNCHRONIZED: " << unSyncText);
+ LoggerD("UNSYNCHRONIZED: " << unSyncText);
lyricsPtr->setMediaLyricsType("UNSYNCHRONIZED");
lyricsPtr->addMediaLyricsTimeStamp(0);
lyricsPtr->addMediaLyricsText(unSyncText);
}
else
{
- LogDebug("extractor Error!!!");
+ LoggerD("extractor Error!!!");
}
}
}
else
{
- LogDebug(" extractor is invaild ");
+ LoggerD(" extractor is invaild ");
}
return result;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ContentAudio.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include "ContentController.h"
#include "ContentConverter.h"
#include "ContentAsyncCallbackManager.h"
-
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
EventUpdateMediaItemsAnswerReceiver(ThreadEnum::NULL_THREAD),
EventFindFolderAnswerReceiver(ThreadEnum::NULL_THREAD)
{
- LogDebug("create a MediacontentManagerController");
+ LoggerD("create a MediacontentManagerController");
}
MediacontentManagerController::~MediacontentManagerController()
{
- LogDebug("<<<");
- LogDebug(">>>");
+ LoggerD("<<<");
+ LoggerD(">>>");
}
void MediacontentManagerController::OnAnswerReceived(const IEventUpdateMediaItemsPtr &event)
{
- LogDebug("MediacontentManagerController::IEventUpdateMediaItemsPtr:entered");
+ LoggerD("MediacontentManagerController::IEventUpdateMediaItemsPtr:entered");
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if(!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
Try
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
}
}
void MediacontentManagerController::OnAnswerReceived(const IEventBrowseFolderPtr &event)
{
- LogDebug("MediacontentManagerController::OnAnswerReceived:entered");
+ LoggerD("MediacontentManagerController::OnAnswerReceived:entered");
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
Try
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
}
}
void MediacontentManagerController::OnAnswerReceived(const IEventFindFolderPtr &event)
{
- LogDebug("MediacontentManagerController::OnAnswerReceived:entered");
+ LoggerD("MediacontentManagerController::OnAnswerReceived:entered");
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
Try
}
Catch(Exception)
{
- LogError("error during processing answer");
+ LoggerE("error during processing answer");
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include "JSAudio.h"
#include "JSFolder.h"
#include "JSAudioLyrics.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
MediaConverter::MediaConverter(JSContextRef context) : Converter(context)
{
- LogDebug("entered");
+ LoggerD("entered");
}
JSValueRef MediaConverter::toFunctionOrNull(const JSValueRef& arg)
MediacontentMediaListPtr MediaConverter::toVectorOfMediaItem(JSValueRef events)
{
- LogDebug("entered");
+ LoggerD("entered");
MediacontentMediaListPtr result(new MediacontentMediaList());
std::vector<MediacontentMediaPtr> resultVector;
JSObjectRef objArg = toJSObjectRef(events);
- LogDebug("array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
JSObjectRef arg = JSValueToObject(m_context, element, NULL);
*/
#include "ContentFilterConverter.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
FolderContentFilterConverter::~FolderContentFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MediaContentFilterConverter::MediaContentFilterConverter(JSContextRef context) :
MediaContentFilterConverter::~MediaContentFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
} // Content
// limitations under the License.
//
-
#include "ContentFilterValidator.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
if(value == QUERY_FOLDER)
{
- LogDebug("create validator of folder");
+ LoggerD("create validator of folder");
theValidatorInstance = FilterValidatorPtr(new FilterValidator(folderProperties));
}
else if(value == QUERY_MEDIA)
{
- LogDebug("create validator of media item");
+ LoggerD("create validator of media item");
theValidatorInstance = FilterValidatorPtr(new FilterValidator(mediaProperties));
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ContentFolder.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
}
else
{
- LogDebug("Attribute(" << attrName << ") There is no data.");
+ LoggerD("Attribute(" << attrName << ") There is no data.");
}
return value;
}
void MediacontentFolder::display() const
{
- LogDebug("m_folderUUID: " << m_folderUUID);
- LogDebug("m_folderName: " << m_folderName);
- LogDebug("m_folderPath: " << m_folderPath);
- LogDebug("m_storageType: " << m_storageType);
+ LoggerD("m_folderUUID: " << m_folderUUID);
+ LoggerD("m_folderName: " << m_folderName);
+ LoggerD("m_folderPath: " << m_folderPath);
+ LoggerD("m_storageType: " << m_storageType);
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
-
#include "ContentImage.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
MediacontentImage::MediacontentImage()
{
- LogDebug("enter");
+ LoggerD("enter");
m_editableAttrList.push_back("geolocation");
m_editableAttrList.push_back("orientation");
MediacontentImage::~MediacontentImage()
{
- LogDebug("enter");
+ LoggerD("enter");
}
double MediacontentImage::getImageLatitude() const
void MediacontentImage::display()
{
MediacontentMedia::display();
- LogDebug("m_imageWidth : " << m_imageWidth);
- LogDebug("m_imageHeight : " << m_imageHeight);
- LogDebug("m_imageOrientation : " << m_imageOrientation);
- LogDebug("m_imageLongitude : " << m_imageLongitude);
- LogDebug("m_imageLatitude : " << m_imageLatitude);
+ LoggerD("m_imageWidth : " << m_imageWidth);
+ LoggerD("m_imageHeight : " << m_imageHeight);
+ LoggerD("m_imageOrientation : " << m_imageOrientation);
+ LoggerD("m_imageLongitude : " << m_imageLongitude);
+ LoggerD("m_imageLatitude : " << m_imageLatitude);
}
//
#include <pthread.h>
-
-#include <dlog.h>
-
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Validator.h>
#include <JSWebAPIError.h>
#include <JSUtil.h>
#include "ContentListener.h"
#include "ContentConverter.h"
-
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_DEVICEAPI"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
void ContentListener::oncontentadded(MediacontentMediaPtr content)
{
- LogInfo("ContentListener::oncontentadded is entered");
+ LoggerI("ContentListener::oncontentadded is entered");
JSContextRef context = m_callback->getContext();
MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
void ContentListener::oncontentupdated(MediacontentMediaPtr content)
{
- LogInfo("ContentListener::oncontentupdated is entered");
+ LoggerI("ContentListener::oncontentupdated is entered");
JSContextRef context = m_callback->getContext();
MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
void ContentListener::oncontentremoved(std::string id)
{
- LogInfo("ContentListener::oncontentremoved is entered");
+ LoggerI("ContentListener::oncontentremoved is entered");
JSContextRef context = m_callback->getContext();
MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
// limitations under the License.
//
-
#include <vector>
#include <string>
#include <algorithm>
-#include <dpl/log/log.h>
#include <media_content.h>
#include <Commons/Regex.h>
#include <Commons/StringUtils.h>
#include "ContentManager.h"
#include "ContentFilterValidator.h"
#include "ContentUtility.h"
-
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
MediacontentManager::MediacontentManager()
{
- LogDebug("entered");
+ LoggerD("entered");
//protect for pararel execution
DPL::Mutex::ScopedLock mx(&m_constructorMutex);
//when it is first instance then connect to media content service.
if( MEDIA_CONTENT_ERROR_NONE != media_content_connect())
{
- LogDebug("Media Content Service Connect Fail...");
+ LoggerD("Media Content Service Connect Fail...");
return;
}
}
MediacontentManager::~MediacontentManager()
{
- LogDebug("entered : " << m_instanceCount);
+ LoggerD("entered : " << m_instanceCount);
DPL::Mutex::ScopedLock mx(&m_constructorMutex);
//decrease counter of instances
m_instanceCount--;
if (m_instanceCount == 0)
{
- LogDebug("instance Count is zero ");
+ LoggerD("instance Count is zero ");
//when it is last instance then clse connection to database
if ( MEDIA_CONTENT_ERROR_NONE != media_content_disconnect())
{
- LogDebug("Media Content Service Disconnect Fail...");
+ LoggerD("Media Content Service Disconnect Fail...");
}
}
}
/*
void MediacontentManager::OnRequestReceived(const IEventGetMediacontentPtr &event)
{
- LogDebug( "OnRequestReceived::entered");
+ LoggerD( "OnRequestReceived::entered");
//IMediacontentPtr newMediacontent(new Mediacontent());
//IMediacontentPtr newMediacontent = MediacontentFactory::getInstance().createMediacontentObject();
Try
{
- LogDebug( "get Mediacontent \n");
+ LoggerD( "get Mediacontent \n");
// event->setMediacontent(m_mediaContent);
event->setResult(true);
}
}
else
{
- LogDebug("wrong value.");
+ LoggerD("wrong value.");
ret = MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE;
}
{
if ( tmpStr )
{
- LogDebug("Folder UUID : " << tmpStr);
+ LoggerD("Folder UUID : " << tmpStr);
newFolder->setFolderUUID(tmpStr);
free(tmpStr);
tmpStr = NULL;
{
if ( tmpStr )
{
- LogDebug("Folder path : " << tmpStr);
+ LoggerD("Folder path : " << tmpStr);
newFolder->setFolderPath(ContentUtility::convertPathToUri(tmpStr));
free(tmpStr);
tmpStr = NULL;
{
if ( tmpStr )
{
- LogDebug("Folder name : " << tmpStr);
+ LoggerD("Folder name : " << tmpStr);
newFolder->setFolderName(tmpStr);
free(tmpStr);
tmpStr = NULL;
if (MEDIA_CONTENT_ERROR_NONE == media_folder_get_modified_time(media_folder, &date))
{
- LogDebug("get Modified Time ");
+ LoggerD("get Modified Time ");
newFolder->setFolderModifiedDate(toDateTm(date));
}
if (MEDIA_CONTENT_ERROR_NONE == media_folder_get_storage_type(media_folder, &storageType))
{
- LogDebug("storage Type=" << storageType);
+ LoggerD("storage Type=" << storageType);
string type;
if(storageType == MEDIA_CONTENT_STORAGE_INTERNAL )
{
unsigned long long tmpLongLong = 0;
bool tmpBool= false;
- LogDebug("enter Common Data type : " << newMedia->getMediaType());
+ LoggerD("enter Common Data type : " << newMedia->getMediaType());
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_media_id(info, &tmpStr) )
{
if (tmpStr)
{
newMedia->setMediaUUID(tmpStr);
- LogDebug("UUID : " << tmpStr);
+ LoggerD("UUID : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newMedia->setMimeType(tmpStr);
- LogDebug("MineType : " << tmpStr);
+ LoggerD("MineType : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newMedia->setDisplayName(tmpStr);
- LogDebug("Display Name : " << tmpStr);
+ LoggerD("Display Name : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newMedia->setFilePath(ContentUtility::convertPathToUri(tmpStr));
- LogDebug("Path : " << newMedia->getFilePath());
+ LoggerD("Path : " << newMedia->getFilePath());
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newMedia->setThumbnailPath(ContentUtility::convertPathToUri(tmpStr));
- LogDebug("Thumnail Path : " << newMedia->getThumbnailPath());
+ LoggerD("Thumnail Path : " << newMedia->getThumbnailPath());
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newMedia->setDescription(tmpStr);
- LogDebug("Description : " << tmpStr);
+ LoggerD("Description : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_favorite (info, &tmpBool) )
{
newMedia->setFavorite(tmpBool);
- LogDebug("favorite " << tmpBool);
+ LoggerD("favorite " << tmpBool);
}
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_rating (info, &tmpInt) )
{
newMedia->setRating(tmpInt);
- LogDebug("rating " << tmpInt);
+ LoggerD("rating " << tmpInt);
}
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_size(info, &tmpLongLong) )
{
newMedia->setSize(tmpLongLong);
- LogDebug("Size : " << tmpLongLong);
+ LoggerD("Size : " << tmpLongLong);
}
}
LogError( "Couldn't convert supplied date.");
}
- LogDebug("image_meta_get_date_taken : " << tmpStr); //time??
+ LoggerD("image_meta_get_date_taken : " << tmpStr); //time??
newImage->setReleasedDate(result);
free(tmpStr);
tmpStr = NULL;
if( tmpStr )
{
newImage->setTitle(tmpStr);
- LogDebug(" Image Title: " << tmpStr);
+ LoggerD(" Image Title: " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if ( MEDIA_CONTENT_ERROR_NONE == image_meta_get_width(img, &tmpInt) )
{
newImage->setImageWidth(tmpInt);
- LogDebug("Image Width " << tmpInt);
+ LoggerD("Image Width " << tmpInt);
}
if ( MEDIA_CONTENT_ERROR_NONE == image_meta_get_height(img, &tmpInt) )
{
newImage->setImageHeight(tmpInt);
- LogDebug("Image Height " << tmpInt);
+ LoggerD("Image Height " << tmpInt);
}
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_latitude(info, &tmpDouble) )
{
newImage->setImageLatitude(tmpDouble);
- LogDebug("Image Latitude " << tmpDouble);
+ LoggerD("Image Latitude " << tmpDouble);
}
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_longitude(info, &tmpDouble) )
{
newImage->setImageLongitude(tmpDouble);
- LogDebug("Image Longitude " << tmpDouble);
+ LoggerD("Image Longitude " << tmpDouble);
}
media_content_orientation_e orientation;
}
newImage->setImageOrientation(orientationStr);
- LogDebug(" image Orientation. " << orientationStr);
+ LoggerD(" image Orientation. " << orientationStr);
}
if ( METADATA_EXTRACTOR_ERROR_NONE != image_meta_destroy(img))
{
- LogDebug(" image_meta_destroy is fail... ");
+ LoggerD(" image_meta_destroy is fail... ");
}
}
else {
- LogDebug("fetch Image Info failed..");
+ LoggerD("fetch Image Info failed..");
}
}
else
{
- LogDebug("media info is NULL");
+ LoggerD("media info is NULL");
}
}
}
newVideo->setReleasedDate(result);
- LogDebug("audio_meta_get_recorded_date : " << tmpStr);
+ LoggerD("audio_meta_get_recorded_date : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if( tmpStr )
{
newVideo->setVideoAlbum(tmpStr);
- LogDebug(" Video Album. " << tmpStr);
+ LoggerD(" Video Album. " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if( tmpStr )
{
newVideo->setTitle(tmpStr);
- LogDebug(" Video Title. " << tmpStr);
+ LoggerD(" Video Title. " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
for( unsigned int i=0; i < artists.size(); i++)
{
string artist = artists.at(i);
- LogDebug("Audio artist: " << artist);
+ LoggerD("Audio artist: " << artist);
newVideo->appendVideoArtist(artist);
}
if ( METADATA_EXTRACTOR_ERROR_NONE != video_meta_destroy(video))
{
- LogDebug(" video_meta_destroy is fail... ");
+ LoggerD(" video_meta_destroy is fail... ");
}
}
else
{
- LogDebug("fetch Video info fail...");
+ LoggerD("fetch Video info fail...");
}
}
else
{
- LogDebug("media info is NULL");
+ LoggerD("media info is NULL");
}
}
}
newAudio->setReleasedDate(result);
- LogDebug("audio_meta_get_recorded_date : " << tmpStr);
+ LoggerD("audio_meta_get_recorded_date : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newAudio->setTitle(tmpStr);
- LogDebug("Audio Title : " << tmpStr);
+ LoggerD("Audio Title : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
if (tmpStr)
{
newAudio->setAudioAlbum(tmpStr);
- LogDebug("Audio Album : " << tmpStr);
+ LoggerD("Audio Album : " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
for( unsigned int i=0; i < artists.size(); i++)
{
string artist = artists.at(i);
- LogDebug("Audio artist: " << artist);
+ LoggerD("Audio artist: " << artist);
newAudio->appendAudioArtist(artist);
}
for( unsigned int i=0; i < composers.size(); i++)
{
string composer = composers.at(i);
- LogDebug("Audio Composer : " << composer);
+ LoggerD("Audio Composer : " << composer);
newAudio->appendAudioComposer(composer);
}
if ( MEDIA_CONTENT_ERROR_NONE == audio_meta_get_duration(audio, &tmpInt) )
{
newAudio->setAudioDuration(tmpInt);
- LogDebug("Audio Duration : " << tmpInt);
+ LoggerD("Audio Duration : " << tmpInt);
}
if ( MEDIA_CONTENT_ERROR_NONE == audio_meta_get_copyright(audio, &tmpStr) )
if (tmpStr)
{
newAudio->setAudioCopyright(tmpStr);
- LogDebug("Audio CopyRight: " << tmpStr);
+ LoggerD("Audio CopyRight: " << tmpStr);
free(tmpStr);
tmpStr = NULL;
}
int trackNum = 0;
if (tmpStr)
{
- LogDebug("trackNum: " << tmpStr);
+ LoggerD("trackNum: " << tmpStr);
try {
istringstream(tmpStr) >> trackNum;
} catch (...) {
- LogDebug("Track Number type is wrong. (track number:" << tmpStr << ")");
+ LoggerD("Track Number type is wrong. (track number:" << tmpStr << ")");
trackNum = 0;
}
newAudio->setAudioTrackNum(trackNum);
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_size(info, &tmpLongLong) )
{
newAudio->setAudioSize(tmpLongLong);
- LogDebug("Audio Size: " << tmpLongLong);
+ LoggerD("Audio Size: " << tmpLongLong);
}
if ( MEDIA_CONTENT_ERROR_NONE == audio_meta_get_bit_rate(audio, &tmpInt) )
{
newAudio->setAudioBitrate(tmpInt);
- LogDebug("Audio Bitrate: " << tmpInt);
+ LoggerD("Audio Bitrate: " << tmpInt);
}
if ( MEDIA_CONTENT_ERROR_NONE == audio_meta_get_genre(audio, &tmpStr) )
for( unsigned int i=0; i < genres.size(); i++)
{
string genre = genres.at(i);
- LogDebug("Audio Genre: " << genre);
+ LoggerD("Audio Genre: " << genre);
newAudio->appendAudioGenre(genre);
}
if ( METADATA_EXTRACTOR_ERROR_NONE != audio_meta_destroy(audio))
{
- LogDebug(" audio_meta_destroy is fail... ");
+ LoggerD(" audio_meta_destroy is fail... ");
}
}
else
{
- LogDebug("fetch Music Info fail...");
+ LoggerD("fetch Music Info fail...");
}
}
else
{
- LogDebug("media info is NULL");
+ LoggerD("media info is NULL");
}
}
//Callback.
bool MediacontentManager::mediaFolderCallback(media_folder_h folder, void *user_data)
{
- LogDebug("enter");
+ LoggerD("enter");
if (user_data != NULL){
IEventFindFolder* event = (IEventFindFolder*)user_data;
- LogDebug("user data is valide");
+ LoggerD("user data is valide");
if ( folder )
{
- LogDebug("folder is valide");
+ LoggerD("folder is valide");
MediacontentFolderPtr newFolder(new MediacontentFolder());
convertToPlatformFolder(folder, newFolder);
- LogDebug("folder type" << newFolder->getFolderStorageType());
+ LoggerD("folder type" << newFolder->getFolderStorageType());
event->addFolder(newFolder);
}
}
else
{
- LogDebug("user data is NULL");
+ LoggerD("user data is NULL");
}
return true;
}
else
{
- LogDebug("event is NULL");
+ LoggerD("event is NULL");
}
return true;
void MediacontentManager::OnRequestReceived(const IEventFindFolderPtr &eFolder)
{
- LogDebug("entered");
+ LoggerD("entered");
if ( MEDIA_CONTENT_ERROR_NONE !=
media_folder_foreach_folder_from_db (NULL, mediaFolderCallback, eFolder.Get()))
{
eFolder->setResult(true);
}
- LogDebug("end");
+ LoggerD("end");
}
void MediacontentManager::OnRequestReceived(const IEventBrowseFolderPtr &eBrowse)
{
- LogDebug("OnRequestReceived::IEventBrowseFolderPtr entered");
+ LoggerD("OnRequestReceived::IEventBrowseFolderPtr entered");
MediaSearchVisitorPtr visitor(new MediaSearchVisitor());
visitor->setQueryType(MediaSearchVisitor::QUERY_MEDIA);
jsFilter->travel(IVisitor);
condition = visitor->getResult();
- LogDebug("execute condition [" << condition << "]");
+ LoggerD("execute condition [" << condition << "]");
media_filter_set_condition(filter, condition.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT ); //set condition
}
{
string attriName = attr->getAttributeName();
attriName = visitor->getPlatformAttr(attriName);
- LogDebug("Attribute Name [" << attriName << "]");
+ LoggerD("Attribute Name [" << attriName << "]");
if (attriName.compare("") != 0)
{
if ( MEDIA_CONTENT_ERROR_NONE !=
media_filter_set_order(filter, order, attriName.c_str(), MEDIA_CONTENT_COLLATE_DEFAULT )) //set order
{
- LogDebug("media_filter_set_order fail...");
+ LoggerD("media_filter_set_order fail...");
}
}
}
if (eBrowse->getLimitIsSet() ||eBrowse->getOffsetIsSet() )
{
- LogDebug("limit or offset");
+ LoggerD("limit or offset");
int count = -1;
int offset = 0;
if ( eBrowse->getLimitIsSet() )
{
count = eBrowse->getLimit();
- LogDebug("limit is " << count);
+ LoggerD("limit is " << count);
}
if ( eBrowse->getOffsetIsSet() )
{
offset = eBrowse->getOffset();
- LogDebug("offset is " << offset);
+ LoggerD("offset is " << offset);
}
if ( MEDIA_CONTENT_ERROR_NONE != media_filter_set_offset(filter, offset, count))
{
- LogDebug("set limit or offset fail...");
+ LoggerD("set limit or offset fail...");
}
}
if ( eBrowse->getFolderIdIsSet())
{
string folderID = eBrowse->getFolderID();
- LogDebug("FolderID :" << folderID);
+ LoggerD("FolderID :" << folderID);
if ( MEDIA_CONTENT_ERROR_NONE !=
media_folder_foreach_media_from_db (folderID.c_str(), filter, mediaItemCallback, eBrowse.Get()))
string type = mediaPtr->getMediaType(); //media type.
string mediaId = mediaPtr->getMediaUUID();
- LogDebug("MediaId : " << mediaId);
+ LoggerD("MediaId : " << mediaId);
media_info_h media = NULL;
bool ret = true;
if ( MEDIA_CONTENT_ERROR_NONE
!= media_info_set_rating(media, mediaPtr->getRating()))
{
- LogDebug("Error: set rating");
+ LoggerD("Error: set rating");
}
}
if ( mediaPtr->isChangedDescription() )
if ( MEDIA_CONTENT_ERROR_NONE
!= media_info_set_description (media, mediaPtr->getDescription().c_str()))
{
- LogDebug("Error: set description");
+ LoggerD("Error: set description");
}
}
if( mediaPtr->isChangedDisplayName())
if ( MEDIA_CONTENT_ERROR_NONE
!= media_info_set_display_name (media, mediaPtr->getDisplayName().c_str()))
{
- LogDebug("Error: set displayname");
+ LoggerD("Error: set displayname");
}
}
if ( MEDIA_CONTENT_ERROR_NONE !=
image_meta_set_orientation (img, convertToOrientation(imagePtr->getImageOrientation())))
{
- LogDebug("Error: set orientation");
+ LoggerD("Error: set orientation");
ret = false;
}
}
media_info_set_latitude(media, imagePtr->getImageLatitude())
)
{
- LogDebug("Error: set Latitude");
+ LoggerD("Error: set Latitude");
ret = false;
}
media_info_set_longitude(media, imagePtr->getImageLongitude())
)
{
- LogDebug("Error: set Longitude");
+ LoggerD("Error: set Longitude");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE != image_meta_update_to_db (img) )
{
- LogDebug("Error: update db");
+ LoggerD("Error: update db");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE != image_meta_destroy(img))
{
- LogDebug("Error: destroy media info");
+ LoggerD("Error: destroy media info");
ret = false;
}
}
else
{
- LogDebug("Error: get Image from DB");
+ LoggerD("Error: get Image from DB");
ret = false;
}
}
if ( MEDIA_CONTENT_ERROR_NONE !=
video_meta_set_played_count (video, videoPtr->getVideoPlayCount()))
{
- LogDebug("Error: set play count");
+ LoggerD("Error: set play count");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE !=
video_meta_set_played_position (video, videoPtr->getVideoPlayedTime()))
{
- LogDebug("Error: set played time");
+ LoggerD("Error: set played time");
ret = false;
}
}
if (videoPtr->isChangedAlbum())
{
- LogDebug("Not support - Album API");
+ LoggerD("Not support - Album API");
ret = false;
}
if (videoPtr->isChangedArtists())
{
- LogDebug("Not support - Artist API");
+ LoggerD("Not support - Artist API");
ret = false;
}
#endif
media_info_set_latitude(media, videoPtr->getVideoLatitude())
)
{
- LogDebug("Error: set Latitude");
+ LoggerD("Error: set Latitude");
ret = false;
}
media_info_set_longitude(media, videoPtr->getVideoLongitude())
)
{
- LogDebug("Error: set Latitude");
+ LoggerD("Error: set Latitude");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE != video_meta_update_to_db (video) )
{
- LogDebug("Error: update db");
+ LoggerD("Error: update db");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE != video_meta_destroy(video))
{
- LogDebug("Error: destroy video meta");
+ LoggerD("Error: destroy video meta");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE !=
audio_meta_set_played_count (audio, audioPtr->getAudioPlayCount()))
{
- LogDebug("Error: set play count");
+ LoggerD("Error: set play count");
ret = false;
}
}
if ( MEDIA_CONTENT_ERROR_NONE !=
audio_meta_set_played_position (audio, audioPtr->getAudioPlayedTime()))
{
- LogDebug("Error: set played time");
+ LoggerD("Error: set played time");
ret = false;
}
}
if (audioPtr->isChangedAudioArtist())
{
- LogDebug("Not Support API");
+ LoggerD("Not Support API");
ret = false;
}
if (audioPtr->isChangedAudioAlbum())
{
- LogDebug("Not Support API");
+ LoggerD("Not Support API");
ret = false;
}
if (audioPtr->isChangedAudioGenre())
{
- LogDebug("Not Support API");
+ LoggerD("Not Support API");
ret = false;
}
if (audioPtr->isChangedAudioComposer())
{
- LogDebug("Not Support API");
+ LoggerD("Not Support API");
ret = false;
}
if (audioPtr->isChangedAudioTrackNumber())
{
- LogDebug("Not Support API");
+ LoggerD("Not Support API");
ret = false;
}
#endif
if ( MEDIA_CONTENT_ERROR_NONE != audio_meta_update_to_db (audio) )
{
- LogDebug("Error: update db");
+ LoggerD("Error: update db");
ret = false;
}
if ( MEDIA_CONTENT_ERROR_NONE != audio_meta_destroy(audio))
{
- LogDebug("Error: destroy audio meta");
+ LoggerD("Error: destroy audio meta");
ret = false;
}
audio = NULL;
//update media info
if ( MEDIA_CONTENT_ERROR_NONE != media_info_update_to_db(media))
{
- LogDebug("Error: update to DB");
+ LoggerD("Error: update to DB");
ret = false;
}
}
{
if ( MEDIA_CONTENT_ERROR_NONE !=media_info_destroy(media))
{
- LogDebug("Error: destroy media info");
+ LoggerD("Error: destroy media info");
ret = false;
}
}
void MediacontentManager::OnRequestReceived(const IEventUpdateMediaPtr &eMedia)
{
- LogDebug("OnRequestReceived::IEventUpdateMediaPtr entered");
+ LoggerD("OnRequestReceived::IEventUpdateMediaPtr entered");
try
{
MediacontentMediaPtr mediaPtr = eMedia->getMediaItem();
if(updateMediaToDB(mediaPtr))
{
eMedia->setResult(true);
- LogDebug("update success");
+ LoggerD("update success");
}
else
{
void MediacontentManager::OnRequestReceived(const IEventUpdateMediaItemsPtr &eItems)
{
- LogDebug("OnRequestReceived::IEventUpdateMediaItemsPtr entered");
+ LoggerD("OnRequestReceived::IEventUpdateMediaItemsPtr entered");
try
{
MediacontentMediaListPtr mediaListPtr = eItems->getMediaItems();
if (mediaListPtr->empty())
{
- LogDebug("Item vector is empty");
+ LoggerD("Item vector is empty");
}
else
{
if(updateMediaToDB(mediaPtr))
{
eItems->setResult(true);
- LogDebug("update success");
+ LoggerD("update success");
}
else
{
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ContentMedia.h"
#include <aul/aul.h>
-
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
string MediacontentMedia::getMimeType()
{
- LogDebug("MediacontentMedia::getMimeType");
+ LoggerD("MediacontentMedia::getMimeType");
return m_mimeType;
}
void MediacontentMedia::display() const
{
- LogDebug("m_mediaUUID : " << m_mediaUUID);
- LogDebug("m_mediaType : " << m_mediaType);
-// LogDebug("m_mimeType : " << m_mimeType);
- LogDebug("m_displayName : " << m_displayName);
- LogDebug("m_filePath : " << m_filePath);
- LogDebug("m_thumbnailPath : " << m_thumbnailPath);
- LogDebug("m_description : " << m_description);
-// LogDebug("m_createdDate : " << m_createdDate);
-// LogDebug("m_releasedDate : " << m_releasedDate);
-// LogDebug("m_modifiedDate : " << m_modifiedDate);
- LogDebug("m_favorite : " << m_favorite);
+ LoggerD("m_mediaUUID : " << m_mediaUUID);
+ LoggerD("m_mediaType : " << m_mediaType);
+// LoggerD("m_mimeType : " << m_mimeType);
+ LoggerD("m_displayName : " << m_displayName);
+ LoggerD("m_filePath : " << m_filePath);
+ LoggerD("m_thumbnailPath : " << m_thumbnailPath);
+ LoggerD("m_description : " << m_description);
+// LoggerD("m_createdDate : " << m_createdDate);
+// LoggerD("m_releasedDate : " << m_releasedDate);
+// LoggerD("m_modifiedDate : " << m_modifiedDate);
+ LoggerD("m_favorite : " << m_favorite);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include "time.h"
#include <iomanip>
#include <Commons/Exception.h>
#include "ContentSearchVisitor.h"
#include "ContentUtility.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
{
string platformAttr;
map<string, string>::iterator pos;
- LogDebug("attrName=" << attrName);
- LogDebug("queryType=" << queryType);
+ LoggerD("attrName=" << attrName);
+ LoggerD("queryType=" << queryType);
if( queryType == QUERY_FOLDER)
{
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ContentVideo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
void MediacontentVideo::display() const
{
- LogDebug("m_videoLongitude: " << m_videoLongitude;);
- LogDebug("m_videoLatitude: " << m_videoLatitude);
- LogDebug("m_videoAlbum: " << m_videoAlbum;);
- //LogDebug("m_videoArtist: " << m_videoArtist);
- //LogDebug("m_videoPlayedTime: " << m_videoPlayedTime);
- LogDebug("m_videoDuration: " << m_videoDuration);
- LogDebug("m_videoWidth: " << m_videoWidth);
- LogDebug("m_videoHeight: " << m_videoHeight);
+ LoggerD("m_videoLongitude: " << m_videoLongitude;);
+ LoggerD("m_videoLatitude: " << m_videoLatitude);
+ LoggerD("m_videoAlbum: " << m_videoAlbum;);
+ //LoggerD("m_videoArtist: " << m_videoArtist);
+ //LoggerD("m_videoPlayedTime: " << m_videoPlayedTime);
+ LoggerD("m_videoDuration: " << m_videoDuration);
+ LoggerD("m_videoWidth: " << m_videoWidth);
+ LoggerD("m_videoHeight: " << m_videoHeight);
MediacontentMedia::display();
}
// limitations under the License.
//
-
#include <Commons/StringUtils.h>
#include <Commons/ThreadPool.h>
#include "IContentManager.h"
#include "ContentAudio.h"
#include "ContentManager.h"
#include "ContentUtility.h"
-
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
void IMediacontentManager::findFolder(IEventFindFolderPtr &ptr)
{
- LogDebug("IMediacontentManager::called findFolders");
+ LoggerD("IMediacontentManager::called findFolders");
WrtDeviceApis::Commons::EventRequestReceiver<IEventFindFolder>::PostRequest(ptr);
}
void IMediacontentManager::updateMedia(IEventUpdateMediaPtr &ptr)
{
- LogDebug("IMediacontentManager::called updateMedia");
+ LoggerD("IMediacontentManager::called updateMedia");
WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMedia>::PostRequest(ptr);
}
void IMediacontentManager::browseFolder(IEventBrowseFolderPtr &ptr)
{
- LogDebug("IMediacontentManager::called IEventBrowseFolder");
+ LoggerD("IMediacontentManager::called IEventBrowseFolder");
WrtDeviceApis::Commons::EventRequestReceiver<IEventBrowseFolder>::PostRequest(ptr);
}
void IMediacontentManager::updateMediaItems(IEventUpdateMediaItemsPtr &ptr)
{
- LogDebug("IMediacontentManager::called IEventBrowseFolder");
+ LoggerD("IMediacontentManager::called IEventBrowseFolder");
WrtDeviceApis::Commons::EventRequestReceiver<IEventUpdateMediaItems>::PostRequest(ptr);
}
static gboolean _scan_file_completed_cb(void *user_data)
{
- LogDebug("called _scan_file_completed_cb:");
+ LoggerD("called _scan_file_completed_cb:");
scanCallbackData *data = static_cast<scanCallbackData*>(user_data);
static void _scan_file_thread(void *user_data, Ecore_Thread *thread){
- LogDebug("_scan_file_thread::called");
+ LoggerD("_scan_file_thread::called");
scanCallbackData *data = static_cast<scanCallbackData*>(user_data);
data->result = media_content_scan_file(data->path.c_str());
- LogDebug("native error code:" << data->result);
+ LoggerD("native error code:" << data->result);
g_idle_add(_scan_file_completed_cb, data);
}
bool IMediacontentManager::scanFile(scanCompletedCallback callback, std::string path, void* user_data)
{
- LogDebug("ContentManager::called scan");
+ LoggerD("ContentManager::called scan");
bool ret = false;
if( !path.empty() )
{
- LogDebug("ContentManager::path:" << path);
+ LoggerD("ContentManager::path:" << path);
scanCallbackData *data = new scanCallbackData();
data->path = path;
static bool mediaItemCallback(media_info_h info, void* user_data)
{
media_content_type_e type;
- LogDebug("mediaItemCallback is called");
+ LoggerD("mediaItemCallback is called");
if ( MEDIA_CONTENT_ERROR_NONE == media_info_get_media_type( info, &type) )
{
err_msg = "scanning is failed by unknown reason";
}
- LogDebug("ContentListener is called:" + err_msg );
+ LoggerD("ContentListener is called:" + err_msg );
}
bool IMediacontentManager::setListener( void* user_data)
{
- LogDebug("ContentManager::called setListener");
+ LoggerD("ContentManager::called setListener");
bool ret = false;
if(media_content_set_db_updated_cb(content_notification_cb,user_data) == MEDIA_CONTENT_ERROR_NONE)
bool IMediacontentManager::unsetListener()
{
- LogDebug("ContentManager::called unsetListener");
+ LoggerD("ContentManager::called unsetListener");
bool ret = false;
if(media_content_unset_db_updated_cb() == MEDIA_CONTENT_ERROR_NONE)
#include <media_content.h>
#include <dpl/shared_ptr.h>
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include "IEventGetDirectories.h"
#include "IEventUpdate.h"
#include "ContentMedia.h"
#include "ContentImage.h"
-
-
namespace DeviceAPI {
namespace Content {
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "ContentMedia.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
public:
IEventUpdateMedia():m_result(false), m_media(NULL)
{
- LogDebug("entered");
+ LoggerD("entered");
}
~IEventUpdateMedia(){}
void setMediaItem(MediacontentMediaPtr value)
{
- LogDebug("setMediaItem11");
+ LoggerD("setMediaItem11");
m_media = value;
}
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "ContentMedia.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
public:
IEventUpdateMediaItems():m_result(false)
{
- LogDebug("entered");
+ LoggerD("entered");
}
virtual ~IEventUpdateMediaItems(){}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "ContentConverter.h"
#include "AudioLyricsUtil.h"
#include "ContentUtility.h"
-
+#include <Logger.h>
#define TIZEN_CONTENT_AUDIO_ATTRIBUTENAME "AudioContent"
#define TIZEN_CONTENT_AUDIO_ALBUM "album"
void JSAudio::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
AudioPrivObject *priv = static_cast<AudioPrivObject*>( JSObjectGetPrivate( object ) );
if (!priv)
{
MediacontentAudioPtr privateData(new MediacontentAudio());
priv = new AudioPrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("new Private Object is created" );
+ LoggerD("new Private Object is created" );
}
else {
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
}
}
void JSAudio::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
AudioPrivObject *priv = static_cast<AudioPrivObject*>( JSObjectGetPrivate( object ) ) ;
if (priv != NULL)
{
const JSClassRef JSAudio::getClassRef()
{
- LogDebug("JSAudio::getClassRef()");
+ LoggerD("JSAudio::getClassRef()");
if (!m_jsClassRef)
{
MediacontentAudioPtr JSAudio::getAudioObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
AudioPrivObject *priv = static_cast<AudioPrivObject*>(JSObjectGetPrivate(object));
if(!priv)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyArtist::entered");
+ LoggerD("getPropertyArtist::entered");
Try
{
Converter converter(context);
}
for( unsigned int i=0; i < audio->getAudioArtist().size(); i++){
string artist = audio->getAudioArtist().at(i);
- LogDebug("artist : " << artist);
+ LoggerD("artist : " << artist);
JSValueRef val = converter.toJSValueRef(artist);
if(!JSSetArrayElement(context, jsResult, i, val)){
ThrowMsg(UnknownException, "Could not insert value into js array");
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyGenre::entered");
+ LoggerD("getPropertyGenre::entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyComposer::entered");
+ LoggerD("getPropertyComposer::entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
MediaConverterFactory::ConverterType converter = MediaConverterFactory::getConverter(context);
JSContextRef globalContext = priv->getContext();
//check lyrics state
- LogDebug("lyrics state : " << audio->getLyricsState());
+ LoggerD("lyrics state : " << audio->getLyricsState());
if ( CONTENT_LYRIC_UNKNOWN == audio->getLyricsState() ||
CONTENT_LYRIC_EXISTENT == audio->getLyricsState() )
if (mediaContent && (audio->getLyricsState() != CONTENT_LYRIC_NON_EXISTENT))
{
- LogDebug(" lyrics success ");
+ LoggerD(" lyrics success ");
JSObjectRef jsobject;
jsobject = JSMediaLyrics::createJSObject(globalContext, mediaContent);
return jsobject;
}
else
{
- LogDebug(" lyrics success ");
+ LoggerD(" lyrics success ");
audio->setAudioLyricNonExistent();
}
}
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
return DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "JSAudioLyrics.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
void JSMediaLyrics::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
LyricsPrivObject *priv = static_cast<LyricsPrivObject*>( JSObjectGetPrivate( object ) );
if (!priv)
{
MediacontentLyricsPtr privateData(new MediacontentLyrics());
priv = new LyricsPrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("private object is created");
+ LoggerD("private object is created");
}
else
{
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
}
}
void JSMediaLyrics::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
LyricsPrivObject *priv = static_cast<LyricsPrivObject*>( JSObjectGetPrivate( object ) ) ;
delete priv;
}
const JSClassRef JSMediaLyrics::getClassRef()
{
- LogDebug("JSMediaLyrics::getClassRef()");
+ LoggerD("JSMediaLyrics::getClassRef()");
if (!m_jsClassRef)
{
m_jsClassRef = JSClassCreate(&m_classInfo);
MediacontentLyricsPtr JSMediaLyrics::getLyricsObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
LyricsPrivObject *priv = static_cast<LyricsPrivObject*>(JSObjectGetPrivate(object));
if(!priv)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
LyricsPrivObject *priv = new LyricsPrivObject(context, mediaContent);
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
return jsObjectRef;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
-
-
#include "JSContent.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
void JSMedia::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
MediaPrivObject *priv = static_cast<MediaPrivObject*>( JSObjectGetPrivate( object ) );
if (!priv)
{
MediacontentMediaPtr privateData(new MediacontentMedia());
priv = new MediaPrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("new event is created" );
+ LoggerD("new event is created" );
}
else
{
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
}
}
void JSMedia::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
MediaPrivObject *priv = static_cast<MediaPrivObject*>( JSObjectGetPrivate( object ) ) ;
if (priv != NULL)
{
const JSClassRef JSMedia::getClassRef()
{
- LogDebug("JSMedia::getClassRef()");
+ LoggerD("JSMedia::getClassRef()");
if (!m_jsClassRef)
{
m_jsClassRef = JSClassCreate(&m_classInfo);
MediacontentMediaPtr JSMedia::getMediaObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
MediaPrivObject *priv = static_cast<MediaPrivObject*>(JSObjectGetPrivate(object));
if(!priv)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyDisplayName::entered");
+ LoggerD("getPropertyDisplayName::entered");
Try
{
Converter converter(context);
MediacontentMediaPtr media = getMediaObject(object);
- LogDebug("getDisplayName:"<<media->getDisplayName());
+ LoggerD("getDisplayName:"<<media->getDisplayName());
return converter.toJSValueRef(media->getDisplayName());
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyDisplayName::entered");
+ LoggerD("getPropertyDisplayName::entered");
Try
{
Converter converter(context);
MediacontentMediaPtr media = getMediaObject(object);
- LogDebug("getTitle:"<<media->getTitle());
+ LoggerD("getTitle:"<<media->getTitle());
return converter.toJSValueRef(media->getTitle());
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyDescription::entered");
+ LoggerD("getPropertyDescription::entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyType::entered");
+ LoggerD("getPropertyType::entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyType::entered");
+ LoggerD("getPropertyType::entered");
Try
{
Converter converter(context);
MediacontentMediaPtr media = getMediaObject(object);
- LogDebug("size:" << media->getSize());
+ LoggerD("size:" << media->getSize());
double var = (double)media->getSize(); //casting.
return converter.toJSValueRef(var);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
MediacontentMediaPtr objMedia = getMediaObject(object);
int rating = converter.toInt(value);
- LogDebug("Inserted value : " << rating);
+ LoggerD("Inserted value : " << rating);
if(rating < 0)
{
rating = 0;
- LogDebug("Rating value set 0 as inserted value is too small");
+ LoggerD("Rating value set 0 as inserted value is too small");
}
if ( objMedia->getRating() != rating)
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
MediacontentMediaPtr objMedia = getMediaObject(object);
string displayName = converter.toString(value);
- LogDebug("Inserted value : " << displayName);
+ LoggerD("Inserted value : " << displayName);
if ((objMedia->getDescription()).compare(displayName) != 0)
{
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
MediacontentMediaPtr objMedia = getMediaObject(object);
string description = converter.toString(value);
- LogDebug("Inserted value : " << description);
+ LoggerD("Inserted value : " << description);
if ( (objMedia->getDescription()).compare(description) != 0 )
{
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
// limitations under the License.
//
-
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Utils.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include "ContentFilterConverter.h"
#include "ContentUtility.h"
#include "JSWebAPIException.h"
-
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace DeviceAPI::Tizen;
const JSValueRef arguments[],
JSValueRef* exception )
{
- LogDebug("JSContentManagerManager::getFolders entered");
+ LoggerD("JSContentManagerManager::getFolders entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception )
{
- LogDebug("JSContentManagerManager::find entered");
+ LoggerD("JSContentManagerManager::find entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("JSContentManagerManager::updateItemsBatch entered");
+ LoggerD("JSContentManagerManager::updateItemsBatch entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("JSContentManagerManager::updateItem entered");
+ LoggerD("JSContentManagerManager::updateItem entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("JSContentManagerManager::scanFile entered");
+ LoggerD("JSContentManagerManager::scanFile entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("JSContentManagerManager::setChangeListener entered");
+ LoggerD("JSContentManagerManager::setChangeListener entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("JSContentManagerManager::unsetChangeListener entered");
+ LoggerD("JSContentManagerManager::unsetChangeListener entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MediacontentManagerPrivObject *privateObject;
privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(thisObject));
void JSMediacontentManager::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("JSContentManager initialize entered");
+ LoggerD("JSContentManager initialize entered");
MediacontentManagerPrivObject *privateObject = static_cast<MediacontentManagerPrivObject*>(JSObjectGetPrivate(object));
if (NULL == privateObject)
{
- LogDebug("Create ContenttManagerPrivObject");
+ LoggerD("Create ContenttManagerPrivObject");
IMediacontentManagerPtr contentManager = MediacontentFactory::getInstance().createMediacontentManagerObject();
privateObject = new MediacontentManagerPrivObject(context, contentManager);
if (!JSObjectSetPrivate(object, static_cast<void*>(privateObject)))
void JSMediacontentManager::finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
MediacontentManagerPrivObject* priv = static_cast<MediacontentManagerPrivObject*> (JSObjectGetPrivate(object));
if(priv != NULL)
{
- LogDebug("Deleting coordinates object");
+ LoggerD("Deleting coordinates object");
delete priv;
JSObjectSetPrivate(object, NULL);
priv = NULL;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "ContentFactory.h"
#include "ContentController.h"
#include "JSFolder.h"
-
+#include <Logger.h>
namespace DeviceAPI {
namespace Content {
void JSFolder::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
FolderPrivObject *priv = static_cast<FolderPrivObject*>( JSObjectGetPrivate( object ) );
if (!priv)
{
MediacontentFolderPtr privateData(new MediacontentFolder());
priv = new FolderPrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("new event is created" );
+ LoggerD("new event is created" );
}
else
{
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
}
}
void JSFolder::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
FolderPrivObject *priv = static_cast<FolderPrivObject*>( JSObjectGetPrivate( object ) ) ;
if (priv != NULL)
{
MediacontentFolderPtr JSFolder::getFolderObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
FolderPrivObject *priv = static_cast<FolderPrivObject*>(JSObjectGetPrivate(object));
if(!priv) {
ThrowMsg(NullPointerException, "Private object is null");
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getPropertyPath::entered");
+ LoggerD("getPropertyPath::entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSUtil.h"
#include "JSImage.h"
-
+#include <Logger.h>
#define TIZEN_CONTENT_IMAGE_ATTRIBUTENAME "ImageContent"
#define TIZEN_CONTENT_IMAGE_GEOLOCATION "geolocation"
void JSImage::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
ImagePrivObject *priv = static_cast<ImagePrivObject*>( JSObjectGetPrivate( object ) );
if (!priv) {
MediacontentImagePtr privateData(new MediacontentImage());
priv = new ImagePrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("new private object is created" );
+ LoggerD("new private object is created" );
}
else {
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
MediacontentImagePtr image = getImageObject(object);
DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
JSUtil::setProperty(context, object, TIZEN_CONTENT_IMAGE_GEOLOCATION,
void JSImage::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
ImagePrivObject *priv = static_cast<ImagePrivObject*>( JSObjectGetPrivate( object ) ) ;
if (priv != NULL)
{
const JSClassRef JSImage::getClassRef()
{
- LogDebug("JSImage::getClassRef()");
+ LoggerD("JSImage::getClassRef()");
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
MediacontentImagePtr JSImage::getImageObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
ImagePrivObject *priv = static_cast<ImagePrivObject*>(JSObjectGetPrivate(object));
if(!priv) {
ThrowMsg(NullPointerException, "Private object is null");
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
MediacontentImagePtr image = getImageObject(object);
- LogDebug("lati :" << image->getImageLatitude());
- LogDebug("longi :" << image->getImageLongitude());
+ LoggerD("lati :" << image->getImageLatitude());
+ LoggerD("longi :" << image->getImageLongitude());
DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(image->getImageLatitude(),image->getImageLongitude()));
return JSSimpleCoordinates::createJSObject(context,geoPtr);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
MediacontentImagePtr objImg = getImageObject(object);
string orientation = converter.toString(value);
- LogDebug("Inserted value : " << orientation);
+ LoggerD("Inserted value : " << orientation);
if ((objImg->getImageOrientation()).compare(orientation) !=0 )
{
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenException.h>
#include "ContentConverter.h"
#include "JSVideo.h"
#include "JSUtil.h"
+#include <Logger.h>
#define TIZEN_CONTENT_VIDEO_ATTRIBUTENAME "VideoContent"
#define TIZEN_CONTENT_VIDEO_GEOLOCATION "geolocation"
void JSVideo::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
VideoPrivObject *priv = static_cast<VideoPrivObject*>( JSObjectGetPrivate( object ) );
if (!priv)
{
MediacontentVideoPtr privateData(new MediacontentVideo());
priv = new VideoPrivObject(context, privateData);
JSObjectSetPrivate(object, static_cast<void*>(priv));
- LogDebug("new pravite object is created" );
+ LoggerD("new pravite object is created" );
}
else {
- LogDebug("private object already exists");
+ LoggerD("private object already exists");
MediacontentVideoPtr video = getVideoObject(object);
DeviceAPI::Tizen::SimpleCoordinatesPtr geoPtr(new SimpleCoordinates(video->getVideoLatitude(),video->getVideoLongitude()));
JSUtil::setProperty(context, object, TIZEN_CONTENT_VIDEO_GEOLOCATION,
void JSVideo::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
VideoPrivObject *priv = static_cast<VideoPrivObject*>( JSObjectGetPrivate( object ) ) ;
if (priv != NULL)
{
const JSClassRef JSVideo::getClassRef()
{
- LogDebug("JSVideo::getClassRef()");
+ LoggerD("JSVideo::getClassRef()");
if (!m_jsClassRef)
{
MediacontentVideoPtr JSVideo::getVideoObject(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
VideoPrivObject *priv = static_cast<VideoPrivObject*>(JSObjectGetPrivate(object));
if(!priv)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR);
}
return false;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
for( unsigned int i=0; i < video->getVideoArtist().size(); i++) {
string artist = video->getVideoArtist().at(i);
- LogDebug("artist : " << artist);
+ LoggerD("artist : " << artist);
JSValueRef val = converter.toJSValueRef(artist);
if(!JSSetArrayElement(context, jsResult, i, val)){
return jsResult;
}
Catch(Exception){
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeNull(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
return false;
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
Converter converter(context);
}
Catch(Exception)
{
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
DeviceAPI::Common::JSTizenExceptionFactory::postException(context, exception, DeviceAPI::Common::JSTizenException::TYPE_MISMATCH_ERROR);
}
return false;
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSContentManager.h"
#include "ContentAsyncCallbackManager.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis;
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\content] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\content] on_frame_load_callback (" << context << ")");
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\content] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\content] on_frame_unload_callback (" << context << ")");
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
MediaContentAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
}
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\content] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\content] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("WrtAccess intialization failed");
+ LoggerE("WrtAccess intialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\content] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\content] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Content");
TIME_TRACER_RELEASE();
Try
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
#include "DataType.h"
#include <pcrecpp.h>
#include <JSUtil.h>
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::Commons;
{
if (JSValueIsNull(m_context, arg) || JSValueIsUndefined(m_context, arg))
{
- LogDebug("null.");
+ LoggerD("null.");
return NULL;
}
else if (JSValueIsObject(m_context, arg) == false)
{
- LogDebug("undefined, not object");
+ LoggerD("undefined, not object");
ThrowMsg(ConversionException, "Not a function nor JS null.");
}
else if (Validator(m_context).isCallback(arg))
{
- LogDebug("Function OK");
+ LoggerD("Function OK");
return arg;
}
}
else if (Validator(m_context).isCallback(arg))
{
- LogDebug("Function OK");
+ LoggerD("Function OK");
return arg;
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include "RowData.h"
//
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
+#include <Logger.h>
using namespace DeviceAPI::Common;
-
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
//,
// EventGetIndexedRowAnswerReceiver(ThreadEnum::NULL_THREAD)
{
- LogDebug("entered");
+ LoggerD("entered");
}
DataControlListener::~DataControlListener()
{
- LogDebug("entered");
+ LoggerD("entered");
}
void DataControlListener::MakeErrorJSCallBack(JSCallbackManagerPtr cbm, JSContextRef globalContext,
unsigned int error, unsigned int reqid, std::string errorMsg)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSValueRef err[2];
DataControlConverter converter(globalContext);
break;
case ExceptionCodes::EventCancelledException:
- LogDebug("Enter - Event was cancled, callback will be silently discarded");
+ LoggerD("Enter - Event was cancled, callback will be silently discarded");
return;
case ExceptionCodes::UnknownException:
default:
{
JSValueRef successArray[2];
int insertRowId = event->getInsertRowId();
- LogDebug(event->getInsertRowId());
+ LoggerD(event->getInsertRowId());
successArray[0] = converter.toJSValueRef(event->getReqId());
successArray[1] = converter.toJSValueRef(insertRowId);
JSValueRef successArray[2];
successArray[0] = JSSelectObjectArrayValues::createJSObject(globalContext, path);
successArray[1] = converter.toJSValueRef(event->getReqId());
- LogDebug(event->getReqId());
+ LoggerD(event->getReqId());
callbackManager->callOnSuccess(successArray, 2);
}
else
JSValueRef successArray[2];
successArray[0] = converter.toJSValueRef(result);
successArray[1] = converter.toJSValueRef(event->getReqId());
- LogDebug(event->getReqId());
+ LoggerD(event->getReqId());
callbackManager->callOnSuccess(successArray, 2);
}
else
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setKey(const std::string &key) {m_key = key;}
void setValue(const std::string &value) { m_value = value;}
- EventAddValue() { LogDebug("entered"); }
+ EventAddValue() { LoggerD("entered"); }
~EventAddValue() { }
};
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
-
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setWhere(const std::string& where) { m_where = where; }
void setErrorMsg(const std::string& errorMsg) { m_errorMsg = errorMsg;}
- EventDelete() { LogDebug("entered"); }
+ EventDelete() { LoggerD("entered"); }
~EventDelete() { }
};
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "RowData.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
{
public:
- EventGetIndexedRow() { LogDebug("entered"); }
+ EventGetIndexedRow() { LoggerD("entered"); }
~EventGetIndexedRow() { }
void setIndex(const int& index) { m_index = index;}
int getIndex() { return m_index;}
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include <vector>
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void addResultValue(const std::string &value) { m_result.push_back(value);}
- EventGetValue() { LogDebug("entered"); }
+ EventGetValue() { LoggerD("entered"); }
~EventGetValue() { }
};
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "RowData.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setRowData(const RowDataPtr& rowData) { m_rowData = rowData;}
void setErrorMsg(const std::string &msg) { m_errorMsg = msg; }
void setRowId(const long &id) { m_insertRowId = id;}
- EventInsert() { LogDebug("entered"); m_insertRowId = -1;}
+ EventInsert() { LoggerD("entered"); m_insertRowId = -1;}
~EventInsert() { }
};
#define TIZENAPIS_API_EVENT_REMOVE_VALUE_H_
#include <Commons/IEvent.h>
-#include <dpl/shared_ptr.h>
+#include <dpl/shared_ptr.h>\r
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setValue(const std::string &value) { m_value = value;}
void setErrorMsg(const std::string &msg) { m_errorMsg = msg; }
- EventRemoveValue() { LogDebug("entered"); }
+ EventRemoveValue() { LoggerD("entered"); }
~EventRemoveValue() { }
};
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "RowData.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
std::string m_errorMsg;
public:
EventSelect() {
- LogDebug("entered");
+ LoggerD("entered");
m_reqId = 0;
m_where = "";
m_order = "";
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
#include "RowData.h"
-
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setWhere(const std::string& where) { m_where = where; }
void setErrorMsg(const std::string& errorMsg) { m_errorMsg = errorMsg;}
- EventUpdate() { LogDebug("entered"); }
+ EventUpdate() { LoggerD("entered"); }
~EventUpdate() { }
};
#include <Commons/IEvent.h>
#include <dpl/shared_ptr.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
void setOldValue(const std::string& value) { m_oldValue = value;}
void setNewValue(const std::string& value) { m_newValue = value;}
- EventUpdateValue() { LogDebug("entered"); }
+ EventUpdateValue() { LoggerD("entered"); }
~EventUpdateValue() { }
};
#include "DataControlListener.h"
#include "plugin_config.h"
+#include <ArgumentValidator.h>
+#include <JSWebAPIError.h>
+#include <JSWebAPIException.h>
+#include <JSUtil.h>
+
+
using namespace std;
using namespace DPL;
using namespace WrtDeviceApis;
void JSDataControlManager::initialize(JSContextRef context, JSObjectRef object)
{
JSDataControlManagerPriv *priv = static_cast<JSDataControlManagerPriv*>(JSObjectGetPrivate(object));
- LogDebug("JSDataControlManager::initialize");
+ LoggerD("JSDataControlManager::initialize");
if (priv != NULL)
{
- LogError("already exist");
+ LoggerE("already exist");
}
else
{
priv = new JSDataControlManagerPriv(context);
- LogDebug("OK creation");
+ LoggerD("OK creation");
if(!JSObjectSetPrivate(object, static_cast<void*>(priv)))
{
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
}
void JSDataControlManager::finalize(JSObjectRef object)
{
- LogDebug("JSDataControlManager::Finalrize");
+ LoggerD("JSDataControlManager::Finalrize");
JSDataControlManagerPriv *priv = static_cast<JSDataControlManagerPriv*>(JSObjectGetPrivate(object));
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
- JSValueRef reserveArguments[3];
+
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toString(0, false);
+ validator.toString(1, false);
+ validator.toString(2, false);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+ JSValueRef reserveArguments[3];
JSDataControlManagerPriv *priv = static_cast<JSDataControlManagerPriv*>(JSObjectGetPrivate(thisObject));
Try
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
#include <SecurityExceptions.h>
#include <Commons/Exception.h>
#include <TimeTracer.h>
+#include <ArgumentValidator.h>
+#include <JSWebAPIError.h>
+#include <JSWebAPIException.h>
+#include <JSUtil.h>
#include "DataControlFactory.h"
#include "JSMappedDataControlConsumer.h"
#include "DataControlAsyncCallbackManager.h"
{
JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(object));
if (!priv) {
- LogError("Private object is null");
+ LoggerE("Private object is null");
}
delete priv;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toString(1, false);
+ validator.toString(2, false);
+ validator.toFunction(3, true);
+ validator.toFunction(4, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
DataControlConverter converter(context);
JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toString(1, false);
+ validator.toString(2, false);
+ validator.toString(3, false);
+ validator.toFunction(4, false);
+ validator.toFunction(5, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
DataControlConverter converter(context);
JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
+
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toString(1, false);
+ validator.toFunction(2, false);
+ validator.toFunction(3, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
JSContextRef globalContext = priv->getContext();
DataControlConverter converter(globalContext);
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toString(1, false);
+ validator.toString(2, false);
+ validator.toFunction(3, false);
+ validator.toFunction(4, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
DataControlConverter converter(context);
JSMappedDataControlConsumerPriv *priv = static_cast<JSMappedDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
#include <SecurityExceptions.h>
#include <Commons/Exception.h>
#include <TimeTracer.h>
+#include <ArgumentValidator.h>
+#include <JSWebAPIError.h>
+#include <JSWebAPIException.h>
+#include <JSUtil.h>
#include "DataControlFactory.h"
#include "JSSQLDataControlConsumer.h"
#include "DataControlAsyncCallbackManager.h"
{
JSSQLDataControlConsumerPriv *priv = static_cast<JSSQLDataControlConsumerPriv*>(JSObjectGetPrivate(object));
if (!priv) {
- LogError("Private object is null");
+ LoggerE("Private object is null");
}
delete priv;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toObject(1, false);
+ validator.toFunction(2, true);
+ validator.toFunction(3, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
DataControlConverter converter(context);
JSSQLDataControlConsumerPriv *priv = static_cast<JSSQLDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toObject(1, false);
+ validator.toString(2, false);
+ validator.toFunction(3, true);
+ validator.toFunction(4, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
DataControlConverter converter(context);
JSSQLDataControlConsumerPriv *priv = static_cast<JSSQLDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toArrayObject(1, false);
+ validator.toString(2, false);
+ validator.toFunction(3, false);
+ validator.toFunction(4, true);
+ validator.toULong(5, true);
+ validator.toULong(6, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
JSSQLDataControlConsumerPriv *priv = static_cast<JSSQLDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
JSValueRef errorCallBack = NULL;
unsigned int reqId = converter.toULong(reserveArguments[0]);
- LogDebug(reqId);
+ LoggerD(reqId);
std::vector<std::string> columns = converter.toVectorOfStrings(reserveArguments[1]);
std::string where = converter.toString(reserveArguments[2]);
- LogDebug(where);
+ LoggerD(where);
successCallback = converter.toFunctionOrNull(reserveArguments[3]);
}
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
+ // argument validation with new validator
+ try
+ {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toULong(0, false);
+ validator.toString(1, false);
+ validator.toFunction(2, true);
+ validator.toFunction(3, true);
+ }
+ catch (const BasePlatformException &err)
+ {
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+ catch (...)
+ {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
DataControlConverter converter(context);
JSSQLDataControlConsumerPriv *priv = static_cast<JSSQLDataControlConsumerPriv*>(JSObjectGetPrivate(thisObject));
JSValueRef successCallback = NULL;
JSValueRef errorCallBack = NULL;
size_t index = 0;
- JSValueRef reserveArguments[5];
+ JSValueRef reserveArguments[4];
if (priv == NULL)
{
AceSecurityStatus status = DATACONTROL_CHECK_ACCESS(DATACONTROL_FUNC_CONSUMER);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
- for (index = 0; index < 5; index++)
+ for (index = 0; index < 4; index++)
{
if (index < argumentCount)
reserveArguments[index] = arguments[index];
Catch (WrtDeviceApis::Commons::ConversionException)
{
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, "type mismatch error");
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("InvalidArgumentException");
+ LoggerE("InvalidArgumentException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, "type mismatch error");
}
Catch(WrtDeviceApis::Commons::UnsupportedException)
{
- LogError("UnsupportException");
+ LoggerE("UnsupportException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, "Unsupport Exception");
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("UnkownException");
+ LoggerE("UnkownException");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, "Unkown error");
}
//
#include <algorithm>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "DataControlConverter.h"
#include "JSSelectObjectArrayValues.h"
#include "DataControlConverter.h"
+#include <Logger.h>
#define FUNCTION_CONCAT "concat"
#define FUNCTION_JOIN "join"
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
{
Try
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSSelectObjectArrayValuesPriv* priv = static_cast<JSSelectObjectArrayValuesPriv*>(JSObjectGetPrivate(object));
if (!priv)
DataControlConverter converter(priv->getContext());
int index = converter.toSizeT(propertyName);
- LogDebug(index);
+ LoggerD(index);
ISelectDataObjectPtr SelectDataOjbect = priv->getObject();
if (index < SelectDataOjbect->getRowNumber())
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return false;
}
{
Try
{
- LogDebug("Eneter");
+ LoggerD("Eneter");
JSSelectObjectArrayValuesPriv* priv = static_cast<JSSelectObjectArrayValuesPriv*>(JSObjectGetPrivate(object));
if (!priv)
DataControlConverter converter(priv->getContext());
size_t index = converter.toSizeT(propertyName);
- LogDebug(index);
+ LoggerD(index);
ISelectDataObjectPtr SelectDataOjbect = priv->getObject();
if (index >= SelectDataOjbect->getRowNumber())
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}*/
return false;
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch");
}*/
return false;
{
Try
{
- LogDebug("Eneter");
+ LoggerD("Eneter");
JSSelectObjectArrayValuesPriv* priv = static_cast<JSSelectObjectArrayValuesPriv*>(JSObjectGetPrivate(object));
if (!priv)
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
}
static void MappedDataControlGetValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventGetValuePendingEvent *pendingEvent = NULL;
MappedDataControlConsumer *consumer = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 3)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void MappedDataControlAddValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventAddValuePendingEvent *pendingEvent = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void MappedDataControlRemoveValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (data == NULL)
{
- LogDebug("Data or Bundle error");
+ LoggerD("Data or Bundle error");
return;
}
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void MappedDataControlUpdateValueCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventUpdateValuePendingEvent* pendingEvent = NULL;
MappedDataControlConsumer *consumer = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
}
MappedDataControlConsumer::MappedDataControlConsumer()
{
- LogDebug("Enter");
+ LoggerD("Enter");
m_appId = "";
m_type = "";;
MappedDataControlConsumer::~MappedDataControlConsumer()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
DPL::Mutex MappedDataControlConsumer::m_mutex;
if (m_appId.length() == 0)
{
- LogDebug("need " << passId);
+ LoggerD("need " << passId);
if( pkgmgr_datacontrol_get_info(passId, OSP_PKGINFO_MAP_TYPE, &appId, &access) < 0)
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get appId error");
}
- LogDebug("need2");
+ LoggerD("need2");
if (appId)
{
- LogDebug(appId);
+ LoggerD(appId);
appIdStr = appId;
free(appId);
}
void MappedDataControlConsumer::OnRequestReceived(const EventAddValuePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
{
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
void MappedDataControlConsumer::OnRequestReceived(const EventRemoveValuePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
void MappedDataControlConsumer::OnRequestReceived(const EventGetValuePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
void MappedDataControlConsumer::OnRequestReceived(const EventUpdateValuePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
#include <map>
#include <vector>
#include <Commons/Exception.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace DataControl {
RowData(std::vector<std::string>& keys, std::vector<std::string>& values)
{
- LogDebug("entered");
+ LoggerD("entered");
if (keys.size() == 0)
{
SelectDataObject::SelectDataObject()
{
- LogDebug("Enter");
+ LoggerD("Enter");
m_colCount = 0;
m_rowCount = 0;
SelectDataObject::~SelectDataObject()
{
- LogDebug("Enter");
+ LoggerD("Enter");
m_istream.close();
if (unlink(m_filePath.c_str()) != 0)
{
- LogError("Error while removing SelectDataObject.");
+ LoggerE("Error while removing SelectDataObject.");
}
}
void SelectDataObject::openResultPath(const std::string& filepath)
{
- LogDebug("Enter");
+ LoggerD("Enter");
m_filePath = filepath;
m_istream.open(m_filePath.c_str(), std::ios::binary);
if (m_istream.is_open())
{
- LogDebug("load header");
+ LoggerD("load header");
loadHeader();
- LogDebug("print header"); // debug
+ LoggerD("print header"); // debug
printHeader();
}
else
{
- LogDebug("fail open" << filepath);
+ LoggerD("fail open" << filepath);
}
}
void SelectDataObject::OnRequestReceived(const EventGetIndexedRowPtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
char *buf = NULL;
try
m_istream.read((char*)&type, sizeof(type)); // skip type
m_istream.read((char*)&size, sizeof(int)); // read size
- LogDebug(type << " - " << size << " ");
+ LoggerD(type << " - " << size << " ");
if (memorizedSize < size)
{
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
}
void SelectDataObject::printHeader()
{
- LogDebug("Eneter");
+ LoggerD("Eneter");
for (size_t index = 0; index < m_headerInfo.size(); index++)
{
- LogDebug(m_headerInfo[index].m_type << " " << m_headerInfo[index].m_name);
+ LoggerD(m_headerInfo[index].m_type << " " << m_headerInfo[index].m_name);
}
}
int index = 0;
if (m_istream.good() == false)
- LogDebug("Error");
+ LoggerD("Error");
for (index = 0; index < m_colCount; index++)
{
size = 0;
m_istream.seekg(sizeof(int), std::ios::cur); // skip type
m_istream.read((char*)&size, sizeof(int)); // read size
- LogDebug(size << " ");
+ LoggerD(size << " ");
m_istream.seekg(size, std::ios::cur); // skip data
}
static void sqldataControlSelectCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventSelectPendingEvent *pendingEvent = NULL;
SQLDataControlConsumer *consumer = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 3)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void sqldataControlInsertCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventInsertPendingEvent *pendingEvent = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
std::stringstream sstr(result[2]);
long insertRowid = 0;
sstr >> insertRowid;
- LogDebug(result[2] << insertRowid);
+ LoggerD(result[2] << insertRowid);
event->setRowId(insertRowid);
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::None);
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void sqldataControlDeleteCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (data == NULL)
{
- LogDebug("Data or Bundle error");
+ LoggerD("Data or Bundle error");
return;
}
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
static void sqldataControlUpdateCallback(bundle* b, int request_code, appsvc_result_val res, void* data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
EventUpdatePendingEvent* pendingEvent = NULL;
SQLDataControlConsumer *consumer = NULL;
{
if (data == NULL)
{
- LogDebug("data null, can not send result to JS Layer");
+ LoggerD("data null, can not send result to JS Layer");
return;
}
for (size_t index = 0; index < result.size(); index++)
{
- LogDebug(result[index]);
+ LoggerD(result[index]);
}
if (result.size() < 2)
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
}
SQLDataControlConsumer::SQLDataControlConsumer()
{
- LogDebug("Enter");
+ LoggerD("Enter");
m_appId = "";
m_type = "";;
SQLDataControlConsumer::~SQLDataControlConsumer()
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
DPL::Mutex SQLDataControlConsumer::m_mutex;
if (m_appId.length() == 0)
{
- LogDebug("need " << passId);
+ LoggerD("need " << passId);
if( pkgmgr_datacontrol_get_info(passId, OSP_PKGINFO_SQL_TYPE, &appId, &access) < 0)
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "get appId error");
}
- LogDebug("need2");
+ LoggerD("need2");
if (appId)
{
- LogDebug(appId);
+ LoggerD(appId);
appIdStr = appId;
free(appId);
}
void SQLDataControlConsumer::OnRequestReceived(const EventInsertPtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
{
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
void SQLDataControlConsumer::OnRequestReceived(const EventDeletePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
void SQLDataControlConsumer::OnRequestReceived(const EventSelectPtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
void SQLDataControlConsumer::OnRequestReceived(const EventUpdatePtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bundle* passData = NULL;
try
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
event->setErrorMsg(ex.GetMessage());
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <TimeTracer.h>
#include "JSDataControlManager.h"
#include "DataControlAsyncCallbackManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\DataControl ] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\DataControl ] on_widget_start_callback ("<<widgetId<<")");
TIME_TRACER_INIT();
Try
{
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\DataControl] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\DataControl] on_widget_stop_callback ("<<widgetId<<")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"DataControl");
TIME_TRACER_RELEASE();
Try
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[SEC\\application] on_frame_load_callback (" << context << ")");
+ LoggerD("[SEC\\application] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[SEC\\application] on_frame_unload_callback (" << context << ")");
+ LoggerD("[SEC\\application] on_frame_unload_callback (" << context << ")");
DeviceAPI::DataControl::DataControlAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSSyncServiceInfo.h"
#include "JSSyncProfileInfo.h"
#include "JSSyncStatistics.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
return TIZEN_DATA_SYNC_MODE_PUSH;
default:
{
- LogWarning("Invalid sync mode.");
+ LoggerW("Invalid sync mode.");
return "";
}
}
return TIZEN_DATA_SYNC_TYPE_REFRESH_FROM_SERVER;
default:
{
- LogWarning("Invalid sync type.");
+ LoggerW("Invalid sync type.");
return "";
}
}
return TIZEN_DATA_SYNC_INTERVAL_1_MONTH;
default:
{
- LogWarning("Invalid sync interval.");
+ LoggerW("Invalid sync interval.");
return "";
}
}
return TIZEN_DATA_SYNC_SERVICE_TYPE_EVENT;
default:
{
- LogWarning("Invalid sync service type.");
+ LoggerW("Invalid sync service type.");
return "";
}
}
return TIZEN_DATA_SYNC_STATUS_NONE;
default:
{
- LogWarning("Invalid sync status type.");
+ LoggerW("Invalid sync status type.");
return "";
}
}
std::vector<SyncServiceInfoPtr> resultVector;
JSObjectRef objArg = toJSObjectRef(serviceInfoList);
- LogDebug("Array length "<<JSGetArrayLength(m_context, objArg));
+ LoggerD("Array length "<<JSGetArrayLength(m_context, objArg));
for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); i++) {
JSValueRef element = JSGetArrayElement(m_context, objArg, i);
if (!JSValueIsObjectOfClass(m_context, element, JSSyncServiceInfo::getClassRef())) {
#define _TIZEN_DATASYNC_LISTENER_MANAGER_H_
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSDataSyncManager.h"
#include "IDataSyncManager.h"
#include <sstream>
+#include <Logger.h>
namespace DeviceAPI {
namespace DataSync {
{
DataSyncManagerPrivObject *privateObject = static_cast<DataSyncManagerPrivObject*>(JSObjectGetPrivate(m_object));
if (!privateObject) {
- LogWarning("Object is null.");
+ LoggerW("Object is null.");
return;
}
IDataSyncManagerPtr datasyncManager = privateObject->getObject();
Try {
- LogDebug("Remove change listeners for datasync operation with id: "<<m_watchId);
+ LoggerD("Remove change listeners for datasync operation with id: "<<m_watchId);
IEventStopSyncPtr dplEvent(new IEventStopSync());
std::stringstream ss;
ss<<m_watchId;
dplEvent->setForSynchronousCall();
datasyncManager->stopSync(dplEvent);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
#include "SyncServiceInfo.h"
#include "SyncProfileInfo.h"
-#include <dpl/log/log.h>
-
#include <sync_agent.h>
-
#include <sstream>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
DataSyncManager::DataSyncManager()
{
- LogInfo("Initialize the datasync manager with count: "<<m_instanceCount);
+ LoggerI("Initialize the datasync manager with count: "<<m_instanceCount);
if (0==m_instanceCount) {
sync_agent_ds_error_e ds_err = sync_agent_ds_init();
if (SYNC_AGENT_DS_SUCCESS!=ds_err) {
- LogError("Failed to init oma ds.");
+ LoggerE("Failed to init oma ds.");
}
}
m_instanceCount++;
DataSyncManager::~DataSyncManager()
{
- LogInfo("Deinitialize the datasync manager with count: "<<m_instanceCount);
+ LoggerI("Deinitialize the datasync manager with count: "<<m_instanceCount);
m_instanceCount--;
if (0==m_instanceCount) {
sync_agent_ds_error_e ds_err = sync_agent_ds_deinit();
if (SYNC_AGENT_DS_SUCCESS!=ds_err) {
- LogError("Failed to deinit oma ds.");
+ LoggerE("Failed to deinit oma ds.");
}
}
}
static int datasync_state_changed_cb(sync_agent_event_data_s* request, void *user_data)
{
- LogDebug("DataSync session state changed.");
+ LoggerD("DataSync session state changed.");
char *profileDirName = NULL;
int sync_type = 0;
OnDataSyncStateChangedPtr eventPtr(new OnDataSyncStateChanged());
DataSyncManager* thisDataSyncManager = (DataSyncManager*) user_data;
- LogDebug("Get state info.");
+ LoggerD("Get state info.");
sync_agent_get_event_data_param(request, &profileDirName);
sync_agent_get_event_data_param(request, &sync_type);
sync_agent_get_event_data_param(request, &progress);
sync_agent_get_event_data_param(request, &error);
- LogDebug("profileDirName: "<<profileDirName<<", sync_type: "<<sync_type<<", progress: "<<progress<<", error: "<<error);
+ LoggerD("profileDirName: "<<profileDirName<<", sync_type: "<<sync_type<<", progress: "<<progress<<", error: "<<error);
if(profileDirName) {
eventPtr->setProfileId(profileDirName);
}
if(NULL==progress) {
- LogWarning("Null status.");
+ LoggerW("Null status.");
eventPtr->setSessionStatus(OnDataSyncStateChanged::UNDEFINED_STATUS);
} else if(0==strcmp(progress, "DONE")) {
eventPtr->setSessionStatus(OnDataSyncStateChanged::COMPLETE_STATUS);
// Error cases should be redefined and transferred based on the error value.
eventPtr->setSessionStatus(OnDataSyncStateChanged::FAIL_STATUS);
} else {
- LogWarning("Wrong status.");
+ LoggerW("Wrong status.");
eventPtr->setSessionStatus(OnDataSyncStateChanged::UNDEFINED_STATUS);
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
if(profileDirName) {
static int datasync_progress_cb(sync_agent_event_data_s* request, void *user_data)
{
- LogDebug("DataSync progress called.");
+ LoggerD("DataSync progress called.");
char *profileDirName = NULL;
int syncType = 0;
int isFromServer, totalPerOperation, syncedPerOperation, totalPerDb, syncedPerDb;
- LogDebug("Get progress info.");
+ LoggerD("Get progress info.");
sync_agent_get_event_data_param(request, &profileDirName);
sync_agent_get_event_data_param(request, &syncType);
sync_agent_get_event_data_param(request, &uri);
sync_agent_get_event_data_param(request, &progressStatus);
sync_agent_get_event_data_param(request, &operationType);
- LogDebug("profileDirName: "<<profileDirName<<", syncType: "<<syncType<<", uri: "<<uri<<", progressStatus: "<<progressStatus<<", operationType "<<operationType);
+ LoggerD("profileDirName: "<<profileDirName<<", syncType: "<<syncType<<", uri: "<<uri<<", progressStatus: "<<progressStatus<<", operationType "<<operationType);
sync_agent_get_event_data_param(request, &isFromServer);
sync_agent_get_event_data_param(request, &totalPerOperation);
sync_agent_get_event_data_param(request, &totalPerDb);
sync_agent_get_event_data_param(request, &syncedPerDb);
- LogDebug("isFromServer: "<<isFromServer<<", totalPerOperation: "<<totalPerOperation<<", syncedPerOperation: "<<syncedPerOperation<<", totalPerDb: "<<totalPerDb<<", syncedPerDb "<<syncedPerDb);
+ LoggerD("isFromServer: "<<isFromServer<<", totalPerOperation: "<<totalPerOperation<<", syncedPerOperation: "<<syncedPerOperation<<", totalPerDb: "<<totalPerDb<<", syncedPerDb "<<syncedPerDb);
if(profileDirName) {
eventPtr->setProfileId(profileDirName);
} else if(SYNC_AGENT_SRC_URI_CALENDAR==uri) {
eventPtr->setServiceType(SyncServiceInfo::EVENT_SERVICE_TYPE);
} else {
- LogWarning("Wrong service type.");
+ LoggerW("Wrong service type.");
eventPtr->setServiceType(SyncServiceInfo::UNDEFINED_SERVICE_TYPE);
}
}
Catch (Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
if(profileDirName) {
} else if(SyncInfo::PUSH_MODE==syncMode) {
return SYNC_AGENT_SYNC_MODE_PUSH;
} else {
- LogWarning("Error while converting a sync mode.");
+ LoggerW("Error while converting a sync mode.");
}
return SYNC_AGENT_SYNC_MODE_MANUAL;
} else if(SYNC_AGENT_SYNC_MODE_PUSH==syncMode) {
return SyncInfo::PUSH_MODE;
} else {
- LogWarning("Error while converting a sync mode.");
+ LoggerW("Error while converting a sync mode.");
}
return SyncInfo::UNDEFINED_MODE;
} else if(SyncInfo::REFRESH_FROM_SERVER_TYPE==syncType) {
return SYNC_AGENT_SYNC_TYPE_REFRESH_FROM_SERVER;
} else {
- LogWarning("Error while converting a sync type.");
+ LoggerW("Error while converting a sync type.");
}
return SYNC_AGENT_SYNC_TYPE_UPDATE_BOTH;
} else if(SYNC_AGENT_SYNC_TYPE_REFRESH_FROM_SERVER==syncType) {
return SyncInfo::REFRESH_FROM_SERVER_TYPE;
} else {
- LogWarning("Error while converting a sync type.");
+ LoggerW("Error while converting a sync type.");
}
return SyncInfo::UNDEFINED_TYPE;
} else if(SyncInfo::INTERVAL_1_MONTH==syncInterval) {
return SYNC_AGENT_SYNC_INTERVAL_1_MONTH;
} else {
- LogWarning("Error while converting a sync interval.");
+ LoggerW("Error while converting a sync interval.");
}
return SYNC_AGENT_SYNC_INTERVAL_1_WEEK;
} else if(SYNC_AGENT_SYNC_INTERVAL_1_MONTH==syncInterval) {
return SyncInfo::INTERVAL_1_MONTH;
} else {
- LogWarning("Error while converting a sync interval.");
+ LoggerW("Error while converting a sync interval.");
}
return SyncInfo::INTERVAL_UNDEFINED;
} else if(SyncServiceInfo::EVENT_SERVICE_TYPE==serviceType) {
return SYNC_AGENT_CALENDAR;
} else {
- LogWarning("Error while converting a sync service type.");
+ LoggerW("Error while converting a sync service type.");
}
return SYNC_AGENT_CONTACT;
} else if(SYNC_AGENT_CALENDAR==serviceType) {
return SyncServiceInfo::EVENT_SERVICE_TYPE;
} else {
- LogWarning("Error while converting a sync service type.");
+ LoggerW("Error while converting a sync service type.");
}
return SyncServiceInfo::UNDEFINED_SERVICE_TYPE;
} else if(SyncServiceInfo::EVENT_SERVICE_TYPE==serviceType) {
return SYNC_AGENT_SRC_URI_CALENDAR;
} else {
- LogWarning("Error while converting a sync service.");
+ LoggerW("Error while converting a sync service.");
}
return SYNC_AGENT_SRC_URI_CONTACT;
} else if(0==strcmp(status, "No")) {
return SyncStatistics::NONE_STATUS;
} else {
- LogWarning("Error while converting a sync status.");
+ LoggerW("Error while converting a sync status.");
}
return SyncStatistics::UNDEFINED_STATUS;
if(profile_list) {
g_list_free(profile_list);
}
- LogDebug("numProfiles: "<<numProfiles);
+ LoggerD("numProfiles: "<<numProfiles);
if(MAX_PROFILES_NUM==numProfiles) {
ThrowMsg(OutOfRangeException, "There are already maximum number of profiles!");
}
ThrowMsg(NullPointerException, "SyncProfileInfo is NULL.");
}
- LogDebug("url: "<<profile->getSyncInfo()->getUrl());
+ LoggerD("url: "<<profile->getSyncInfo()->getUrl());
ret = sync_agent_ds_create_profile_info(&profile_h);
if (SYNC_AGENT_DS_SUCCESS!=ret) {
sync_agent_ds_sync_mode_e syncMode = convertToPlatformSyncMode(profile->getSyncInfo()->getSyncMode());
sync_agent_ds_sync_type_e syncType = convertToPlatformSyncType(profile->getSyncInfo()->getSyncType());
sync_agent_ds_sync_interval_e syncInterval = convertToPlatformSyncInterval(profile->getSyncInfo()->getSyncInterval());
- LogDebug("syncMode: "<<syncMode<<", syncType: "<<syncType<<", syncInterval: "<<syncInterval);
+ LoggerD("syncMode: "<<syncMode<<", syncType: "<<syncType<<", syncInterval: "<<syncInterval);
ret = sync_agent_ds_set_sync_info(profile_h, syncMode, syncType, syncInterval);
if (SYNC_AGENT_DS_SUCCESS!=ret) {
password = categories->at(i)->getPassword();
enable = categories->at(i)->getEnable();
- LogDebug("serviceType: "<<serviceType<<", tgtURI: "<<tgtURI<<", id: "<<id<<" for index: "<<i);
+ LoggerD("serviceType: "<<serviceType<<", tgtURI: "<<tgtURI<<", id: "<<id<<" for index: "<<i);
ret = sync_agent_ds_set_sync_service_info(profile_h, serviceType, enable, srcURI, (char*)(tgtURI.c_str()),
0==id.size() ? NULL : (char*)(id.c_str()), 0==password.size() ? NULL : (char*)(password.c_str()));
ThrowMsg(PlatformException, "Platform error while adding a profile: "<<ret);
}
- LogDebug("profileId from platform: "<<profileId);
+ LoggerD("profileId from platform: "<<profileId);
char* profileName = NULL;
ret = sync_agent_ds_get_profile_name(profile_h, &profileName);
ThrowMsg(PlatformException, "Platform error while getting a profile name: "<<ret);
}
- LogDebug("profileName: "<<profileName<<", profileId: "<<profileId);
+ LoggerD("profileName: "<<profileName<<", profileId: "<<profileId);
std::stringstream ss;
ss<<profileId;
}
Catch(OutOfRangeException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::OutOfRangeException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
ThrowMsg(NullPointerException, "SyncProfileInfo is NULL.");
}
- LogDebug("id: "<<profile->getProfileId());
+ LoggerD("id: "<<profile->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
sync_agent_ds_sync_mode_e syncMode = convertToPlatformSyncMode(profile->getSyncInfo()->getSyncMode());
sync_agent_ds_sync_type_e syncType = convertToPlatformSyncType(profile->getSyncInfo()->getSyncType());
sync_agent_ds_sync_interval_e syncInterval = convertToPlatformSyncInterval(profile->getSyncInfo()->getSyncInterval());
- LogDebug("syncMode: "<<syncMode<<", syncType: "<<syncType<<", syncInterval: "<<syncInterval);
+ LoggerD("syncMode: "<<syncMode<<", syncType: "<<syncType<<", syncInterval: "<<syncInterval);
ret = sync_agent_ds_set_sync_info(profile_h, syncMode, syncType, syncInterval);
if (SYNC_AGENT_DS_SUCCESS!=ret) {
password = categories->at(i)->getPassword();
enable = categories->at(i)->getEnable();
- LogDebug("serviceType: "<<serviceType<<", tgtURI: "<<tgtURI<<", id: "<<id<<" for index: "<<i);
+ LoggerD("serviceType: "<<serviceType<<", tgtURI: "<<tgtURI<<", id: "<<id<<" for index: "<<i);
ret = sync_agent_ds_set_sync_service_info(profile_h, serviceType, enable, srcURI, (char*)(tgtURI.c_str()),
0==id.size() ? NULL : (char*)(id.c_str()), 0==password.size() ? NULL : (char*)(password.c_str()));
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Try
{
- LogDebug("id: "<<event->getProfileId());
+ LoggerD("id: "<<event->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
{
Try
{
- LogDebug("Return maximum number of supported profiles: "<<MAX_PROFILES_NUM);
+ LoggerD("Return maximum number of supported profiles: "<<MAX_PROFILES_NUM);
event->setNumMaxProfiles(MAX_PROFILES_NUM);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
int numProfiles=0;
for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
sync_agent_ds_free_profile_info((ds_profile_h) iter->data);
- LogDebug("Free sync_agent_ds_profile_info for index: "<<numProfiles++);
+ LoggerD("Free sync_agent_ds_profile_info for index: "<<numProfiles++);
}
- LogDebug("numProfiles: "<<numProfiles);
+ LoggerD("numProfiles: "<<numProfiles);
event->setNumProfiles(numProfiles);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Try
{
- LogDebug("id: "<<event->getProfileId());
+ LoggerD("id: "<<event->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
profile->getSyncInfo()->setId(server_info.id);
profile->getSyncInfo()->setPassword(server_info.password);
- LogDebug("Url: "<<profile->getSyncInfo()->getUrl());
+ LoggerD("Url: "<<profile->getSyncInfo()->getUrl());
sync_agent_ds_sync_info sync_info;
ret = sync_agent_ds_get_sync_info(profile_h, &sync_info);
profile->getSyncInfo()->setSyncType(convertToSyncType(sync_info.sync_type));
profile->getSyncInfo()->setSyncInterval(convertToSyncInterval(sync_info.interval));
- LogDebug("Sync mode: "<<sync_info.sync_mode<<", type: "<<sync_info.sync_type<<", interval: "<<sync_info.interval);
+ LoggerD("Sync mode: "<<sync_info.sync_mode<<", type: "<<sync_info.sync_type<<", interval: "<<sync_info.interval);
GList *category_list = NULL;
sync_agent_ds_service_info *category_info = NULL;
ThrowMsg(PlatformException, "Platform error while gettting sync categories: "<<ret);
}
int category_count = g_list_length(category_list);
- LogDebug("category_count: "<<category_count);
+ LoggerD("category_count: "<<category_count);
while(category_count--) {
category_info = (sync_agent_ds_service_info *) g_list_nth_data(category_list, category_count);
if(SYNC_AGENT_CALENDAR<category_info->service_type) {
- LogDebug("Skip unsupported sync service type: "<<category_info->service_type);
+ LoggerD("Skip unsupported sync service type: "<<category_info->service_type);
continue;
}
serviceInfo->setServerDatabaseUri(category_info->tgt_uri);
}
- LogDebug("Service type: "<<serviceInfo->getSyncServiceType()<<", DB URI: "<<serviceInfo->getServerDatabaseUri());
+ LoggerD("Service type: "<<serviceInfo->getSyncServiceType()<<", DB URI: "<<serviceInfo->getServerDatabaseUri());
profile->getServiceInfo()->push_back(serviceInfo);
}
if(category_list) {
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
ThrowMsg(PlatformException, "Platform error while getting all profiles: "<<ret);
}
- LogDebug("Number of profiles: "<< g_list_length(profile_list));
+ LoggerD("Number of profiles: "<< g_list_length(profile_list));
for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
profile_h = (ds_profile_h) iter->data;
SyncProfileInfoPtr profile( new SyncProfileInfo() );
ss<<profileId;
profile->setProfileId(ss.str());
- LogDebug("Processing a profile with id: "<<profile->getProfileId());
+ LoggerD("Processing a profile with id: "<<profile->getProfileId());
char *profileName = NULL;
ret = sync_agent_ds_get_profile_name(profile_h, &profileName);
profile->getSyncInfo()->setId(server_info.id);
profile->getSyncInfo()->setPassword(server_info.password);
- LogDebug("Url: "<<profile->getSyncInfo()->getUrl());
+ LoggerD("Url: "<<profile->getSyncInfo()->getUrl());
sync_agent_ds_sync_info sync_info;
ret = sync_agent_ds_get_sync_info(profile_h, &sync_info);
profile->getSyncInfo()->setSyncType(convertToSyncType(sync_info.sync_type));
profile->getSyncInfo()->setSyncInterval(convertToSyncInterval(sync_info.interval));
- LogDebug("Sync mode: "<<sync_info.sync_mode<<", type: "<<sync_info.sync_type<<", interval: "<<sync_info.interval);
+ LoggerD("Sync mode: "<<sync_info.sync_mode<<", type: "<<sync_info.sync_type<<", interval: "<<sync_info.interval);
GList *category_list = NULL;
sync_agent_ds_service_info *category_info = NULL;
ThrowMsg(PlatformException, "Platform error while gettting sync categories: "<<ret);
}
int category_count = g_list_length(category_list);
- LogDebug("category_count: "<<category_count);
+ LoggerD("category_count: "<<category_count);
while(category_count--) {
category_info = (sync_agent_ds_service_info *) g_list_nth_data(category_list, category_count);
if(SYNC_AGENT_CALENDAR<category_info->service_type) {
- LogDebug("Skip unsupported sync service type: "<<category_info->service_type);
+ LoggerD("Skip unsupported sync service type: "<<category_info->service_type);
continue;
}
serviceInfo->setServerDatabaseUri(category_info->tgt_uri);
}
- LogDebug("Service type: "<<serviceInfo->getSyncServiceType()<<", DB URI: "<<serviceInfo->getServerDatabaseUri());
+ LoggerD("Service type: "<<serviceInfo->getSyncServiceType()<<", DB URI: "<<serviceInfo->getServerDatabaseUri());
profile->getServiceInfo()->push_back(serviceInfo);
}
if(category_list) {
g_list_free(category_list);
}
- LogDebug("Adding a profile to the list.");
+ LoggerD("Adding a profile to the list.");
event->getProfiles()->push_back(profile);
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
- LogDebug("Free profiles list.");
+ LoggerD("Free profiles list.");
for (iter = profile_list; iter != NULL; iter = g_list_next(iter)) {
sync_agent_ds_free_profile_info((ds_profile_h) iter->data);
}
Try
{
- LogDebug("id: "<<event->getProfileId());
+ LoggerD("id: "<<event->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
sync_agent_event_error_e err= SYNC_AGENT_EVENT_FAIL;
}
if(event->getEmitter()) {
- LogDebug("Attaching the emitter with profileId: "<<event->getProfileId());
+ LoggerD("Attaching the emitter with profileId: "<<event->getProfileId());
m_changeEmitters[std::string("Sync") + event->getProfileId()] = event->getEmitter();
}
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Try
{
- LogDebug("id: "<<event->getProfileId());
+ LoggerD("id: "<<event->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
Try
{
- LogDebug("id: "<<event->getProfileId());
+ LoggerD("id: "<<event->getProfileId());
sync_agent_ds_error_e ret = SYNC_AGENT_DS_FAIL;
}
int statistics_count = g_list_length(statistics_list);
- LogDebug("statistics_count: "<<statistics_count);
+ LoggerD("statistics_count: "<<statistics_count);
sync_agent_ds_statistics_info *statistics = NULL;
for (int i = 0; i < statistics_count; i++) {
statistics = (sync_agent_ds_statistics_info *) g_list_nth_data(statistics_list, i);
SyncStatisticsPtr statisticsPtr( new SyncStatistics() );
if(0==i) {
- LogDebug("Statistics for contact.");
+ LoggerD("Statistics for contact.");
statisticsPtr->setServiceType(convertToSyncServiceType(SYNC_AGENT_CONTACT));
} else if(1==i) {
- LogDebug("Statistics for event.");
+ LoggerD("Statistics for event.");
statisticsPtr->setServiceType(convertToSyncServiceType(SYNC_AGENT_CALENDAR));
} else {
- LogWarning("Unsupported category for statistics: "<<i);
+ LoggerW("Unsupported category for statistics: "<<i);
continue;
}
- LogDebug("dbsynced: "<<statistics->dbsynced);
+ LoggerD("dbsynced: "<<statistics->dbsynced);
statisticsPtr->setSyncStatus(convertToSyncStatus(statistics->dbsynced));
statisticsPtr->setClientToServerTotal(statistics->client2server_total);
statisticsPtr->setClientToServerAdded(statistics->client2server_nrofadd);
statisticsPtr->setServerToClientUpdated(statistics->server2client_nrofreplace);
statisticsPtr->setServerToClientRemoved(statistics->server2client_nrofdelete);
- LogDebug("ClientToServerTotal: "<<statisticsPtr->getClientToServerTotal()<<", ServerToClientTotal: "<<statisticsPtr->getServerToClientTotal());
+ LoggerD("ClientToServerTotal: "<<statisticsPtr->getClientToServerTotal()<<", ServerToClientTotal: "<<statisticsPtr->getServerToClientTotal());
statisticsList->push_back(statisticsPtr);
}
}
Catch(NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::NotFoundException);
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
event->setResult(false);
event->setExceptionCode(ExceptionCodes::PlatformException);
}
// limitations under the License.
//
-
#include "DataSyncResponseDispatcher.h"
#include "DataSyncConverter.h"
#include "DataSyncMultiCallback.h"
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
DataSyncStateChangeCallbackPrivateDataPtr multiCallbacks =
DPL::StaticPointerCast<DataSyncStateChangeCallbackPrivateData>(event->getPrivateData());
if (!multiCallbacks) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
DataSyncConverter converter(context);
JSValueRef profileId = converter.toJSValueRef(event->getProfileId());
if( OnDataSyncStateChanged::PROGRESS_STATUS==event->getSessionStatus() ) {
- LogDebug("Sync progress: "<<event->getSyncedPerService()<<"/"<<event->getTotalPerService());
+ LoggerD("Sync progress: "<<event->getSyncedPerService()<<"/"<<event->getTotalPerService());
JSValueRef serviceType = converter.toJSValueRef(converter.toTizenValue(event->getServiceType()));
JSValueRef isFromServer = converter.toJSValueRef(event->getIsFromServer());
JSValueRef totalPerService = converter.toJSValueRef(event->getTotalPerService());
JSValueRef objParam[5] = {profileId, serviceType, isFromServer, totalPerService, syncedPerService};
multiCallbacks->getOnProgress()->callOnSuccess(objParam, 5);
} else if ( OnDataSyncStateChanged::COMPLETE_STATUS==event->getSessionStatus() ) {
- LogDebug("Sync completed.");
+ LoggerD("Sync completed.");
multiCallbacks->getOnCompleted()->callOnSuccess(profileId);
} else if ( OnDataSyncStateChanged::STOP_STATUS==event->getSessionStatus() ) {
- LogDebug("Sync stopped.");
+ LoggerD("Sync stopped.");
multiCallbacks->getOnStopped()->callOnSuccess(profileId);
} else if ( OnDataSyncStateChanged::FAIL_STATUS==event->getSessionStatus()) {
- LogDebug("Sync failed with: "<<event->getExceptionCode());
+ LoggerD("Sync failed with: "<<event->getExceptionCode());
JSValueRef errorObject;
if (ExceptionCodes::PlatformException==event->getExceptionCode()) {
//errorObject = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::NETWORK_ERROR, event->getErrorMessage());
JSValueRef objParam[2] = {profileId, errorObject};
multiCallbacks->getOnFailed()->callOnSuccess(objParam, 2);
} else {
- LogWarning("Wrong sync session state.");
+ LoggerW("Wrong sync session state.");
}
} else {
- LogWarning("Failed result received.");
+ LoggerW("Failed result received.");
}
}
Catch(Exception)
{
- LogError("Error during processing answer.");
+ LoggerE("Error during processing answer.");
}
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <string>
-
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "OnDataSyncStateChanged.h"
#include "DataSyncManager.h"
-
#include "JSDataSyncManager.h"
#include "DataSyncConverter.h"
#include "JSSyncInfo.h"
#include "DataSyncResponseDispatcher.h"
#include "DataSyncMultiCallback.h"
#include "DataSyncListenerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
void JSDataSyncManager::initialize(JSContextRef context, JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogInfo("Create datasync manager private object.");
+ LoggerI("Create datasync manager private object.");
IDataSyncManagerPtr datasync(new DataSyncManager());
DataSyncManagerPrivObject *priv = new DataSyncManagerPrivObject(context, datasync);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogInfo("Private object already set.");
+ LoggerI("Private object already set.");
}
}
{
DataSyncManagerPrivObject *priv = static_cast<DataSyncManagerPrivObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogInfo("Deleting datasync manager private object.");
+ LoggerI("Deleting datasync manager private object.");
delete priv;
JSObjectSetPrivate(object, NULL);
}
ThrowMsg(ConversionException, "Parameter conversion failed.");
}
- LogDebug("profileName: "<<profile->getProfileName());
+ LoggerD("profileName: "<<profile->getProfileName());
IEventAddProfilePtr dplEvent(new IEventAddProfile());
datasyncManager->addProfile(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Add succeeded with id: "<<dplEvent->getProfile()->getProfileId());
+ LoggerD("Add succeeded with id: "<<dplEvent->getProfile()->getProfileId());
return JSValueMakeUndefined(context);
} else {
if (ExceptionCodes::OutOfRangeException==dplEvent->getExceptionCode()) {
}
Catch(OutOfRangeException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, "QuotaExceededError", _rethrown_exception.GetMessage());
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
ThrowMsg(ConversionException, "Parameter conversion failed.");
}
- LogDebug("profileName: "<<profile->getProfileName());
+ LoggerD("profileName: "<<profile->getProfileName());
IEventUpdateProfilePtr dplEvent(new IEventUpdateProfile());
datasyncManager->updateProfile(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Update succeeded with id: "<<dplEvent->getProfile()->getProfileId());
+ LoggerD("Update succeeded with id: "<<dplEvent->getProfile()->getProfileId());
return JSValueMakeUndefined(context);
} else {
ThrowMsg(UnknownException, "Update failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
profileId = converter.toString(arguments[0]);
}
- LogDebug("profileId: "<<profileId);
+ LoggerD("profileId: "<<profileId);
IEventRemoveProfilePtr dplEvent(new IEventRemoveProfile());
datasyncManager->removeProfile(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Remove succeeded with id: "<<dplEvent->getProfileId());
+ LoggerD("Remove succeeded with id: "<<dplEvent->getProfileId());
return JSValueMakeUndefined(context);
} else {
if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
datasyncManager->getMaxProfilesNum(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Max number of profiles: "<<dplEvent->getNumMaxProfiles());
+ LoggerD("Max number of profiles: "<<dplEvent->getNumMaxProfiles());
return converter.toJSValueRef(dplEvent->getNumMaxProfiles());
} else {
ThrowMsg(UnknownException, "Get the max number of profiles failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
datasyncManager->getProfilesNum(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Number of profiles: "<<dplEvent->getNumProfiles());
+ LoggerD("Number of profiles: "<<dplEvent->getNumProfiles());
return converter.toJSValueRef(dplEvent->getNumProfiles());
} else {
ThrowMsg(UnknownException, "Get the number of profiles failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
profileId = converter.toString(arguments[0]);
}
- LogDebug("profileId: "<<profileId);
+ LoggerD("profileId: "<<profileId);
IEventGetProfilePtr dplEvent(new IEventGetProfile());
datasyncManager->getProfile(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Get succeeded with id: "<<dplEvent->getProfileId());
+ LoggerD("Get succeeded with id: "<<dplEvent->getProfileId());
return JSSyncProfileInfo::createJSSyncProfileInfo(context, dplEvent->getProfile());
} else {
if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
datasyncManager->getAllProfiles(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Getting all profiles succeeded with length: "<<dplEvent->getProfiles()->size());
+ LoggerD("Getting all profiles succeeded with length: "<<dplEvent->getProfiles()->size());
return converter.toJSValueRefProfileInfoList(dplEvent->getProfiles());
} else {
ThrowMsg(UnknownException, "Getting all profiles failed by unknown reason.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
if (argumentCount>=1) {
profileId = converter.toString(arguments[0]);
}
- LogDebug("profileId: "<<profileId);
+ LoggerD("profileId: "<<profileId);
IEventStartSyncPtr dplEvent(new IEventStartSync());
if (argumentCount>=2) {
- LogDebug("Process the listener callback.");
+ LoggerD("Process the listener callback.");
if (JSValueIsObject(context, arguments[1])) {
- LogDebug("Non-null callbacks.");
+ LoggerD("Non-null callbacks.");
JSObjectRef objectCallbacks = converter.toJSObjectRef(arguments[1]);
JSCallbackManagerPtr onProgressCbm(NULL), onCompletedCbm(NULL), onStoppedCbm(NULL), onFailedCbm(NULL);
emitter->setListener(&DataSyncResponseDispatcher::getInstance());
emitter->setEventPrivateData(DPL::StaticPointerCast<IEventPrivateData>(privData));
- LogDebug("Set the emitter.");
+ LoggerD("Set the emitter.");
dplEvent->setEmitter(emitter);
} else if (JSValueIsNull(context, arguments[1]) || JSValueIsUndefined(context, arguments[1]) ) {
- LogDebug("Null or undefined listener.");
+ LoggerD("Null or undefined listener.");
} else {
ThrowMsg(ConversionException, "Wrong second parameter type.");
}
}
- LogDebug("Proceed the start sync event to the platform.");
+ LoggerD("Proceed the start sync event to the platform.");
dplEvent->setProfileId(profileId);
dplEvent->setForSynchronousCall();
if (dplEvent->getResult()) {
if(dplEvent->getEmitter()) {
- LogDebug("watcherId: "<<profileId.at(4));
+ LoggerD("watcherId: "<<profileId.at(4));
DataSyncListenerCancellerPtr canceller = DataSyncListenerCancellerPtr(new DataSyncListenerCanceller(globalContext, thisObject, profileId.at(4)));
IListenerItemPtr listenerItem = DPL::StaticPointerCast<IListenerItem>(canceller);
DataSyncListenerManagerSingleton::Instance().registerListener(listenerItem, globalContext);
}
- LogDebug("Starting the sync succeeded.");
+ LoggerD("Starting the sync succeeded.");
} else {
switch (dplEvent->getExceptionCode()) {
case ExceptionCodes::NotFoundException:
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
if (argumentCount>=1) {
profileId = converter.toString(arguments[0]);
}
- LogDebug("profileId: "<<profileId);
+ LoggerD("profileId: "<<profileId);
IEventStopSyncPtr dplEvent(new IEventStopSync());
datasyncManager->stopSync(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Stop sync succeeded.");
+ LoggerD("Stop sync succeeded.");
} else {
if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
ThrowMsg(NotFoundException, "Id not found.");
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
profileId = converter.toString(arguments[0]);
}
- LogDebug("profileId: "<<profileId);
+ LoggerD("profileId: "<<profileId);
IEventGetLastSyncStatisticsPtr dplEvent(new IEventGetLastSyncStatistics());
datasyncManager->getLastSyncStatistics(dplEvent);
if (dplEvent->getResult()) {
- LogDebug("Get sync statistics succeeded with length: "<<dplEvent->getSyncStatistics()->size());
+ LoggerD("Get sync statistics succeeded with length: "<<dplEvent->getSyncStatistics()->size());
return converter.toJSValueRefSyncStatisticsList(dplEvent->getSyncStatistics());
} else {
if (ExceptionCodes::NotFoundException==dplEvent->getExceptionCode()) {
}
Catch (NotFoundException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
}
Catch(UnsupportedException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, _rethrown_exception.GetMessage());
}
Catch(InvalidArgumentException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, _rethrown_exception.GetMessage());
}
Catch(ConversionException)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
}
#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;
#include "JSSyncServiceInfo.h"
#include "DataSyncConverter.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create JSSyncProfileInfo private object.");
+ LoggerD("Create JSSyncProfileInfo private object.");
SyncProfileInfoPtr syncProfileInfo( new SyncProfileInfo() );
SyncProfileInfoPrivateObject *priv = new SyncProfileInfoPrivateObject(context, syncProfileInfo);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
{
SyncProfileInfoPrivateObject* priv = static_cast<SyncProfileInfoPrivateObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogDebug("Deleting JSSyncProfileInfo private object.");
+ LoggerD("Deleting JSSyncProfileInfo private object.");
delete priv;
JSObjectSetPrivate(object, NULL);
}
}
Catch(Exception)
{
- LogError("Error during setting JSSyncProfileInfo object.");
+ LoggerE("Error during setting JSSyncProfileInfo object.");
}
}
syncProfileInfo->setServiceInfo(converter.toServiceInfoList(arguments[2]));
}
- LogDebug("profileName: "<<syncProfileInfo->getProfileName()<<", syncInfo url: "<<syncProfileInfo->getSyncInfo()->getUrl()<<", serviceInfo.length: "<<syncProfileInfo->getServiceInfo()->size());
+ LoggerD("profileName: "<<syncProfileInfo->getProfileName()<<", syncInfo url: "<<syncProfileInfo->getSyncInfo()->getUrl()<<", serviceInfo.length: "<<syncProfileInfo->getServiceInfo()->size());
return createJSSyncProfileInfo(context, syncProfileInfo);
}
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_PROFILE_INFO_SERVICE_INFO)) {
return converter.toJSValueRefServiceInfoList(syncProfileInfo->getServiceInfo());
} else {
- LogDebug("Wrong property name.");
+ LoggerD("Wrong property name.");
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
syncProfileInfo->setServiceInfo(converter.toServiceInfoList(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;
#include "JSSyncServiceInfo.h"
-
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
#include <CommonsJavaScript/Converter.h>
#include "DataSyncConverter.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
JSObjectRef object)
{
if (!JSObjectGetPrivate(object)) {
- LogDebug("Create JSSyncServiceInfo private object.");
+ LoggerD("Create JSSyncServiceInfo private object.");
SyncServiceInfoPtr syncServiceInfo( new SyncServiceInfo() );
SyncServiceInfoPrivateObject *priv = new SyncServiceInfoPrivateObject(context, syncServiceInfo);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
{
SyncServiceInfoPrivateObject* priv = static_cast<SyncServiceInfoPrivateObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogDebug("Deleting JSSyncServiceInfo private object.");
+ LoggerD("Deleting JSSyncServiceInfo private object.");
delete priv;
JSObjectSetPrivate(object, NULL);
}
}
Catch(Exception)
{
- LogError("Error during setting JSSyncServiceInfo object.");
+ LoggerE("Error during setting JSSyncServiceInfo object.");
}
}
syncServiceInfo->setPassword(converter.toString(arguments[4]));
}
- LogDebug("enable: "<<syncServiceInfo->getEnable()<<", serviceType: "<<syncServiceInfo->getSyncServiceType()<<", serverDatabaseUri: "<<syncServiceInfo->getServerDatabaseUri()<<", id: "<<syncServiceInfo->getId()<<", password: "<<syncServiceInfo->getPassword());
+ LoggerD("enable: "<<syncServiceInfo->getEnable()<<", serviceType: "<<syncServiceInfo->getSyncServiceType()<<", serverDatabaseUri: "<<syncServiceInfo->getServerDatabaseUri()<<", id: "<<syncServiceInfo->getId()<<", password: "<<syncServiceInfo->getPassword());
return createJSSyncServiceInfo(context, syncServiceInfo);
}
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());
}
// For a privacy reason.
return JSValueMakeNull(context);
} else {
- LogDebug("Wrong property name.");
+ LoggerD("Wrong property name.");
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
syncServiceInfo->setPassword(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;
#include "JSSyncStatistics.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 JSSyncStatistics private object.");
+ LoggerD("Create JSSyncStatistics private object.");
SyncStatisticsPtr syncStatistics( new SyncStatistics() );
SyncStatisticsPrivateObject *priv = new SyncStatisticsPrivateObject(context, syncStatistics);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
{
SyncStatisticsPrivateObject* priv = static_cast<SyncStatisticsPrivateObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogDebug("Deleting JSSyncStatistics private object.");
+ LoggerD("Deleting JSSyncStatistics private object.");
delete priv;
JSObjectSetPrivate(object, NULL);
}
}
Catch(Exception)
{
- LogError("Error during setting JSSyncStatistics object.");
+ LoggerE("Error during setting JSSyncStatistics object.");
}
}
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_SYNC_STATISTICS_CLIENT_TO_SERVER_REMOVED)) {
return converter.toJSValueRef(syncStatistics->getClientToServerRemoved());
} else {
- LogDebug("Wrong property name.");
+ LoggerD("Wrong property name.");
}
}
Catch(Exception)
{
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSSyncServiceInfo.h"
#include "JSSyncProfileInfo.h"
#include "DataSyncListenerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace DeviceAPI::Common;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\DataSync] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\DataSync] on_widget_start_callback (" << widgetId << ")");
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\DataSync] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\DataSync] on_widget_stop_callback (" << widgetId << ")");
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\DataSync] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\DataSync] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\DataSync] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\DataSync] on_frame_unload_callback (" << context << ")");
DataSyncListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
}
mCallbackUserData = new MultiCallbackUserData(globalCtx);
// onprogress
- JSValueRef onprogress = JSUtil::getProperty(globalCtx, object, "onprogress");
- if (JSValueIsUndefined(globalCtx, onprogress)) {
- onprogress = NULL;
- } else {
- JSObjectRef cbObj = JSValueToObject(globalCtx, onprogress, NULL);
- if (JSObjectIsFunction(globalCtx, cbObj)) {
+ JSStringRef onprogress = JSStringCreateWithUTF8CString("onprogress");
+ bool has_onprogress = JSObjectHasProperty(globalCtx, object, onprogress);
+ JSStringRelease(onprogress);
+ if (has_onprogress) {
+ JSObjectRef cbObj = JSUtil::JSValueToObject(globalCtx, JSUtil::getProperty(globalCtx, object, "onprogress"));
+ if( JSObjectIsFunction(globalCtx, cbObj) ){
mCallbackUserData->setCallback("onprogress", cbObj);
} else {
throw TypeMismatchException("onprogress is not a callback function.");
}
// onpaused
- JSValueRef onpaused = JSUtil::getProperty(globalCtx, object, "onpaused");
- if (JSValueIsUndefined(globalCtx, onpaused)) {
- onpaused = NULL;
- } else {
- JSObjectRef cbObj = JSValueToObject(globalCtx, onpaused, NULL);
- if (JSObjectIsFunction(globalCtx, cbObj)) {
+ JSStringRef onpaused = JSStringCreateWithUTF8CString("onpaused");
+ bool has_onpaused = JSObjectHasProperty(globalCtx, object, onpaused);
+ JSStringRelease(onpaused);
+ if (has_onpaused) {
+ JSObjectRef cbObj = JSUtil::JSValueToObject(globalCtx, JSUtil::getProperty(globalCtx, object, "onpaused"));
+ if( JSObjectIsFunction(globalCtx, cbObj) ){
mCallbackUserData->setCallback("onpaused", cbObj);
} else {
throw TypeMismatchException("onpaused is not a callback function.");
}
// oncanceled
- JSValueRef oncanceled = JSUtil::getProperty(globalCtx, object, "oncanceled");
- if (JSValueIsUndefined(globalCtx, oncanceled)) {
- oncanceled = NULL;
- } else {
- JSObjectRef cbObj = JSValueToObject(globalCtx, oncanceled, NULL);
- if (JSObjectIsFunction(globalCtx, cbObj)) {
+ JSStringRef oncanceled = JSStringCreateWithUTF8CString("oncanceled");
+ bool has_oncanceled = JSObjectHasProperty(globalCtx, object, oncanceled);
+ JSStringRelease(oncanceled);
+ if (has_oncanceled) {
+ JSObjectRef cbObj = JSUtil::JSValueToObject(globalCtx, JSUtil::getProperty(globalCtx, object, "oncanceled"));
+ if( JSObjectIsFunction(globalCtx, cbObj) ){
mCallbackUserData->setCallback("oncanceled", cbObj);
} else {
throw TypeMismatchException("oncanceled is not a callback function.");
}
// oncompleted
- JSValueRef oncompleted = JSUtil::getProperty(globalCtx, object, "oncompleted");
- if (JSValueIsUndefined(globalCtx, oncompleted)) {
- oncompleted = NULL;
- } else {
- JSObjectRef cbObj = JSValueToObject(globalCtx, oncompleted, NULL);
- if (JSObjectIsFunction(globalCtx, cbObj)) {
+ JSStringRef oncompleted = JSStringCreateWithUTF8CString("oncompleted");
+ bool has_oncompleted = JSObjectHasProperty(globalCtx, object, oncompleted);
+ JSStringRelease(oncompleted);
+ if (has_oncompleted) {
+ JSObjectRef cbObj = JSUtil::JSValueToObject(globalCtx, JSUtil::getProperty(globalCtx, object, "oncompleted"));
+ if( JSObjectIsFunction(globalCtx, cbObj) ){
mCallbackUserData->setCallback("oncompleted", cbObj);
} else {
throw TypeMismatchException("oncompleted is not a callback function.");
}
// onfailed
- JSValueRef onfailed = JSUtil::getProperty(globalCtx, object, "onfailed");
- if (JSValueIsUndefined(globalCtx, onfailed)) {
- onfailed = NULL;
- } else {
- JSObjectRef cbObj = JSValueToObject(globalCtx, onfailed, NULL);
- if (JSObjectIsFunction(globalCtx, cbObj)) {
+ JSStringRef onfailed = JSStringCreateWithUTF8CString("onfailed");
+ bool has_onfailed = JSObjectHasProperty(globalCtx, object, onfailed);
+ JSStringRelease(onfailed);
+ if (has_onfailed) {
+ JSObjectRef cbObj = JSUtil::JSValueToObject(globalCtx, JSUtil::getProperty(globalCtx, object, "onfailed"));
+ if( JSObjectIsFunction(globalCtx, cbObj) ){
mCallbackUserData->setCallback("onfailed", cbObj);
} else {
throw TypeMismatchException("onfailed is not a callback function.");
}
if (!success) {
- LogError("Platform error %d <%s>", err, msg.c_str());
+ LoggerE("Platform error %d <%s>", err, msg.c_str());
}
return msg;
ret = download_destroy(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
- LogWarning("Platform error while destroying download handle. downloadId=" << downloadId);
+ LoggerW("Platform error while destroying download handle. downloadId=" << downloadId);
}
std::string virtualPath;
try {
virtualPath = DeviceAPI::Filesystem::Utils::toVirtualPath(NULL, fullPath);
} catch (...) {
- LogWarning("Platform error while converting fullPath.");
+ LoggerW("Platform error while converting fullPath.");
virtualPath = fullPath;
}
std::string errMessage;
ret = download_get_error(downloadId, (download_error_e*)&err);
if (ret != DOWNLOAD_ERROR_NONE) {
- LogWarning("Platform error while getting download error. ");
+ LoggerW("Platform error while getting download error. ");
} else {
errMessage = _get_download_error(err);
}
ret = download_destroy(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
- LogWarning("Platform error while destroying download handle. downloadId=" << downloadId);
+ LoggerW("Platform error while destroying download handle. downloadId=" << downloadId);
}
UnknownException error(errMessage.c_str());
ret = download_destroy(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
- LogWarning("Platform error while destroying download handle. downloadId=" << downloadId);
+ LoggerW("Platform error while destroying download handle. downloadId=" << downloadId);
}
callback->oncanceled(downloadId);
break;
}
default:
- LogWarning("State changed is ignored.");
+ LoggerW("State changed is ignored.");
break;
}
} catch (const BasePlatformException &err) {
- LogError("download_state_changed_cb: %s", err.getMessage().c_str());
+ LoggerE("download_state_changed_cb: %s", err.getMessage().c_str());
}
delete fnData;
static void download_state_changed_cb(int downloadId, download_state_e state, void *user_data)
{
- LogDebug("download_state_changed_cb, downloadId=%d, state=%d", downloadId, (int)state);
+ LoggerD("download_state_changed_cb, downloadId=%d, state=%d", downloadId, (int)state);
DOWNLOAD_EVENT_DATA_T *data = new DOWNLOAD_EVENT_DATA_T;
data->downloadId = downloadId;
data->state = state;
static void download_progress_cb(int downloadId, unsigned long long received, void *user_data)
{
- LogDebug("download_progress_cb, downloadId=%d, received=%ld", downloadId, received);
+ LoggerD("download_progress_cb, downloadId=%d, received=%ld", downloadId, received);
DOWNLOAD_EVENT_DATA_T *data = new DOWNLOAD_EVENT_DATA_T;
data->downloadId = downloadId;
data->state = DOWNLOAD_STATE_DOWNLOADING;
int ret;
int downloadId = 0;
- LogDebug("entered");
+ LoggerD("entered");
if (!request) {
throw TypeMismatchException("request is NULL.");
std::string networkType = request->getNetworkType();
std::map<std::string, std::string> httpHeader = request->getHttpHeader();
- LogDebug("url <%s>, destination <%s>, fileName <%s>", url.c_str(), destination.c_str(), fileName.c_str());
+ LoggerD("url <%s>, destination <%s>, fileName <%s>", url.c_str(), destination.c_str(), fileName.c_str());
if (url.empty()) {
throw InvalidValuesException("Invalid DownloadRequest.url.");
DeviceAPI::Filesystem::IPathPtr path = DeviceAPI::Filesystem::Utils::fromVirtualPath(NULL, destination);
fullPath = path->getFullPath();
} catch (...) {
- LogWarning("Converting virtual path is failed. [%s]", destination.c_str());
+ LoggerW("Converting virtual path is failed. [%s]", destination.c_str());
fullPath = destination;
}
- LogDebug("Converted FullPath = <%s>", fullPath.c_str());
+ LoggerD("Converted FullPath = <%s>", fullPath.c_str());
ret = download_set_destination(downloadId, fullPath.c_str());
if (ret != DOWNLOAD_ERROR_NONE) {
throw UnknownException(("Platform error while setting destination. " + _get_download_error(ret)).c_str());
throw UnknownException(("Platform error while starting download. " + _get_download_error(ret)).c_str());
}
- LogDebug("downloadId: %d", downloadId);
+ LoggerD("downloadId: %d", downloadId);
setCallbackToMap(downloadId, downloadCallback);
{
int ret;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_cancel(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
{
int ret;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_pause(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
{
int ret;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_start(downloadId);
if (ret != DOWNLOAD_ERROR_NONE) {
download_state_e state;
std::string result;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_get_state(downloadId, &state);
if (ret != DOWNLOAD_ERROR_NONE) {
break;
default:
result = "undefined";
- LogWarning("Unknown DownloadState was returned.");
+ LoggerW("Unknown DownloadState was returned.");
break;
}
char *fieldValue = NULL;
int fieldLength = 0;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_get_url(downloadId, &url);
if (ret != DOWNLOAD_ERROR_NONE) {
for (i = 0; i < fieldLength; i++) {
ret = download_get_http_header_field(downloadId, fieldNames[i], &fieldValue);
if (ret != DOWNLOAD_ERROR_NONE) {
- LogWarning("Platform error while getting http header field. " << _get_download_error(ret));
+ LoggerW("Platform error while getting http header field. " << _get_download_error(ret));
}
httpHeader.insert(make_pair(std::string(fieldNames[i]), std::string(fieldValue)));
free(fieldNames[i]);
try {
virtualPath = DeviceAPI::Filesystem::Utils::toVirtualPath(NULL, destination);
} catch (...) {
- LogWarning("Platform error while converting destination path.");
+ LoggerW("Platform error while converting destination path.");
virtualPath = destination;
}
request->setDestination(virtualPath);
char *mimeType = NULL;
std::string result("");
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_get_mime_type(downloadId, &mimeType);
if (ret != DOWNLOAD_ERROR_NONE) {
{
int ret;
- LogDebug("entered. downloadId = %d", downloadId);
+ LoggerD("entered. downloadId = %d", downloadId);
ret = download_set_state_changed_cb(downloadId, download_state_changed_cb, this);
if (ret != DOWNLOAD_ERROR_NONE) {
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSUtil::toJSValueRef(context, downloadId);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.start().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.setListener().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.cancel().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.pause().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.resume().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSUtil::toJSValueRef(context, ret);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.resume().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return obj;
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.resume().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSUtil::toJSValueRef(context, ret);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in tizen.download.resume().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
#include <Logger.h>
#include <JSUtil.h>
#include <JSWebAPIError.h>
+#include <JSWebAPIErrorFactory.h>
#include <ArgumentValidator.h>
#include "JSDownloadRequest.h"
finalize,
NULL, //hasProperty,
NULL, //getProperty,
- NULL, //setProperty,
+ setProperty, //setProperty,
NULL, //deleteProperty,
NULL, //getPropertyNames,
NULL, //callAsFunction,
void JSDownloadRequest::initialize(JSContextRef context, JSObjectRef object)
{
- if (!JSObjectGetPrivate(object)) {
- DownloadRequest *priv = new DownloadRequest();
- if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- delete priv;
- }
- }
+ if (!JSObjectGetPrivate(object)) {
+ DownloadRequest *priv = new DownloadRequest();
+ if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
+ delete priv;
+ }
+ }
}
void JSDownloadRequest::finalize(JSObjectRef object)
{
- DownloadRequest *priv = static_cast<DownloadRequest*>(JSObjectGetPrivate(object));
- if (priv) {
- JSObjectSetPrivate(object, NULL);
- delete priv;
- }
+ DownloadRequest *priv = static_cast<DownloadRequest*>(JSObjectGetPrivate(object));
+ if (priv) {
+ JSObjectSetPrivate(object, NULL);
+ delete priv;
+ }
+}
+
+bool JSDownloadRequest::setProperty(JSContextRef context, JSObjectRef object,
+ JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
+{
+ if (JSStringIsEqualToUTF8CString(propertyName, "networkType")) {
+ if (JSUtil::JSValueToString(context, value).compare("CELLULAR") &&
+ JSUtil::JSValueToString(context, value).compare("WIFI") &&
+ JSUtil::JSValueToString(context, value).compare("ALL"))
+ {
+ return true;
+ }
+ }
+ return false;
}
JSObjectRef JSDownloadRequest::constructor(JSContextRef context,
const JSValueRef arguments[],
JSValueRef* exception)
{
- ArgumentValidator validator(context, argumentCount, arguments);
+ ArgumentValidator validator(context, argumentCount, arguments);
- JSObjectRef obj = JSObjectMake(context, getClassRef(), NULL);
+ JSObjectRef obj = JSObjectMake(context, getClassRef(), NULL);
- // constructor
+ // constructor
JSStringRef ctorName = JSStringCreateWithUTF8CString("constructor");
JSObjectSetProperty(context, obj, ctorName, constructor,
- kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
+ kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete | kJSPropertyAttributeDontEnum, NULL);
JSStringRelease(ctorName);
- DownloadRequest *priv = new DownloadRequest();
+ DownloadRequest *priv = new DownloadRequest();
- try {
- priv->setUrl(validator.toString(0, true, ""));
- } catch (const BasePlatformException& err) {
- LogWarning("url convertion is failed. %s", err.getMessage().c_str());
- }
+ try {
+ priv->setUrl(validator.toString(0, true, ""));
+ } catch (const BasePlatformException& err) {
+ LoggerW("url convertion is failed. %s", err.getMessage().c_str());
+ }
- try {
- priv->setDestination(validator.toString(1, true, ""));
- } catch (const BasePlatformException& err) {
- LogWarning("destination convertion is failed. %s", err.getMessage().c_str());
- }
+ try {
+ priv->setDestination(validator.toString(1, true, ""));
+ } catch (const BasePlatformException& err) {
+ LoggerW("destination convertion is failed. %s", err.getMessage().c_str());
+ }
- try {
- priv->setFileName(validator.toString(2, true, ""));
- } catch (const BasePlatformException& err) {
- LogWarning("fileName convertion is failed. %s", err.getMessage().c_str());
- }
+ try {
+ priv->setFileName(validator.toString(2, true, ""));
+ } catch (const BasePlatformException& err) {
+ LoggerW("fileName convertion is failed. %s", err.getMessage().c_str());
+ }
- try {
- priv->setNetworkType(validator.toString(3, true, ""));
- } catch (const BasePlatformException& err) {
- LogWarning("networkType convertion is failed. %s", err.getMessage().c_str());
- }
+ try {
+ std::string networkType = validator.toString(3, true, "ALL");
+ if (networkType.compare("CELLULAR") && networkType.compare("WIFI") && networkType.compare("ALL")) {
+ delete priv;
+ TypeMismatchException err("networkType is invalid.");
+ JSObjectRef errObj = JSWebAPIErrorFactory::makeErrorObject(context, err);
+ *exception = errObj;
+ return errObj;
+ }
+ priv->setNetworkType(networkType);
+ } catch (const BasePlatformException& err) {
+ LoggerW("networkType convertion is failed. %s", err.getMessage().c_str());
+ }
- try {
- priv->setHttpHeader(validator.toStringMap(4, true));
- } catch (const BasePlatformException& err) {
- LogWarning("httpHeader convertion is failed. %s", err.getMessage().c_str());
- }
+ try {
+ priv->setHttpHeader(validator.toStringMap(4, true));
+ } catch (const BasePlatformException& err) {
+ LoggerW("httpHeader convertion is failed. %s", err.getMessage().c_str());
+ }
- setPrivateObject(context, obj, priv);
+ setPrivateObject(context, obj, priv);
return obj;
}
DownloadRequest* JSDownloadRequest::getPrivateObject(JSContextRef context, JSObjectRef object)
{
- DownloadRequest *priv = static_cast<DownloadRequest*>(JSObjectGetPrivate(object));
+ DownloadRequest *priv = static_cast<DownloadRequest*>(JSObjectGetPrivate(object));
if (!priv) {
throw TypeMismatchException("DownloadRequest's private object is NULL.");
}
void JSDownloadRequest::setPrivateObject(JSContextRef context, JSObjectRef object, DownloadRequest* priv)
{
- if (!priv) {
- throw TypeMismatchException("DownloadRequest's private object is NULL.");
- }
+ if (!priv) {
+ throw TypeMismatchException("DownloadRequest's private object is NULL.");
+ }
JSObjectSetPrivate(object, static_cast<void*>(priv));
- // url
- JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_URL,
- JSUtil::toJSValueRef(context, priv->getUrl()), kJSPropertyAttributeNone);
+ // url
+ JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_URL,
+ JSUtil::toJSValueRef(context, priv->getUrl()), kJSPropertyAttributeNone);
- // destination
- JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_DESTINATION,
- JSUtil::toJSValueRef(context, priv->getDestination()), kJSPropertyAttributeNone);
+ // destination
+ JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_DESTINATION,
+ JSUtil::toJSValueRef(context, priv->getDestination()), kJSPropertyAttributeNone);
- // fileName
- JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_FILE_NAME,
- JSUtil::toJSValueRef(context, priv->getFileName()), kJSPropertyAttributeNone);
+ // fileName
+ JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_FILE_NAME,
+ JSUtil::toJSValueRef(context, priv->getFileName()), kJSPropertyAttributeNone);
- // networkType
- JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_NETWORK_TYPE,
- JSUtil::toJSValueRef(context, priv->getNetworkType()), kJSPropertyAttributeNone);
+ // networkType
+ JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_NETWORK_TYPE,
+ JSUtil::toJSValueRef(context, priv->getNetworkType()), kJSPropertyAttributeNone);
- // httpHeader
- JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_HTTP_HEADER,
- JSUtil::toJSValueRef(context, priv->getHttpHeader()), kJSPropertyAttributeNone);
+ // httpHeader
+ JSUtil::setProperty(context, object, TIZEN_DOWNLOAD_REQUEST_HTTP_HEADER,
+ JSUtil::toJSValueRef(context, priv->getHttpHeader()), kJSPropertyAttributeNone);
}
} // Download
*/
static void finalize(JSObjectRef object);
- static JSValueRef getProperty(JSContextRef context,
- JSObjectRef object,
- JSStringRef propertyName,
- JSValueRef* exception);
-
static bool setProperty(JSContextRef context,
JSObjectRef object,
JSStringRef propertyName,
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Download] on_widget_start_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Download] on_widget_start_callback (%d)", widgetId);
TIME_TRACER_INIT();
try {
WrtAccessSingleton::Instance().initialize(widgetId);
} catch (...) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Download] on_widget_stop_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Download] on_widget_stop_callback (%d)", widgetId);
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Download");
TIME_TRACER_RELEASE();
try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} catch (...) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Download] on_frame_load_callback (%p)", context);
+ LoggerD("[Tizen\\Download] on_frame_load_callback (%p)", context);
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Download] on_frame_unload_callback (%p)", context);
+ LoggerD("[Tizen\\Download] on_frame_unload_callback (%p)", context);
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
#include "Converter.h"
-#include <dpl/log/log.h>
#include "IManager.h"
#include "IPath.h"
#include "JSFile.h"
#include "Encodings.h"
#include "JSStorage.h"
+#include <Logger.h>
namespace {
const char* PROPERTY_FILEFILTER_NAME = "name";
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "IManager.h"
#include "StorageStaticController.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Filesystem {
virtual void cancelListener()
{
Try {
- LogDebug("Remove change listener");
+ LoggerD("Remove change listener");
IManager::getInstance().removeStorageStateChangeListener(m_watchId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
// limitations under the License.
//
-
#include <map>
#include <string>
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include "Enums.h"
#include <WidgetDB/WidgetDBMgr.h>
#include <iconv.h>
#include "FilesystemUtils.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
IPathPtr fromVirtualPath(JSContextRef context,
const std::string& arg)
{
- LogDebug("arg:[" << arg << "]");
+ LoggerD("arg:[" << arg << "]");
// uri path, strip file://
if (isUriPath(arg)) {
std::string stripPath = arg.substr(strlen("file://"));
- LogDebug("uri absolute path" << stripPath);
+ LoggerD("uri absolute path" << stripPath);
IPathPtr result = IPath::create(stripPath);
return result;
}
if (!isPathValid(arg)) {
- LogDebug("virtual path is invalid:[" << arg << "]");
+ LoggerD("virtual path is invalid:[" << arg << "]");
ThrowMsg(Commons::ConversionException, "Not found path component.");
}
if (it == rootToPath.end()) {
//ThrowMsg(Commons::NotFoundException, "Location not found.");
- LogDebug("Allow non virtual root path " << arg);
+ LoggerD("Allow non virtual root path " << arg);
return IPath::create(arg);
}
}
path.erase(pos, path.size());
}
- LogDebug("Allow non virtual root path");
+ LoggerD("Allow non virtual root path");
return arg;
// ThrowMsg(Commons::ConversionException, "Path doesn't contain a valid location type.");
size_t outputLength= 0;
try {
-// LogDebug("from " << fromEncodingSet << " to UTF8 conversion " << fromLength);
+// LoggerD("from " << fromEncodingSet << " to UTF8 conversion " << fromLength);
cd = iconv_open("UTF-8", fromEncodingSet);
if (cd == (iconv_t) -1)
{
- LogDebug("charset conversion exception iconv -1");
+ LoggerD("charset conversion exception iconv -1");
ThrowMsg(Commons::PlatformException, "charset conversion exception");
}
if (fromLength == 0)
{
- LogDebug("from length 0");
+ LoggerD("from length 0");
ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
}
ret = iconv(cd, (char**)&from, (size_t*)&fromLength, &buf, &outputLength);
- LogDebug(fromLength << " " << outputLength);
+ LoggerD(fromLength << " " << outputLength);
if (ret < 0)
{
iconv_close(cd);
- LogDebug("charset conversion exception ret " << ret);
+ LoggerD("charset conversion exception ret " << ret);
ThrowMsg(Commons::PlatformException, "charset conversion exception");
}
}
Catch(std::bad_alloc) {
- LogDebug("Couldn't allocate output buffer.");
+ LoggerD("Couldn't allocate output buffer.");
ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
}
}
#include <string>
#include <ctime>
-#include <dpl/log/log.h>
#include <Commons/FunctionDeclaration.h>
#include <Commons/Exception.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include <SecurityExceptions.h>
+#include <ArgumentValidator.h>
+#include <JSWebAPIError.h>
+#include <JSWebAPIException.h>
+#include <JSUtil.h>
+
#include <TimeTracer.h>
#include "FilesystemUtils.h"
#include "Converter.h"
#include "JSFilestream.h"
#include "ResponseDispatcher.h"
#include "FilesystemAsyncCallbackManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
PrivateObject* privateObject =
static_cast<PrivateObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch error");
}
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
/*
else if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_READ_ONLY)) {
return converter.toJSValueRef(children.size());
}
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}*/
return JSValueMakeUndefined(context);
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
PrivateObject* privateObject = static_cast<PrivateObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch error");
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch error");
}
- LogDebug("OK");
+ LoggerD("OK");
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(0, false);
+ validator.toFunction(1, true);
+ validator.toObject(2, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
JSContextRef globalContext = privateObject->getContext();
size_t index = 0;
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch error");
}
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argumentCount, arguments);
+ validator.toFunction(1, false);
+ validator.toFunction(2, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
JSContextRef globalContext = privateObject->getContext();
JSCallbackManagerPtr cbm = JSCallbackManager::createObject(globalContext);
}
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(0, false);
+ validator.toFunction(1, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
JSContextRef globalContext = privateObject->getContext();
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_READ_AS_TEXT);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_COPY_TO);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(3, true);
+ validator.toFunction(4, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
try {
JSContextRef globalContext = privateObject->getContext();
- LogDebug("OK");
+ LoggerD("OK");
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(3, true);
+ validator.toFunction(4, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
size_t index = 0;
JSValueRef reserveArguments[5];
Converter converter(context);
-
-
-
try {
-
-
-
if (argc < 1) {
ThrowMsg(InvalidArgumentException, "Invalid path name");
}
-
-
-
IPathPtr path = converter.toPath(argv[0]);
INodePtr node = privateObject->getObject()->getNode()->getChild(path);
node->setPermissions(privateObject->getObject()->getNode()->getPermissions());
JSContextRef globalContext = privateObject->getContext();
- LogDebug("OK");
+ LoggerD("OK");
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(2, true);
+ validator.toFunction(3, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
size_t index = 0;
JSValueRef reserveArguments[4];
JSCallbackManagerPtr cbm = JSCallbackManager::createObject(globalContext);
-
-
-
try {
for (index = 0; index < 4; index++) {
if (index < argc)
if (!eventResolve->getResult() || (eventResolve->getExceptionCode() != WrtDeviceApis::Commons::ExceptionCodes::None)) {
if(eventResolve->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException)
- ThrowMsg(NotFoundException, "Not found error");
+ ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Not found error");
else
ThrowMsg(PlatformException, "IO Error");
}
const JSValueRef argv[],
JSValueRef* exception)
{
- LogDebug("<<<");
+ LoggerD("<<<");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
PrivateObject* privateObject = static_cast<PrivateObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type mismatch error");
}
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(1, true);
+ validator.toFunction(2, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
JSContextRef globalContext = privateObject->getContext();
if (!eventResolve->getResult() ||(eventResolve->getExceptionCode() != WrtDeviceApis::Commons::ExceptionCodes::None)) {
if(eventResolve->getExceptionCode() == WrtDeviceApis::Commons::ExceptionCodes::NotFoundException){
- LogDebug("POST IO NOT_FOUND_ERROR");
- ThrowMsg(NotFoundException, "Not found error");
+ LoggerD("POST IO NOT_FOUND_ERROR");
+ ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Not found error");
+
}
- LogDebug("POST IO ERROR");
+ LoggerD("POST IO ERROR");
cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::IO_ERROR, "IO error"));
return JSValueMakeUndefined(context);
}
ThrowMsg(InvalidArgumentException, "Invalid directory");
}
- LogDebug("try to call async event");
+ LoggerD("try to call async event");
EventRemovePtr eventRemove(new EventRemove(path));
eventRemove->setForAsynchronousCall(&ResponseDispatcher::getInstance());
eventRemove->setPrivateData(DPL::StaticPointerCast<WrtDeviceApis::Commons::IEventPrivateData > (cbm));
}
} catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogDebug("Platform Exception !!!!!!!! post io error");
+ LoggerD("Platform Exception !!!!!!!! post io error");
cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::IO_ERROR, ex.GetMessage()));
} catch(const WrtDeviceApis::Commons::ConversionException& ex) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, ex.GetMessage());
cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, ex.GetMessage()));
}
- LogDebug(">>>");
+ LoggerD(">>>");
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
}
#include "JSFilestream.h"
#include <dpl/scoped_array.h>
-#include <dpl/log/log.h>
#include <Commons/Base64.h>
#include <CommonsJavaScript/JSUtils.h>
#include "Encodings.h"
#include "plugin_config.h"
#include "FilesystemUtils.h"
+#include <Logger.h>
namespace {
const char* PLUGIN_NAME = "FileStream";
return converter.toJSValueRef(static_cast<unsigned long long>(bytes));
}
} catch (const WrtDeviceApis::Commons::ConversionException& ex) {
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
return true;
}
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogWarning("trying to set incorrect value");
+ LoggerW("trying to set incorrect value");
}
return false;
Converter converter(context);
try {
- LogDebug("OK");
+ LoggerD("OK");
JSValueRef undefinedValue = JSValueMakeUndefined(context);
std::string base64;
#include "JSFilesystemManager.h"
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include "EventResolve.h"
#include "IManager.h"
#include <WidgetDB/WidgetDBMgr.h>
#include <WidgetDB/IWidgetDB.h>
#include <TimeTracer.h>
-
+#include <ArgumentValidator.h>
+#include <JSWebAPIError.h>
+#include <JSWebAPIException.h>
+#include <JSUtil.h>
#include "JSFile.h"
#include "FilesystemUtils.h"
#include "Converter.h"
#include "ResponseDispatcher.h"
#include "FilesystemAsyncCallbackManager.h"
#include "FilesystemListenerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis;
+
namespace {
const char* PLUGIN_NAME = "FileSystemManager";
const char* PROPERTY_MAXPATHLENGTH = "maxPathLength";
{
if (Validator(ctx).isCallback(arg)) {
return arg;
- } else if (!JSValueIsNull(ctx, arg) && !JSValueIsUndefined(ctx, arg)) {
+ } else if (!JSValueIsNull(ctx, arg) && !JSValueIsUndefined(ctx, arg)) {
ThrowMsg(ConversionException, "Not a function nor JS null.");
}
return NULL;
int widgetId = WrtAccessSingleton::Instance().getWidgetId();
WidgetDB::Api::IWidgetDBPtr widgetDB = WidgetDB::Api::getWidgetDB(widgetId);
- LogDebug(widgetDB->getWidgetInstallationPath());
+ LoggerD(widgetDB->getWidgetInstallationPath());
std::string wgtpackage = "wgt-package";
std::string wgtprivate = "wgt-private";
std::string wgtprivatetemp = "wgt-private-tmp";
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_GET_STORAGE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toString(0, false);
+ validator.toFunction(1, false);
+ validator.toFunction(2, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
if (argc < 2) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
+
+
+
JSContextRef globalContext = privateObject->getContext();
ConverterPtr converter = ConverterFactory::getConverter(globalContext);
JSCallbackManagerPtr cbm = JSCallbackManager::createObject(globalContext);
-
+
try {
JSValueRef onSuccess = getFunction(globalContext, argv[1]);
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_LIST_STORAGE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(0, false);
+ validator.toFunction(1, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
if (argc < 1) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
+
JSContextRef globalContext = privateObject->getContext();
ConverterPtr converter = ConverterFactory::getConverter(globalContext);
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_ADD_STORAGE_LISTENER);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toFunction(0, false);
+ validator.toFunction(1, true);
+ }
+ catch (const BasePlatformException &err) {
+ LogDebug("Exception");
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
+
if (argc < 1) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "TYPE_MISMATCH_ERROR");
}
-
JSContextRef globalContext = privateObject->getContext();
JSCallbackManagerPtr cbm = JSCallbackManager::createObject(globalContext);
ConverterPtr converter = ConverterFactory::getConverter(globalContext);
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_REMOVE_STORAGE_LISTENER);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ LogDebug("a");
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toLong(0, false);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
+
if (argc < 1) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
+
JSContextRef globalContext = privateObject->getContext();
ConverterPtr converter = ConverterFactory::getConverter(globalContext);
try {
long id = static_cast<long>(converter->toLong(argv[0]));
- LogDebug("id:" << id);
+ LoggerD("id:" << id);
if (id >= 0) {
JSValueRef* exception)
{
- LogDebug("<<<");
+ LoggerD("<<<");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
PrivateObject* privateObject = static_cast<PrivateObject*>(JSObjectGetPrivate(thisObject));
AceSecurityStatus status = FILESYSTEM_CHECK_ACCESS(FILESYSTEM_FUNCTION_API_MGR_RESOLVE_ID);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+
+ // argument validation with new validator
+ try {
+ ArgumentValidator validator(context, argc, argv);
+ validator.toString(0, false);
+ validator.toFunction(1, false);
+ validator.toFunction(2, true);
+ validator.toString(3, true);
+ }
+ catch (const BasePlatformException &err) {
+ return JSWebAPIException::throwException(context, exception, err);
+ } catch (...) {
+ DeviceAPI::Common::UnknownException err("");
+ return JSWebAPIException::throwException(context, exception, err);
+ }
if (argc < 2) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
+ LogDebug("resolve");
+
+
+
+
JSContextRef globalContext = privateObject->getContext();
ConverterPtr converter = ConverterFactory::getConverter(globalContext);
size_t index = 0;
- JSValueRef reserveArguments[4];
JSCallbackManagerPtr cbm = JSCallbackManager::createObject(globalContext);
-
-
-
+ JSValueRef reserveArguments[4];
try {
for (index = 0; index < 4; index++) {
if (index < argc)
reserveArguments[index] = argv[index];
else
- reserveArguments[index] = JSValueMakeUndefined(context);
+ reserveArguments[index] = JSValueMakeUndefined(context);
}
+
JSValueRef onSuccess = getFunction(globalContext, reserveArguments[1]);
JSValueRef onError = NULL;
std::string virtualPath;
path = Utils::fromVirtualPath(globalContext, converter->toString(reserveArguments[0]));
virtualPath = converter->toString(reserveArguments[0]);
- LogDebug("virtualPath:[" << virtualPath << "]");
+ LoggerD("virtualPath:[" << virtualPath << "]");
int permissions = PERM_READ | PERM_WRITE;
if (argc > 3) {
std::string perms = converter->toString(reserveArguments[3]);
- LogDebug("perms:[" << perms << "]");
+ LoggerD("perms:[" << perms << "]");
if (("r" != perms) && ("rw" != perms) && ("w" != perms) && ("a" != perms)) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Invalid permission");
} else if ("r" == perms) {
#include <cassert>
#include <memory>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
//#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "StorageProperties.h"
#include "JSStorage.h"
#include "Converter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Filesystem {
return convert.toJSValueRef(STATE_UNMOUNTABLE);
}*/
} Catch(Commons::Exception) {
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
#include <ctime>
#include <sstream>
#include <dirent.h>
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <Commons/Exception.h>
#include "Node.h"
#include "Utils.h"
#include <app.h>
+#include <Logger.h>
namespace {
const char* PATH_DOWNLOADS = "/opt/usr/media/Downloads";
snprintf(buf, size, "removable%d", storage);
lable.append(buf);
}
- LogDebug(lable << "state" << state);
+ LoggerD(lable << "state" << state);
storageItem->setId(storage);
storageItem->setLabel(lable);
void Manager::copyElement(
const std::string &src, const std::string &dest, bool recursive) const
{
- LogDebug("Copying src: " << src << " to: " << dest);
+ LoggerD("Copying src: " << src << " to: " << dest);
//element is a file:
if (EINA_TRUE != ecore_file_is_dir(src.c_str())) {
}
//element is a directory -> create it:
if (EINA_TRUE != ecore_file_mkdir(dest.c_str())) {
- LogDebug("Failed to create destination directory");
+ LoggerD("Failed to create destination directory");
ThrowMsg(Commons::PlatformException, "Failed to copy directory");
}
//copy all elements of directory:
{
free(data);
}
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
ReThrowMsg(Commons::PlatformException, "Failed to copy element");
}
free(data);
}
if (found == false) {
-// LogDebug("no exist" << id);
+// LoggerD("no exist" << id);
ThrowMsg(Commons::NotFoundException, "The " << id << "is not exist");
}
}
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
}
{
Try {
INodePtr srcNode = Node::resolve(event->getSource());
- LogDebug(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_READ);
+ LoggerD(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_READ);
if ((srcNode->getMode() & PM_USER_READ/*PERM_READ*/) == 0) {
ThrowMsg(Commons::SecurityException,
"Not enough permissions to read source node.");
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
}
//Destination is not exist. Start copy now.
- LogDebug(dest->getFullPath().c_str());
+ LoggerD(dest->getFullPath().c_str());
copyElement(realSrc, realDest);
event->setResult(Node::resolve(dest));
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
//file is copied already so we don't allow cancelling anymore.
IPathPtr dest = event->getDestination();
INodePtr srcNode = Node::resolve(src);
- LogDebug(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_WRITE);
+ LoggerD(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_WRITE);
if ((srcNode->getMode() & PM_USER_WRITE/*PERM_WRITE*/) == 0)
{
ThrowMsg(Commons::SecurityException,
}
Catch(Commons::Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
ReThrowMsg(Commons::PlatformException,
"Could not get destination's parent node.");
}
"No access to platform destination node.");
}
- LogDebug(dest->getFullPath().c_str());
+ LoggerD(dest->getFullPath().c_str());
if (S_ISDIR(info.st_mode) && srcNode->getType() == NT_FILE) {
dest->append("/" + src->getName());
errno = 0;
- LogDebug(dest->getFullPath().c_str());
+ LoggerD(dest->getFullPath().c_str());
if (0 != ::rename(src->getFullPath().c_str(), dest->getFullPath().c_str()))
{
{
case EXDEV:
{
- LogDebug(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_READ);
+ LoggerD(std::hex << srcNode->getMode() << " " << std::hex << PM_USER_READ);
if ((srcNode->getMode() & PM_USER_READ /*PERM_READ*/) == 0)
{
ThrowMsg(Commons::SecurityException,
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
- LogError("Exception while removing dest directory");
+ LoggerE("Exception while removing dest directory");
}
}
node->remove(event->getOptions());
}
Catch(Commons::Exception) {
- LogError("Exception: "
+ LoggerE("Exception: "
<< _rethrown_exception.GetMessage());
}
break;
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
}
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
event->setCancelAllowed(false);
event->setResult(result);
}
catch (const Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
}
event->setCancelAllowed(true);
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
return;
}
}
#include "Enums.h"
#include "Manager.h"
#include "NodeFilterMatcher.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
struct stat syminfo;
if (lstat(path->getFullPath().c_str(), &info) != 0) {
- LogError("File: " << path->getFullPath().c_str() << " error no" <<errno);
+ LoggerE("File: " << path->getFullPath().c_str() << " error no" <<errno);
switch (errno)
{
syminfo = stat(path);
type = S_ISDIR(syminfo.st_mode) ? NT_DIRECTORY : NT_FILE;
- LogDebug(type);
+ LoggerD(type);
}
NodePtr result(new Node(path, type));
void Node::getChildNodes(const EventListNodesPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
EventRequestReceiver<EventListNodes>::PostRequest(event);
}
void Node::open(const EventOpenPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
EventRequestReceiver<EventOpen>::PostRequest(event);
}
void Node::read(const EventReadTextPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
EventRequestReceiver<EventReadText>::PostRequest(event);
}
if (::stat(path->getFullPath().c_str(),
&result) != 0)
{
- LogError("File: " << path->getFullPath().c_str());
+ LoggerE("File: " << path->getFullPath().c_str());
ThrowMsg(Commons::PlatformException, "Node does not exist or no access");
}
return result;
Node* Node::createAsFile(const IPathPtr& path,
int /* options */)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
createAsFileInternal(path);
return new Node(path, NT_FILE);
}
void Node::createAsFileInternal(const IPathPtr& path)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
FILE* file = std::fopen(path->getFullPath().c_str(), "wb");
if (!file) {
ThrowMsg(Commons::PlatformException,
if (recursive) {
DIR* dir = opendir(path->getFullPath().c_str());
if (!dir) {
- LogError("File: " << path->getFullPath().c_str());
+ LoggerE("File: " << path->getFullPath().c_str());
ThrowMsg(Commons::PlatformException,
"Node does not exist or access denied.");
}
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
//event can be cancelled before executing this code.
{
Try {
event->setResult(readText());
- LogDebug("LEAVIN GRACEFULLY");
+ LoggerD("LEAVIN GRACEFULLY");
}
catch (const Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setExceptionCode(ex.getCode());
}
//this function doesn't change state of the platform,
// limitations under the License.
//
-
-#include <memory>
+ #include <memory>
#include <algorithm>
#include <iterator>
#include <stdlib.h>
#include <limits.h>
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include <Commons/StringUtils.h>
#include "Path.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void Path::reset(const std::string& str)
{
if (!isValid(str)) {
- LogDebug(str << "empty string");
+ LoggerD(str << "empty string");
ThrowMsg(Commons::NotFoundException,
"Not a valid path: " + str + ".");
}
// limitations under the License.
//
-
#include "PathUtils.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
+
namespace DeviceAPI {
namespace Filesystem {
namespace PathUtils {
#include "ResponseDispatcher.h"
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include "FilesystemAsyncCallbackManager.h"
#include "Encodings.h"
#include "FilesystemUtils.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void ResponseDispatcher::OnAnswerReceived(const EventResolvePtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
EventGetNodeDataPtr data =
DPL::DynamicPointerCast<EventGetNodeData>(event->getPrivateData());
Assert(NULL != data);
void ResponseDispatcher::OnAnswerReceived(const EventListNodesPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
JSFile::ListFilesPrivateDataPtr privData =
DPL::DynamicPointerCast<JSFile::ListFilesPrivateData>(event->getPrivateData());
void ResponseDispatcher::OnAnswerReceived(const EventOpenPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
Assert(NULL != data);
void ResponseDispatcher::OnAnswerReceived(const EventCopyPtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
Assert(NULL != data);
void ResponseDispatcher::OnAnswerReceived(const EventMovePtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
Assert(NULL != data);
void ResponseDispatcher::OnAnswerReceived(const EventRemovePtr& event)
{
- LogDebug("--| ENTER");
+ LoggerD("--| ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
Assert(NULL != data);
void ResponseDispatcher::OnAnswerReceived(const EventReadTextPtr& event)
{
- LogDebug("--| ENTER");
+ LoggerD("--| ENTER");
DPL::SharedPtr<JSCallbackManager> data =
DPL::DynamicPointerCast<JSCallbackManager>(event->getPrivateData());
Assert(NULL != data);
// limitations under the License.
//
-
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "StorageStaticController.h"
#include "JSStorage.h"
#include "Converter.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
JSValueRef result = converter.toJSValueRef(event->getResult(), context);
callbackManager->callOnSuccess(result);
} catch(Commons::ConversionException) {
- LogError("Conversion exception while processing EventStorageStateChanged");
+ LoggerE("Conversion exception while processing EventStorageStateChanged");
}
}
#include <Commons/Exception.h>
#include "Manager.h"
#include "Node.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
checkForWriting();
if (!(m_stream << arg)) {
- LogError("Error while writing to the stream.");
+ LoggerE("Error while writing to the stream.");
ThrowMsg(Commons::PlatformException,
"Error while writing to the stream.");
}
void Stream::checkForWriting() const
{
if (!isOpen()) {
- LogError("Stream is closed.");
+ LoggerE("Stream is closed.");
ThrowMsg(Commons::PlatformException, "Stream is closed.");
}
if (!isWriteable()) {
- LogError("Stream is not writeable.");
+ LoggerE("Stream is not writeable.");
ThrowMsg(Commons::PlatformException, "Stream is not writeable.");
}
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/plugin_initializer_def.h>
#include <TimeTracer.h>
#include "JSFilestream.h"
#include "FilesystemAsyncCallbackManager.h"
#include "FilesystemListenerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch (Commons::Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch (Commons::Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\filesystem] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\filesystem] on_frame_unload_callback (" << context << ")");
DeviceAPI::Filesystem::FilesystemAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::Filesystem::FilesystemListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\filesystem] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\filesystem] on_frame_load_callback (" << context << ")");
}
PLUGIN_ON_WIDGET_START(on_widget_start_callback)
)
include_directories(
+ ${INCLUDE_COMMON}
${INCLUDES_PLATFORM_IMPLEMENTATION_HAPTICS}
${INCLUDES_PLATFORM_IMPLEMENTATION_POWER}
)
* limitations under the License.
*/
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include "JSTizenLog.h"
+#include <Logger.h>
#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
void on_widget_start_callback(int widgetId)
{
- LogDebug("[TizenLog] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[TizenLog] on_widget_start_callback ("<<widgetId<<")");
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[TizenLog] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[TizenLog] on_widget_stop_callback ("<<widgetId<<")");
}
PLUGIN_ON_WIDGET_START(on_widget_start_callback)
*/
#include "ILocalMessagePort.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
#ifndef _API_MESSAGE_PORT_ILOCAL_MESSAGE_PORT_H_
#define _API_MESSAGE_PORT_ILOCAL_MESSAGE_PORT_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include "EventLocalMessagePortAddMessagePortListener.h"
*/
#include "IRemoteMessagePort.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
#ifndef _API_MESSAGE_PORT_IREMOTE_MESSAGE_PORT_H_
#define _API_MESSAGE_PORT_IREMOTE_MESSAGE_PORT_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include "EventRemoteMessagePortSendMessage.h"
*/
#include "JSLocalMessagePort.h"
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "EventLocalMessagePortRemoveMessagePortListener.h"
#include "MessagePortListenerManager.h"
#include "MessagePortJSUtil.h"
+#include <Logger.h>
#define TIZEN_LOCAL_MESSAGE_PORT "LocalMessagePort"
const JSClassRef JSLocalMessagePort::getClassRef()
{
- LogInfo("entered");
+ LoggerI("entered");
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
LocalMessagePortPtr localMessagePort;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Plugin's internal error"));
}
}
catch(BasePlatformException &e)
{
- LogError("Error on conversion : " << e.getMessage());
+ LoggerE("Error on conversion : " << e.getMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
LocalMessagePortPtr localMessagePort;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
*/
#include "JSMessagePortManager.h"
-
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/Validator.h>
#include <JSWebAPIException.h>
#include "JSLocalMessagePort.h"
#include "JSRemoteMessagePort.h"
#include "MessagePortJSUtil.h"
+#include <Logger.h>
#define CLASS_NAME "MessagePortManager"
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MessagePortManagerPtr messagePortManager;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Plugin's internal error"));
}
}
catch(BasePlatformException &e)
{
- LogError("Error on conversion : " << e.getMessage());
+ LoggerE("Error on conversion : " << e.getMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MessagePortManagerPtr messagePortManager;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Plugin's internal error"));
}
}
catch(BasePlatformException &e)
{
- LogError("Error on conversion : " << e.getMessage());
+ LoggerE("Error on conversion : " << e.getMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MessagePortManagerPtr messagePortManager;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Plugin's internal error"));
}
}
catch(BasePlatformException &e)
{
- LogError("Error on conversion : " << e.getMessage());
+ LoggerE("Error on conversion : " << e.getMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
MessagePortManagerPtr messagePortManager;
JSContextRef gContext;
}
catch(BasePlatformException &e)
{
- LogError("No private object");
+ LoggerE("No private object");
return JSWebAPIException::throwException(context, exception, e);
}
}
Catch(Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Plugin's internal error"));
}
}
catch(BasePlatformException &e)
{
- LogError("Error on conversion : " << e.getMessage());
+ LoggerE("Error on conversion : " << e.getMessage());
return JSWebAPIException::throwException(context, exception,
UnknownException("Internal error"));
}
*/
#include "JSRemoteMessagePort.h"
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "EventRemoteMessagePortSendMessage.h"
#include "JSLocalMessagePort.h"
#include "MessagePortJSUtil.h"
+#include <Logger.h>
#define TIZEN_REMOTE_MESSAGE_PORT "RemoteMessagePort"
const JSClassRef JSRemoteMessagePort::getClassRef()
{
- LogInfo("entered");
+ LoggerI("entered");
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value");
+ LoggerW("trying to get incorrect value");
}
return JSValueMakeUndefined(context);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
RemoteMessagePortPtr remoteMessagePort(NULL);
#include "MessagePortManagerProxy.h"
#include "MessagePortUtility.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
void LocalMessagePort::OnRequestReceived(const EventLocalMessagePortAddMessagePortListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void LocalMessagePort::OnRequestReceived(const EventLocalMessagePortRemoveMessagePortListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(NotFoundException)
{
- LogError("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
#include <map>
#include <string>
-#include <dpl/log/log.h>
#include <Commons/Emitters.h>
#include "ILocalMessagePort.h"
*/
#include "LocalMessagePortController.h"
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "MessagePortDataItem.h"
#include "MessagePortJSUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
EventLocalMessagePortListenerListener(ThreadEnum::NULL_THREAD),
LocalMessagePortPrivObject(context, localMessagePort)
{
- LogDebug("LocalMessagePortController constructed : " << this);
+ LoggerD("LocalMessagePortController constructed : " << this);
if (!localMessagePort) {
- LogWarning("controller has no localMessagePort object");
+ LoggerW("controller has no localMessagePort object");
}
}
LocalMessagePortController::~LocalMessagePortController()
{
- LogDebug("LocalMessagePortController destructed : " << this);
+ LoggerD("LocalMessagePortController destructed : " << this);
}
void LocalMessagePortAsyncAnswerHandler::localMessagePortListener(const EventLocalMessagePortListenerPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSValueRef result[2];
JSCallbackManagerPtr cbm = DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm)
{
- LogError("no callback manager");
+ LoggerE("no callback manager");
return;
}
if(!event->getDataIsSet())
{
- LogError("No data items");
+ LoggerE("No data items");
return;
}
}
catch(BasePlatformException &e)
{
- LogError("Fail to convert MessagePortDataItemMap");
+ LoggerE("Fail to convert MessagePortDataItemMap");
return;
}
}
catch(BasePlatformException &e)
{
- LogError("Fail to convert RemoteMessagePort");
+ LoggerE("Fail to convert RemoteMessagePort");
return;
}
{
if(event == NULL)
{
- LogError("wrong event");
+ LoggerE("wrong event");
return;
}
#ifndef _TIZEN_MESSAGE_PORT_LOCAL_MESSAGE_PORT_CONTROLLER_H_
#define _TIZEN_MESSAGE_PORT_LOCAL_MESSAGE_PORT_CONTROLLER_H_
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <Commons/EventReceiver.h>
#include <Commons/EventListener.h>
#include "JSLocalMessagePort.h"
#include "JSRemoteMessagePort.h"
+#include <Logger.h>
#define MESSAGE_PORT_ATTRIBUTE_KEY "key"
#define MESSAGE_PORT_ATTRIBUTE_VALUE "value"
if(!JSValueIsObject(context, element))
{
- LogWarning("element is not object (" << i << ")");
+ LoggerW("element is not object (" << i << ")");
continue;
}
}
catch(BasePlatformException &e)
{
- LogWarning("key is not string");
+ LoggerW("key is not string");
continue;
}
}
catch(BasePlatformException &e)
{
- LogWarning("value is not string");
+ LoggerW("value is not string");
continue;
}
{
if(!JSLocalMessagePort::isObjectOfClass(context, jsValue))
{
- LogError("Not a LocalMessagePort object");
+ LoggerE("Not a LocalMessagePort object");
throw TypeMismatchException("value is not a LocalMessagePort object");
}
{
if(!JSRemoteMessagePort::isObjectOfClass(context, jsValue))
{
- LogError("Not a RemoteMessagePort object");
+ LoggerE("Not a RemoteMessagePort object");
throw TypeMismatchException("value is not a RemoteMessagePort object");
}
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "LocalMessagePortController.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
controller = static_cast<LocalMessagePortController*>(JSObjectGetPrivate(m_object));
if (!controller) {
- LogWarning("Object has no controller");
+ LoggerW("Object has no controller");
return;
}
localMessagePort = controller->getObject();
Try
{
- LogDebug("Remove change listener");
+ LoggerD("Remove change listener");
localMessagePort->removeMessagePortListener(dplEvent);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
*/
#include "MessagePortManager.h"
-
#include "MessagePortManagerProxy.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
void MessagePortManager::OnRequestReceived(const EventMessagePortManagerRequestLocalMessagePortPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void MessagePortManager::OnRequestReceived(const EventMessagePortManagerRequestTrustedLocalMessagePortPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void MessagePortManager::OnRequestReceived(const EventMessagePortManagerRequestRemoteMessagePortPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(NotFoundException)
{
- LogError("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
void MessagePortManager::OnRequestReceived(const EventMessagePortManagerRequestTrustedRemoteMessagePortPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
}
Catch(InvalidArgumentException)
{
- LogError("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [InvalidArgumentException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::InvalidArgumentException);
event->setResult(false);
}
Catch(NotFoundException)
{
- LogError("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [NotFoundException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::NotFoundException);
event->setResult(false);
}
Catch(PlatformWrongStateException)
{
- LogError("Error [PlatformWrongStateException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformWrongStateException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformWrongStateException);
event->setResult(false);
}
Catch(PlatformException)
{
- LogError("Error [PlatformException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [PlatformException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::PlatformException);
event->setResult(false);
}
Catch(Exception)
{
- LogError("Error [UnknownException] : " << _rethrown_exception.GetMessage());
+ LoggerE("Error [UnknownException] : " << _rethrown_exception.GetMessage());
event->setExceptionCode(ExceptionCodes::UnknownException);
event->setResult(false);
}
#include "LocalMessagePort.h"
#include "RemoteMessagePort.h"
#include "MessagePortUtility.h"
+#include <Logger.h>
IMPLEMENT_SINGLETON(DeviceAPI::MessagePort::MessagePortManagerProxy)
LocalMessagePortPtr MessagePortManagerProxy::requestLocalMessagePort(string &messagePortName)
{
- LogDebug("request local (name : " << messagePortName << ")");
+ LoggerD("request local (name : " << messagePortName << ")");
return getLocalMessagePort(messagePortName, false);
}
LocalMessagePortPtr MessagePortManagerProxy::requestTrustedLocalMessagePort(string &messagePortName)
{
- LogDebug("request trusted local (name : " << messagePortName << ")");
+ LoggerD("request trusted local (name : " << messagePortName << ")");
return getLocalMessagePort(messagePortName, true);
}
RemoteMessagePortPtr MessagePortManagerProxy::requestRemoteMessagePort(string &appId, string &messagePortName)
{
- LogDebug("request remote (appId : " << appId << " / name : " << messagePortName << ")");
+ LoggerD("request remote (appId : " << appId << " / name : " << messagePortName << ")");
return getRemoteMessagePort(appId, messagePortName, false);
}
RemoteMessagePortPtr MessagePortManagerProxy::requestTrustedRemoteMessagePort(string &appId, string &messagePortName)
{
- LogDebug("request trusted remote (appId : " << appId << " / name : " << messagePortName << ")");
+ LoggerD("request trusted remote (appId : " << appId << " / name : " << messagePortName << ")");
return getRemoteMessagePort(appId, messagePortName, true);
}
LocalMessagePortPtr MessagePortManagerProxy::getLocalMessagePort(string &name, bool isTrusted)
{
- LogDebug("getLocalMessagePort (name:" << name << ", isTrusted:" << isTrusted << ")");
+ LoggerD("getLocalMessagePort (name:" << name << ", isTrusted:" << isTrusted << ")");
LocalMessagePortPtr localMessagePort = getCachedLocalMessagePort(name, isTrusted);
if(localMessagePort == NULL)
RemoteMessagePortPtr MessagePortManagerProxy::getRemoteMessagePort(string &appId, string &name, bool isTrusted)
{
- LogDebug("getRemoteMessagePort (appId:" << appId << ", name:" << name << ", isTrusted:" << isTrusted << ")");
+ LoggerD("getRemoteMessagePort (appId:" << appId << ", name:" << name << ", isTrusted:" << isTrusted << ")");
RemoteMessagePortPtr remoteMessagePort = getCachedRemoteMessagePort(appId, name, isTrusted);
if(iter != m_localMessagePortMap.end())
{
localMessagePort = iter->second;
- LogDebug("Found cached LocalMessagePort");
+ LoggerD("Found cached LocalMessagePort");
}
return localMessagePort;
if(iter != m_localMessagePortIdMap.end())
{
localMessagePort = iter->second;
- LogDebug("Found cached LocalMessagePort");
+ LoggerD("Found cached LocalMessagePort");
}
return localMessagePort;
if(iter != m_remoteMessagePortMap.end())
{
remoteMessagePort = iter->second;
- LogDebug("Found cached RemoteMessagePort");
+ LoggerD("Found cached RemoteMessagePort");
}
return remoteMessagePort;
void MessagePortManagerProxy::messagePortMessageCb(int id, const char* remote_app_id,
const char* remote_port, bool trusted_message, bundle* data)
{
- LogDebug("received message : (id:" << id << ", remote_appId : " << remote_app_id <<
+ LoggerD("received message : (id:" << id << ", remote_appId : " << remote_app_id <<
", remote_port:" << remote_port << ", trusted:" << trusted_message << ")");
LocalMessagePortPtr localMessagePort = getCachedLocalMessagePort(id);
if(localMessagePort == NULL)
{
- LogWarning("There is no local message port id : " << id);
+ LoggerW("There is no local message port id : " << id);
return;
}
}
Catch(Exception)
{
- LogError("Error on getRemoteMessagePort : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on getRemoteMessagePort : " << _rethrown_exception.GetMessage());
}
}
#include <clocale>
#include <sstream>
#include <dpl/singleton_impl.h>
-#include <dpl/log/log.h>
#include <Commons/Regex.h>
+#include <Logger.h>
IMPLEMENT_SINGLETON(DeviceAPI::MessagePort::MessagePortUtility)
{
if(type != BUNDLE_TYPE_STR)
{
- LogWarning("bundle has wrong data type. (type : " << type << ")");
+ LoggerW("bundle has wrong data type. (type : " << type << ")");
return;
}
#include "RemoteMessagePort.h"
#include "LocalMessagePort.h"
#include "MessagePortManagerProxy.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
void RemoteMessagePort::OnRequestReceived(const EventRemoteMessagePortSendMessagePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
#ifndef _PLATFORM_MESSAGE_PORT_REMOTE_MESSAGE_PORT_H_
#define _PLATFORM_MESSAGE_PORT_REMOTE_MESSAGE_PORT_H_
-#include <dpl/log/log.h>
#include <string>
#include "IRemoteMessagePort.h"
* @brief
*/
-#include <dpl/log/log.h>
-
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <TimeTracer.h>
#include "JSMessagePortManager.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace MessagePort {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\MessagePort] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\MessagePort] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try
{
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\MessagePort] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\MessagePort] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"MessagePort");
TIME_TRACER_RELEASE();
Try
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\MessagePort] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\MessagePort] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\MessagePort] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\MessagePort] on_frame_unload_callback (" << context << ")");
}
PLUGIN_ON_WIDGET_START(on_widget_start_callback)
//
#include <algorithm>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "Attachment.h"
#include <stdlib.h>
}
+#include <Logger.h>
+
using namespace WrtDeviceApis::Commons;
using namespace std;
Attachment::Attachment()
{
- LogDebug("entered");
+ LoggerD("entered");
}
Attachment::Attachment(const string& fullPath,
bool isVirtualPath)
{
- LogDebug("entered");
+ LoggerD("entered");
init(fullPath, isVirtualPath);
}
/*
Attachment::Attachment(email_attachment_info_t* att)
{
- LogDebug("entered");
+ LoggerD("entered");
m_attachShortName = std::string(att->name); //set shot Name
m_isDownloaded = att->downloaded;
m_attachmentID = att->attachment_id;
- LogDebug(" showname = " << m_attachShortName << " isDownloaded = " << m_isDownloaded << " attachmentID = " << m_attachmentID);
- LogDebug("save name is = " << att->savename);
+ LoggerD(" showname = " << m_attachShortName << " isDownloaded = " << m_isDownloaded << " attachmentID = " << m_attachmentID);
+ LoggerD("save name is = " << att->savename);
if ( att->savename )
{
init( att->savename, false);
*/
Attachment::Attachment(email_attachment_data_t* att)
{
- LogDebug("entered");
+ LoggerD("entered");
m_attachShortName = std::string(att->attachment_name);
m_isDownloaded = att->save_status;
m_attachmentID = att->attachment_id;
m_isInlineAttachment = att->inline_content_status;
//m_mimeType = std::string(att->attachment_mime_type);
- LogDebug(" showname = " << m_attachShortName << " isDownloaded = " << m_isDownloaded << " attachmentID = " << m_attachmentID << "Mime= " << m_mimeType);
- LogDebug("save name is = " << att->attachment_path << "isInlineAttachment = " << m_isInlineAttachment);
+ LoggerD(" showname = " << m_attachShortName << " isDownloaded = " << m_isDownloaded << " attachmentID = " << m_attachmentID << "Mime= " << m_mimeType);
+ LoggerD("save name is = " << att->attachment_path << "isInlineAttachment = " << m_isInlineAttachment);
if ( att->attachment_path)
{
const DeviceAPI::Filesystem::INode& inode):
DeviceAPI::Filesystem::INode(inode)
{
- LogDebug("entered , inode");
+ LoggerD("entered , inode");
init(fullPath, isVirtualPath);
}
*/
Attachment::Attachment(const std::string& fullPath, bool isVirtualPath, const DeviceAPI::Filesystem::INode& inode):
IAttachment(inode)
{
- LogDebug("entered , inode");
+ LoggerD("entered , inode");
init(fullPath, isVirtualPath);
}
#endif
}
Catch(WrtDeviceApis::Commons::Exception) {
- LogError("invalid path");
+ LoggerE("invalid path");
ReThrow(WrtDeviceApis::Commons::InvalidArgumentException);
}
#endif
- LogDebug(" path = " << path);
+ LoggerD(" path = " << path);
return path;
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "AttachmentFactory.h"
#include "Attachments.h"
#include "Attachment.h"
#include <Commons/WrtAccess/WrtAccess.h>
#include <WidgetDB/WidgetDBMgr.h>
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis;
IAttachmentPtr AttachmentFactory::createAttachment(const std::string& fullPath,
bool isVirtualPath)
{
- LogDebug("enter");
+ LoggerD("enter");
IAttachmentPtr attachment(new Attachment(fullPath, isVirtualPath));
if (!attachment->getIsCreatedProperly()) {
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException,
IAttachmentPtr AttachmentFactory::createAttachment(const std::string& path,
const std::string& mimeType)
{
- LogDebug("enter");
+ LoggerD("enter");
//check virtualPath
bool isVirtualPath = true;
std::string AttachmentFactory::getVirtualPathFromRealPath(JSContextRef context,
const std::string& real_path)
{
- LogDebug("path = " << real_path);
+ LoggerD("path = " << real_path);
//find virtual root
std::string root;
{
std::string vroot(PATH_DOWNLOADS);
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_DOWNLOADS;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
{
std::string vroot(PATH_DOCUMENTS);
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_DOCUMENTS;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
{
std::string vroot(PATH_SOUNDS);
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_SOUNDS;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
{
std::string vroot(PATH_IMAGES);
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_IMAGES;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
- LogDebug("virtualpath = " << virtualpath);
+ LoggerD("virtualpath = " << virtualpath);
return virtualpath;
}
{
std::string vroot(PATH_VIDEOS);
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_VIDEOS;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
- LogDebug("virtualpath = " << virtualpath);
+ LoggerD("virtualpath = " << virtualpath);
return virtualpath;
}
{
std::string vroot(widgetDB->getWidgetInstallationPath());
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_WGT_PACKAGE;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
- LogDebug("virtualpath = " << virtualpath);
+ LoggerD("virtualpath = " << virtualpath);
return virtualpath;
}
{
std::string vroot(widgetDB->getWidgetPersistentStoragePath());
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_WGT_PRIVATE;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
- LogDebug("virtualpath = " << virtualpath);
+ LoggerD("virtualpath = " << virtualpath);
return virtualpath;
}
{
std::string vroot(widgetDB->getWidgetTemporaryStoragePath());
tail = real_path.substr(virtualrootpathposition + vroot.size() + 1, real_path.size() - 1);
- LogDebug("tail = " << tail);
+ LoggerD("tail = " << tail);
vroot=VPATH_WGT_PRIVATE_TEMP;
std::string virtualpath = vroot + AttachmentFactory::m_pathSeparator + tail ;
- LogDebug("virtualpath = " << virtualpath);
+ LoggerD("virtualpath = " << virtualpath);
return virtualpath;
}
//another folder
//copy
- LogDebug("path = " << real_path);
+ LoggerD("path = " << real_path);
int widgetId = WrtAccessSingleton::Instance().getWidgetId();
int error = 0;
size_t pos = real_path.find_last_of("/");
if ((pos + 1) >= real_path.size()) {
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
Throw(InvalidArgumentException);
}
std::string attachShortName = real_path.substr(pos + 1);
std::string privat_dir = widgetDB->getWidgetPersistentStoragePath();
if ( privat_dir.empty())
{
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
Throw(InvalidArgumentException);
}
mode_t mask = umask(S_IWGRP | S_IWOTH);
error = mkstemp(buf);
umask(mask);
- LogDebug("mkstemp =" << error);
+ LoggerD("mkstemp =" << error);
- LogDebug("temp file=" << buf << AttachmentFactory::m_pathSeparator << attachShortName);
+ LoggerD("temp file=" << buf << AttachmentFactory::m_pathSeparator << attachShortName);
std::stringstream mkdir_cmd;
mkdir_cmd << MKDIR_COMMAND_NAME;
mkdir_cmd << " " << MKDIR_COMMAND_SWITCH_RECURSIVE;
mkdir_cmd << " \"" << privat_dir << buf << AttachmentFactory::m_pathSeparator << "\"";
- LogDebug("mkdir path=" << mkdir_cmd.str());
+ LoggerD("mkdir path=" << mkdir_cmd.str());
int result = system(mkdir_cmd.str().c_str());
if (-1 != result) {
cp_cmd << " \"" << real_path << "\"";
cp_cmd << " \"" << privat_dir << buf << AttachmentFactory::m_pathSeparator << attachShortName << "\"";
- LogDebug("cp path=" << cp_cmd.str());
+ LoggerD("cp path=" << cp_cmd.str());
result = system(cp_cmd.str().c_str());
if (-1 != result) {
const std::string& real_path)
{
//This file is not in list of root locations
- LogDebug("path = " << real_path);
+ LoggerD("path = " << real_path);
int widgetId = WrtAccessSingleton::Instance().getWidgetId();
int error = 0;
size_t pos = real_path.find_last_of("/");
if ((pos + 1) >= real_path.size()) {
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
Throw(InvalidArgumentException);
}
std::string attachShortName = real_path.substr(pos + 1);
std::string privat_dir = widgetDB->getWidgetPersistentStoragePath();
if ( privat_dir.empty())
{
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
Throw(InvalidArgumentException);
}
mode_t mask = umask(S_IWGRP | S_IWOTH);
error = mkstemp(buf);
umask(mask);
- LogDebug("mkstemp =" << error);
+ LoggerD("mkstemp =" << error);
- LogDebug("temp file=" << buf << AttachmentFactory::m_pathSeparator << attachShortName);
+ LoggerD("temp file=" << buf << AttachmentFactory::m_pathSeparator << attachShortName);
std::stringstream mkdir_cmd;
mkdir_cmd << MKDIR_COMMAND_NAME;
mkdir_cmd << " " << MKDIR_COMMAND_SWITCH_RECURSIVE;
mkdir_cmd << " \"" << privat_dir << buf << AttachmentFactory::m_pathSeparator << "\"";
- LogDebug("mkdir path=" << mkdir_cmd.str());
+ LoggerD("mkdir path=" << mkdir_cmd.str());
int result = system(mkdir_cmd.str().c_str()); //make folder in the wgt-private.
if (-1 != result) {
cp_cmd << " \"" << real_path << "\"";
cp_cmd << " \"" << privat_dir << buf << AttachmentFactory::m_pathSeparator << attachShortName << "\"";
- LogDebug("cp path=" << cp_cmd.str());
+ LoggerD("cp path=" << cp_cmd.str());
result = system(cp_cmd.str().c_str()); //copy
if (-1 != result) {
std::string AttachmentFactory::getRealPathFromVirtualPath(JSContextRef context,
const std::string& path)
{
- LogDebug("path = " << path);
+ LoggerD("path = " << path);
std::string root;
std::string tail;
} else {
root = path;
}
- LogDebug("root = " << root);
- LogDebug("tail = " << tail);
+ LoggerD("root = " << root);
+ LoggerD("tail = " << tail);
int widgetId = WrtAccessSingleton::Instance().getWidgetId();
WidgetDB::Api::IWidgetDBPtr widgetDB =
}
else
{ //exception
- LogDebug("Can't find root path");
+ LoggerD("Can't find root path");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException,
"Attachment couldn't be created");
}
//remove folder
size_t pos = dummyFilePath.find_last_of("/");
if ((pos + 1) >= dummyFilePath.size()) {
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
}
std::string folder = dummyFilePath.substr(0, pos);
- LogDebug("remove folder : " << folder);
+ LoggerD("remove folder : " << folder);
if ( 0 != remove(folder.c_str()))
{
- LogError("Remove Error");
+ LoggerE("Remove Error");
}
}
else
{
- LogDebug("remove file error : " << dummyFilePath);
+ LoggerD("remove file error : " << dummyFilePath);
}
}
//
#include <algorithm>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "Attachments.h"
#include "AttachmentFactory.h"
+#include <Logger.h>
extern "C" {
#include <sys/stat.h>
Attachments::Attachments() :
m_validAttachments(false)
{
- LogDebug("enter");
+ LoggerD("enter");
}
Attachments::~Attachments()
{
- LogDebug("enter");
+ LoggerD("enter");
}
IAttachmentPtr Attachments::appendAttachment(const std::string& fullPath,
bool isVirtualPath)
{
- LogDebug("enter, fullPath=" << fullPath);
+ LoggerD("enter, fullPath=" << fullPath);
IAttachmentPtr tmpAttach = AttachmentFactory::createAttachment(
fullPath,
isVirtualPath);
void Attachments::appendAttachment(const IAttachmentPtr& attachment)
{
- LogDebug("enter");
+ LoggerD("enter");
m_validAttachments = false;
m_attachments.push_back(attachment);
}
void Attachments::appendInlineAttachment(const IAttachmentPtr& attachment)
{
- LogDebug("enter");
+ LoggerD("enter");
m_validInineAttachments = false;
m_inlineAttachments.push_back(attachment);
}
IAttachmentPtr Attachments::appendAttachment(const IMessagePtr& message, const std::string& fullPath,
bool isVirtualPath)
{
- LogDebug("enter");
+ LoggerD("enter");
IAttachmentPtr iAttachment = appendAttachment(fullPath, isVirtualPath);
if (message && iAttachment)
void Attachments::appendAttachment(const IMessagePtr& message, const IAttachmentPtr& attachment)
{
- LogDebug("enter");
+ LoggerD("enter");
m_validAttachments = false;
void Attachments::appendAttachments(const vector<IAttachmentPtr>& attachments)
{
- LogDebug("enter");
+ LoggerD("enter");
back_insert_iterator< vector<IAttachmentPtr> >biit(m_attachments);
copy(attachments.begin(), attachments.end(), biit);
}
size_t Attachments::getAttachmentsCount() const
{
- LogDebug("enter");
+ LoggerD("enter");
return m_attachments.size();
}
size_t Attachments::getInlineAttachmentsCount() const
{
- LogDebug("enter");
+ LoggerD("enter");
return m_inlineAttachments.size();
}
IAttachmentPtr Attachments::getAttachment(const size_t index) const
{
- LogDebug("enter");
+ LoggerD("enter");
if (index >= m_attachments.size()) {
ThrowMsg(OutOfRangeException, "Trying to get attachment out of range");
}
IAttachmentPtr Attachments::getInlineAttachment(const size_t index) const
{
- LogDebug("enter");
+ LoggerD("enter");
if (index >= m_inlineAttachments.size()) {
ThrowMsg(OutOfRangeException, "Trying to get attachment out of range");
}
void Attachments::removeAttachment(const size_t index)
{
- LogDebug("enter");
+ LoggerD("enter");
if (index >= m_attachments.size()) {
ThrowMsg(OutOfRangeException, "Trying to get attachment out of range");
}
vector<IAttachmentPtr> Attachments::getAttachments() const
{
- LogDebug("enter");
+ LoggerD("enter");
return m_attachments;
}
vector<IAttachmentPtr> Attachments::getInlineAttachments() const
{
- LogDebug("enter");
+ LoggerD("enter");
return m_inlineAttachments;
}
bool Attachments::isAttachmentsValid() const
{
- LogDebug("m_validAttachments : " << m_validAttachments);
+ LoggerD("m_validAttachments : " << m_validAttachments);
return m_validAttachments;
}
const IAttachmentPtr& attachment)
{
// possible move it as a virtual function - to be clarified
- LogError("N/A");
+ LoggerE("N/A");
//TODO
}
//
#include "BinarySms.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
BinarySms::BinarySms(const string& id) :
IMessage(BINARYSMS, id)
{
- LogDebug("enter");
+ LoggerD("enter");
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
}
BinarySms::~BinarySms()
{
- LogDebug("enter");
+ LoggerD("enter");
}
void BinarySms::update(bool /*draftsOnly*/)
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
}
void BinarySms::readAllData()
//
#include "CallbackMgr.h"
-#include <dpl/log/log.h>
#include "MsgServiceHandleMgr.h"
#include <dpl/singleton_safe_impl.h>
+#include <Logger.h>
IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::CallbackMgr)
CallbackMgr::CallbackMgr()
{
- LogInfo("enter");
+ LoggerI("enter");
// register callback once per process
if (NULL == MsgGetCommonHandle()) {
- LogError("Unable to open handle");
+ LoggerE("Unable to open handle");
} else {
if (msg_reg_sent_status_callback(MsgGetCommonHandle(), sendCallback,
static_cast<void*>(this)) !=
MSG_SUCCESS) {
- LogError("callback registration error");
+ LoggerE("callback registration error");
} else {
- LogDebug("callback registred succesfully");
+ LoggerD("callback registred succesfully");
}
}
}
CallbackMgr::~CallbackMgr()
{
- LogInfo("enter");
+ LoggerI("enter");
}
msg_error_t CallbackMgr::registerAndSend(SendingFunction sendingFn,
{
if (observer)
{
- msg_struct_list_s *addr_list = NULL;
- err = msg_get_list_handle(message, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
+
+ err = msg_get_list_handle(message, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[0], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, 0);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
msg_get_int_value(req, MSG_REQUEST_REQUESTID_INT, &tempInt);
m_sendRequests[tempInt] = observer;
void CallbackMgr::unregister(int reqId)
{
- LogDebug(" reqId is : " << reqId);
+ LoggerD(" reqId is : " << reqId);
DPL::Mutex::ScopedLock lock(&m_mutex);
SendReqMap::iterator it = m_sendRequests.find(reqId);
if (it == m_sendRequests.end()) {
- LogWarning("No matching request found");
+ LoggerW("No matching request found");
return;
}
- LogInfo("Matching send request found!");
+ LoggerI("Matching send request found!");
m_sendRequests.erase(it);
}
msg_struct_t sent_status,
void *user_param)
{
-// LogInfo(
+// LoggerI(
// "callback received. Req id = " << sent_status->reqId <<
// " Status = " << (int)sent_status->status);
CallbackMgr* instance = static_cast<CallbackMgr*>(user_param);
if (!instance) {
- LogError("Empty user data!");
+ LoggerE("Empty user data!");
return;
}
SendReqMap::iterator it = m_sendRequests.find(reqId);
if (it == m_sendRequests.end()) {
- LogWarning("No matching request found");
+ LoggerW("No matching request found");
return;
}
- LogInfo("Matching send request found!");
+ LoggerI("Matching send request found!");
// call it
it->second->sendingCallback(sent_status);
m_sendRequests.erase(it);
// limitations under the License.
//
-#include <dpl/log/log.h>
#include "CallbackNumber.h"
#include "CallbackNumber.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
void CallbackNumber::setCallbackNumber(const std::string& value)
{
- LogDebug("set callbackNumber=" << value);
+ LoggerD("set callbackNumber=" << value);
m_callbackNumber = value;
m_validCallbackNumber = false;
}
Conversation::Conversation(unsigned int threadId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (msgType == EMAIL)
{
Conversation::Conversation(std::string threadId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
bool result = FALSE;
std::istringstream stream(threadId);
- LogDebug("threadId : " << threadId);
+ LoggerD("threadId : " << threadId);
unsigned int number = 0;
stream >> number;
//void Conversation::makeConversationFromThread(msg_thread_view_t msg_thread)
void Conversation::makeConversationFromThread(msg_struct_t msg_thread)
{
- LogDebug("Enter");
+ LoggerD("Enter");
msg_handle_t handle = MsgGetCommonHandle();
msg_struct_list_s convViewList;
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
msg_struct_t msgInfo = NULL;
msg_struct_t sendOpt = NULL;
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
}
if (tempString != NULL)
{
m_preview = tempString;
- LogDebug("preview" << m_preview);
+ LoggerD("preview" << m_preview);
}
err = msg_get_conversation_view_list(handle, m_Id, &convViewList);
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_DIRECTION_INT, &tempInt);
int type = tempInt;
- msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
- nToCnt = addr_list->nCount;
+ nToCnt = msg_list_length(addr_list);
if (type == MSG_DIRECTION_TYPE_MT)
{
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[m_lastMessageId], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, m_lastMessageId);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
if (strNumber[0] != '\0')
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
}
// get thread subject
for (index = 0; index < nToCnt; index++)
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[index], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
tempString = strNumber;
if (tempString != NULL)
{
}
else
{
- LogDebug("address fetch fail" << addressCount);
+ LoggerD("address fetch fail" << addressCount);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
msg_release_list_struct(&convViewList);
void Conversation::makeConversationFromThreadIndex(unsigned int threadIndex)
{
/*
- LogDebug("Enter");
+ LoggerD("Enter");
MSG_HANDLE_T handle = MsgGetCommonHandle();
MSG_LIST_S convViewList = {0, NULL};
MSG_THREAD_VIEW_LIST_S threadViewList = {0, NULL};
if (threadViewList.nCount < 0 || threadIndex >= (unsigned int)threadViewList.nCount)
{
- LogDebug(threadIndex << ":" << threadViewList.nCount);
+ LoggerD(threadIndex << ":" << threadViewList.nCount);
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "invalid index reference" );
}
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
// default:
// Todo email / chat
if (tempString != NULL)
{
m_preview = tempString;
- LogDebug("preview" << m_preview);
+ LoggerD("preview" << m_preview);
}
m_messageCount = convViewList.nCount;
m_read = msg_is_read(convViewList.msgInfo[lastMsgIndex]);
- LogDebug("lastMsgIndex:" << lastMsgIndex << ",message count:" << m_messageCount << ",read" << m_read);
+ LoggerD("lastMsgIndex:" << lastMsgIndex << ",message count:" << m_messageCount << ",read" << m_read);
if (msg_get_direction_info(convViewList.msgInfo[lastMsgIndex]) == MSG_DIRECTION_TYPE_MT)
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
- LogDebug("from" << m_from);
+ LoggerD("from" << m_from);
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
}
m_subject = tempString;
}
- LogDebug("subject" << m_subject);
+ LoggerD("subject" << m_subject);
addressCount = msg_get_address_count(convViewList.msgInfo[lastMsgIndex]);
m_to.push_back(tempString);
}
}
- LogDebug("address count" << addressCount);
+ LoggerD("address count" << addressCount);
}
else
{
- LogDebug("address fetch fail" << addressCount);
+ LoggerD("address fetch fail" << addressCount);
}
if (msg_get_message_id(convViewList.msgInfo[lastMsgIndex]) >= 0 )
m_lastMessageId = msg_get_message_id(convViewList.msgInfo[lastMsgIndex]);
}
- LogDebug("message id" << m_lastMessageId);
+ LoggerD("message id" << m_lastMessageId);
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
if (convViewList.msgInfo != NULL)
{
bool Conversation::makeConversationFromMsgId(unsigned int msgId, MessageType msgType)
{
- LogDebug("Enter");
+ LoggerD("Enter");
msg_handle_t handle = MsgGetCommonHandle();
msg_struct_t msg_thread = NULL;
msg_struct_list_s convViewList;
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
msg_error_t err = MSG_SUCCESS;
// get threadId from message
msg_get_int_value(msgInfo, MSG_MESSAGE_THREAD_ID_INT, &tempInt);
m_Id = (unsigned int)tempInt;
- LogDebug("m_Id : " << m_Id);
+ LoggerD("m_Id : " << m_Id);
// get Thread
msg_thread = msg_create_struct(MSG_STRUCT_THREAD_INFO);
case MSG_TYPE_SMS_SYNCML:
case MSG_TYPE_SMS_REJECT:
m_type = SMS;
- LogDebug("Type:SMS");
+ LoggerD("Type:SMS");
break;
case MSG_TYPE_MMS:
case MSG_TYPE_MMS_JAVA:
case MSG_TYPE_MMS_NOTI:
m_type = MMS;;
- LogDebug("Type:MMS");
+ LoggerD("Type:MMS");
break;
}
// get thread time
msg_get_int_value(msg_thread, MSG_THREAD_MSG_TIME_INT, &tempInt);
m_time = tempInt;
- LogDebug("m_time : " << m_time);
+ LoggerD("m_time : " << m_time);
// get thread unread count
msg_get_int_value(msg_thread, MSG_THREAD_UNREAD_COUNT_INT, &tempInt);
m_unreadMessages = tempInt;
- LogDebug("m_unreadMessages : " << m_unreadMessages);
+ LoggerD("m_unreadMessages : " << m_unreadMessages);
// get thread preview
msg_get_str_value(msg_thread, MSG_THREAD_MSG_DATA_STR, msgData, MAX_THREAD_DATA_LEN);
{
m_preview = tempString;
}
- LogDebug("m_preview : " << m_preview);
+ LoggerD("m_preview : " << m_preview);
err = msg_get_conversation_view_list(handle, m_Id, &convViewList);
// get thread message count
lastMsgIndex = convViewList.nCount - 1;
m_messageCount = convViewList.nCount;
- LogDebug("m_messageCount : " << m_messageCount);
+ LoggerD("m_messageCount : " << m_messageCount);
// get thread read status
msg_get_bool_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_READ_BOOL, &tempBool);
m_read = tempBool;
- LogDebug("m_read : " << m_read);
+ LoggerD("m_read : " << m_read);
// get thread last message Id
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_ID_INT, &tempInt);
m_lastMessageId = tempInt;
- LogDebug("m_lastMessageId : " << m_lastMessageId);
+ LoggerD("m_lastMessageId : " << m_lastMessageId);
// get thread from
if (msg_get_message(handle, m_lastMessageId, msgInfo, sendOpt) != MSG_SUCCESS)
msg_get_int_value(convViewList.msg_struct_info[lastMsgIndex], MSG_CONV_MSG_DIRECTION_INT, &tempInt);
int type = tempInt;
- LogDebug("direction : " << type);
+ LoggerD("direction : " << type);
- msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- nToCnt = addr_list->nCount;
+ msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+ nToCnt = msg_list_length(addr_list);
if (type == MSG_DIRECTION_TYPE_MT)
{
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[nToCnt-1], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, nToCnt-1);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
if (strNumber[0] != '\0')
{
}
else
{
- LogDebug("address is null ");
+ LoggerD("address is null ");
}
}
else
{
- LogDebug("address count index fail");
+ LoggerD("address count index fail");
}
}
else
{
- LogDebug("Msg direction: MO, from will be omitted");
+ LoggerD("Msg direction: MO, from will be omitted");
// get thread to
if (nToCnt > 0 && nToCnt < MAX_TO_ADDRESS_CNT )
{
for (int index = 0; index < nToCnt; index++)
{
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- msg_get_str_value(addr_list->msg_struct_info[index], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
tempString = strNumber;
if (tempString != NULL)
{
- LogDebug("m_to : " << tempString);
+ LoggerD("m_to : " << tempString);
m_to.push_back(tempString);
}
}
}
else
{
- LogDebug("address fetch fail");
+ LoggerD("address fetch fail");
}
}
{
m_subject = tempString; // convert char to string
}
- LogDebug("m_subject : " << m_subject);
+ LoggerD("m_subject : " << m_subject);
}
catch (const WrtDeviceApis::Commons::UnknownException& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
msg_release_list_struct(&convViewList);
bool Conversation::makeConversationFromEmailThreadId(unsigned int emailTreadId)
{
- LogDebug("Enter");
+ LoggerD("Enter");
email_mail_list_item_t *resultMail = NULL;
email_mail_list_item_t *mailList = NULL;
// account Id
m_unreadMessages = 0;
- LogDebug("start email_get_mail_list");
+ LoggerD("start email_get_mail_list");
if (email_get_mail_list(mailData->account_id, 0, emailTreadId, 0, resultMail->thread_item_count,
EMAIL_SORT_DATETIME_HIGH, &mailList, &count) != EMAIL_ERROR_NONE)
{
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get email data fail" );
}
- LogDebug("end email_get_mail_list");
+ LoggerD("end email_get_mail_list");
// unread msg count
for (index = 0; index < count; index++)
{
m_unreadMessages++;
}
- LogDebug(mailList[index].flags_seen_field);
+ LoggerD(mailList[index].flags_seen_field);
}
// message count
if (resultMail->full_address_from[0] != '\0')
{
m_from = resultMail->full_address_from;
- LogDebug(m_from);
+ LoggerD(m_from);
}
// subject
if (resultMail->subject[0] != '\0')
{
m_subject = resultMail->subject;
- LogDebug(m_subject);
+ LoggerD(m_subject);
}
if (mailData->full_address_to != NULL)
{
- LogDebug("Header To " << mailData->full_address_to);
+ LoggerD("Header To " << mailData->full_address_to);
m_to.push_back(mailData->full_address_to);
}
if (mailData->full_address_bcc != NULL)
{
- LogDebug("Header Bcc " << mailData->full_address_bcc);
+ LoggerD("Header Bcc " << mailData->full_address_bcc);
m_bcc.push_back(mailData->full_address_bcc);
}
if (mailData->full_address_cc != NULL)
{
- LogDebug("Header CC " << mailData->full_address_cc);
+ LoggerD("Header CC " << mailData->full_address_cc);
m_cc.push_back(mailData->full_address_cc);
}
m_lastMessageId = resultMail->mail_id;
- LogDebug(m_lastMessageId);
+ LoggerD(m_lastMessageId);
m_result = true;
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
m_result = false;
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
}
if (mailData != NULL)
}
}
+
#include "ConversationFilterValidatorFactory.h"
#include "log.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
bool retVal = false;
if(attrName.compare(ConversationFilterValidatorFactory::ATTRIBUTE_TIMESTAMP)!=0){
- LogError(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
+ LoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
return false;
}
}
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue,depth);
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
bool ConversationFilterValidator::validateAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
if(attrName.compare(ConversationFilterValidatorFactory::ATTRIBUTE_TYPE)==0){
if(m_isTypeSetted == true){
- MsgLogError(">>> [ERROR] duplicated type :[" << attrName << "], value:[" << value->toString()<< "]");
+ MsgLoggerE(">>> [ERROR] duplicated type :[" << attrName << "], value:[" << value->toString()<< "]");
return false;
}else{
m_isTypeSetted = true;
#include "ConversationFilterValidatorFactory.h"
#include <Commons/Exception.h>
-#include <dpl/log/log.h>
#include "log.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
}
void ConversationQueryGenerator::setSmsMmsAttributeMap(){
- LogDebug("<<<");
+ LoggerD("<<<");
attributeMap.clear();
attributeMap.insert(
std::pair<std::string, std::string>(
ConversationFilterValidatorFactory::ATTRIBUTE_UNREAD_MESSAGES, "B.UNREAD_CNT"));
- LogDebug(">>>");
+ LoggerD(">>>");
}
std::string ConversationQueryGenerator::getMatchExactlyClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value){
}else if(getMode() == MODE_MMS){
return ConversationQueryGenerator::QUERY_PREFIX_MMS;
}else{
- MsgLogError("invalid mode:" << getMode());
+ MsgLoggerE("invalid mode:" << getMode());
Throw(WrtDeviceApis::Commons::UnknownException);
}
}
}else if(getMode() == MODE_SMS || getMode() == MODE_MMS){
return ConversationQueryGenerator::QUERY_SUFFIX_SMS_MMS;
}else{
- MsgLogError("invalid mode:" << getMode());
+ MsgLoggerE("invalid mode:" << getMode());
Throw(WrtDeviceApis::Commons::UnknownException);
}
}
#include "JSMessageFolder.h"
#include <JSWebAPIError.h>
+#include <Logger.h>
#if 0 // MESSAGING ATTACHMENT IS BLOCKED
#include <JSFile.h>
static_cast<WrtDeviceApis::CommonsJavaScript::PrivateObjectT<void>::Type*>(JSObjectGetPrivate(
arg));
if (!priv) {
- LogError("Private object not initialized");
+ LoggerE("Private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
return JSMessage::createJSObject(m_context, arg);
default:
- LogError("unknown type");
+ LoggerE("unknown type");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
return JSMessage::createJSObject(m_context, arg, listener);
default:
- LogError("unknown type");
+ LoggerE("unknown type");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
JSValueRef retVal = NULL;
if (NULL == value) {
- LogError("jsValue null");
+ LoggerE("jsValue null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
JSObjectRef argObj = JSValueToObject(m_context, value, NULL);
if (NULL == argObj) {
- LogError("conversion to jsobject fail");
+ LoggerE("conversion to jsobject fail");
Throw(WrtDeviceApis::Commons::ConversionException);
}
const JSStringRef keyJSStr = JSStringCreateWithUTF8CString(key.c_str());
retVal = JSObjectGetProperty(m_context, argObj, keyJSStr, NULL);
JSStringRelease(keyJSStr);
if (NULL == retVal) {
- LogWarning("key \"" << key << "\" not found in JSValue map");
+ LoggerW("key \"" << key << "\" not found in JSValue map");
}
// return NULL if no key in map
return retVal;
IMessagePtr ConverterMessage::toIMessage(JSObjectRef arg)
{
- LogDebug("message object=" << arg);
+ LoggerD("message object=" << arg);
if (!arg) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
JSMessagePrivateObject* priv =
static_cast<JSMessagePrivateObject*>(JSObjectGetPrivate(arg));
if (!priv) {
- LogError("Private object not initialized");
+ LoggerE("Private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
retVal = priv->getObject();
if (!retVal) {
- LogError("Message private object not initialized");
+ LoggerE("Message private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
{
if (!arg)
{
- LogError("Object is Null");
+ LoggerE("Object is Null");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object not initialized");
}
static_cast<JSMessageAttachmentPrivate*>(JSObjectGetPrivate(arg));
if (!priv) {
- LogError("Private object not initialized");
+ LoggerE("Private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
retVal = priv->getObject();
if (!retVal) {
- LogError("Message private object not initialized");
+ LoggerE("Message private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
{
if (!arg)
{
- LogError("Object is Null");
+ LoggerE("Object is Null");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object not initialized");
}
static_cast<JSMessageFolderPriv*>(JSObjectGetPrivate(arg));
if (!priv) {
- LogError("Private object not initialized");
+ LoggerE("Private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
retVal = priv->getObject();
if (!retVal) {
- LogError("Message private object not initialized");
+ LoggerE("Message private object not initialized");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
"Private object not initialized");
}
return retVal;
}
-OnMessagesChanged ConverterMessage::toMessageMultifunctions(JSValueRef argument)
-{
- OnMessagesChanged result;
- Validator validator(m_context);
- JSObjectRef objectCallbacks = toJSObjectRef(argument);
- std::string callbackName = toString(argument);
- int index = 0;
-
- LogDebug("Enter\n");
-
- for (index = 0; index < MESSAGING_MULTI_FUNTION_MAX; index++)
- {
- ScopedJSStringRef propName(toJSStringRef(m_callbackNames[index].addedFunction));
-
- if (JSObjectHasProperty(m_context, objectCallbacks, propName.get()))
- {
- LogDebug("Callback name :" << m_callbackNames[index].addedFunction << " "
- << m_callbackNames[index].updatedFunction << " " << m_callbackNames[index].removedFunction);
-
- result.messagesAdded = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[index].addedFunction);
- result.messagesUpdated = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[index].updatedFunction);
- result.messagesRemoved = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[index].removedFunction);
- break;
- }
-
- }
-
- if(result.messagesAdded == NULL || result.messagesUpdated == NULL || result.messagesRemoved == NULL)
- {
- LogError("OnMessagesChanged is not set");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
-
- result.functionIndex = index;
-
- if ((!validator.isNullOrUndefined(result.messagesAdded) && !validator.isCallback(result.messagesAdded)) ||
- (!validator.isNullOrUndefined(result.messagesUpdated) && !validator.isCallback(result.messagesUpdated)) ||
- (!validator.isNullOrUndefined(result.messagesRemoved) && !validator.isCallback(result.messagesRemoved)))
- {
- LogError("java script call back set error");
- Throw(WrtDeviceApis::Commons::ConversionException);
- }
+OnMessagesChanged ConverterMessage::toMessageMultifunctions(JSValueRef argument, int multiFuntionType)
+{
+ LoggerD("Enter");
+
+ LoggerD("multiFuntionType : " << multiFuntionType);
+
+ OnMessagesChanged result;
+ Validator validator(m_context);
+ JSObjectRef objectCallbacks = toJSObjectRef(argument);
+
+ ScopedJSStringRef propNameAdded(toJSStringRef(m_callbackNames[multiFuntionType].addedFunction));
+ ScopedJSStringRef propNameUpdated(toJSStringRef(m_callbackNames[multiFuntionType].updatedFunction));
+ ScopedJSStringRef propNameRemoved(toJSStringRef(m_callbackNames[multiFuntionType].removedFunction));
+
+ if(JSObjectHasProperty(m_context, objectCallbacks, propNameAdded.get()))
+ {
+ LoggerD("added exist");
+ result.messagesAdded = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[multiFuntionType].addedFunction);
+ if (validator.isNullOrUndefined(result.messagesAdded))
+ result.messagesAdded = NULL;
+ else if (!validator.isCallback(result.messagesAdded)) {
+ LoggerD("is not Callback");
+ ThrowMsg(ConversionException, "1nd argument's onsuccess attribute is not a 'function'");
+ }
+ }
+ if(JSObjectHasProperty(m_context, objectCallbacks, propNameUpdated.get()))
+ {
+ LoggerD("updated exist");
+ result.messagesUpdated = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[multiFuntionType].updatedFunction);
+ if (validator.isNullOrUndefined(result.messagesUpdated))
+ result.messagesUpdated = NULL;
+ else if (!validator.isCallback(result.messagesUpdated)) {
+ LoggerD("is not Callback");
+ ThrowMsg(ConversionException, "2nd argument's onsuccess attribute is not a 'function'");
+ }
+ }
+ if(JSObjectHasProperty(m_context, objectCallbacks, propNameRemoved.get()))
+ {
+ LoggerD("removed exist");
+ result.messagesRemoved = JSUtils::getJSPropertyOrUndefined(m_context, objectCallbacks, m_callbackNames[multiFuntionType].removedFunction);
+ if (validator.isNullOrUndefined(result.messagesRemoved))
+ result.messagesRemoved = NULL;
+ else if (!validator.isCallback(result.messagesRemoved)) {
+ LoggerD("is not Callback");
+ ThrowMsg(ConversionException, "3nd argument's onsuccess attribute is not a 'function'");
+ }
+ }
+
+ if(result.messagesAdded != NULL || result.messagesUpdated != NULL || result.messagesRemoved != NULL)
+ {
+ result.functionIndex = multiFuntionType;
+ }
return result;
}
{
// convert JSvalue to message type enum
std::string strMsgType = toString(arg);
- LogDebug("Messasge Type : " << strMsgType);
+ LoggerD("Messasge Type : " << strMsgType);
if ( strMsgType.compare("messaging.sms") == 0 )
{
std::string ConverterMessage::toMessageType( long msgtype )
{
- LogDebug("Messasge Type : " << msgtype);
+ LoggerD("Messasge Type : " << msgtype);
switch (msgtype)
{
MessageType ConverterMessage::toMessageType(std::string arg)
{
- LogDebug("Messasge Type : " << arg);
+ LoggerD("Messasge Type : " << arg);
if ( arg.compare("messaging.sms") == 0 )
{
std::string ConverterMessage::toMessageStatusType( long msgstatus )
{
- LogDebug("Messasge Status : " << msgstatus);
+ LoggerD("Messasge Status : " << msgstatus);
switch (msgstatus)
{
std::string ConverterMessage::convertIntToString( int msgInt )
{
- LogDebug("input int : " << msgInt);
+ LoggerD("input int : " << msgInt);
std::stringstream stream;
stream << msgInt;
return stream.str();
if( JSGetArrayLength(m_context, jsObject) == 0)
{
- LogError("this is empty conversation");
+ LoggerE("this is empty conversation");
Throw(WrtDeviceApis::Commons::ConversionException);
}
} else if ("bcc" == addressType) {
return BCC_ADDRESS;
} else {
- LogError("unknown address type");
+ LoggerE("unknown address type");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include "IMessagingTypes.h"
#include "MessageFactory.h"
virtual ~ConverterMessage();
- OnMessagesChanged toMessageMultifunctions(JSValueRef argument);
+ OnMessagesChanged toMessageMultifunctions(JSValueRef argument, int MessageFunctionNum);
JSContextRef toJSGlobalContext(JSObjectRef arg);
#include <cassert>
#include <algorithm>
#include <Commons/Exception.h>
-#include <dpl/log/log.h>
#include "Message.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
if (!dbus_connection_set_watch_functions(m_connection, addWatch,
removeWatch, toggleWatch, this,
NULL)) {
- LogDebug("Couldn't set-up watch functions.");
+ LoggerD("Couldn't set-up watch functions.");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't set-up watch functions.");
}
if (!dbus_connection_add_filter(m_connection, filterMessage, this, NULL)) {
- LogDebug("Couldn't set signal handler callback.");
+ LoggerD("Couldn't set signal handler callback.");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't set signal handler callback.");
}
void Connection::close()
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
if (!m_connected) { return; }
dbus_connection_remove_filter(m_connection, filterMessage, this);
if (dbus_error_is_set(&m_error)) {
std::string message = m_error.message;
dbus_error_free(&m_error);
- LogDebug("removeFilterInternal error : " << message);
+ LoggerD("removeFilterInternal error : " << message);
// ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "Invalid rule: " << message);
}
}
dbus_bool_t Connection::addWatch(DBusWatch* watch,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
assert(data && "Connection should be passed as user data.");
Connection* this_ = static_cast<Connection*>(data);
WatchPtr wrapper(new Watch(watch));
void Connection::removeWatch(DBusWatch* watch,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
assert(data && "Connection should be passed as user data.");
Connection* this_ = static_cast<Connection*>(data);
Watch wrapper(watch);
void Connection::toggleWatch(DBusWatch* watch,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
assert(data && "Connection should be passed as user data.");
Connection* this_ = static_cast<Connection*>(data);
Watch wrapper(watch);
DBusMessage* message,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
if (data) {
Connection* this_ = static_cast<Connection*>(data);
MessagePtr msg;
if (message) {
- LogInfo(
+ LoggerI(
"DBUS message received from interface: " <<
dbus_message_get_interface(message));
msg.Reset(new Message(message));
} else {
- LogError("DBus message not set, this should not happen!");
+ LoggerE("DBus message not set, this should not happen!");
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
FilterSetIterator it = this_->m_filters.begin();
}
}
} else {
- LogError("User-data not set, this should not happen!");
+ LoggerE("User-data not set, this should not happen!");
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
void Connection::MessageDispatcher::addDescriptor(DPL::WaitableHandle handle,
DPL::WaitMode::Type mode)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::WaitableEvent wait;
AddDescriptorSyncEvent event(handle, mode, &wait);
DPL::Event::ControllerEventHandler<AddDescriptorSyncEvent>::PostEvent(event);
void Connection::MessageDispatcher::removeDescriptor(DPL::WaitableHandle handle,
DPL::WaitMode::Type mode)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::WaitableEvent wait;
RemoveDescriptorSyncEvent event(handle, mode, &wait);
DPL::Event::ControllerEventHandler<RemoveDescriptorSyncEvent>::PostEvent(event);
void Connection::MessageDispatcher::OnEventReceived(
const AddDescriptorSyncEvent& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::WaitableHandleWatchSupport::InheritedContext()->AddWaitableHandleWatch(
this,
event.GetArg0(),
void Connection::MessageDispatcher::OnEventReceived(
const RemoveDescriptorSyncEvent& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
DPL::WaitableHandleWatchSupport::InheritedContext()->
RemoveWaitableHandleWatch(this, event.GetArg0(), event.GetArg1());
event.GetArg2()->Signal();
DPL::WaitableHandle waitableHandle,
DPL::WaitMode::Type mode)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
{
DPL::Mutex::ScopedLock lock(&m_connection->m_watchesMutex);
WatchSetIterator it = m_connection->m_watches.find(waitableHandle);
(mode == DPL::WaitMode::Write ? DBUS_WATCH_WRITABLE
: DBUS_WATCH_READABLE);
while (!dbus_watch_handle(it->second->get(), flags)) {
- LogError("Too few memory!");
+ LoggerE("Too few memory!");
// TODO: add some check-point to not loop infinitely
}
}
#include <ctime>
#include <email-types.h>
#include <email-api.h>
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <dpl/scoped_fclose.h>
#include <dpl/scoped_ptr.h>
#include "MessagingService.h"
#include "MessagingServiceManager.h"
#include "Attachment.h"
+#include <Logger.h>
-#define LOG_ENTER LogDebug("---> ENTER");
-#define LOG_EXIT LogDebug("---> EXIT");
+#define LOG_ENTER LoggerD("---> ENTER");
+#define LOG_EXIT LoggerD("---> EXIT");
using namespace std;
using namespace WrtDeviceApis::Commons;
reload();
} catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogError("Exception: " << ex.DumpToString());
+ LoggerE("Exception: " << ex.DumpToString());
}
LOG_EXIT
ThrowMsg(WrtDeviceApis::Commons::PlatformException, " message id is invalid");
}
- LogDebug("Account ID = " << accountId);
+ LoggerD("Account ID = " << accountId);
m_accountId = accountId;
reload();
setMessageStatus(MESSAGE_STATUS_LOADED);
} catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogError("Exception: " << ex.DumpToString());
+ LoggerE("Exception: " << ex.DumpToString());
}
reload();
}
catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogError("Exception: " << ex.DumpToString());
+ LoggerE("Exception: " << ex.DumpToString());
}
LOG_EXIT
}
}
catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogError("Exception: " << ex.DumpToString());
+ LoggerE("Exception: " << ex.DumpToString());
}
LOG_EXIT
Email::~Email()
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
}
int Email::send()
int attachmentCount = 0;
int error = email_get_attachment_data_list( m_mail->mail_id, &attachment, &attachmentCount);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("Nothing to update or error. [" << error << "]");
+ LoggerW("Nothing to update or error. [" << error << "]");
}
error = email_update_mail( m_mail.Get(), attachment, attachmentCount, NULL, 0);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("Nothing to update or error. [" << error << "]");
+ LoggerW("Nothing to update or error. [" << error << "]");
}
if (attachment)
{
error = email_free_attachment_data(&attachment, attachmentCount);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("Nothing to update or error. [" << error << "]");
+ LoggerW("Nothing to update or error. [" << error << "]");
}
}
error = email_free_mailbox(&mailbox, 1); //free
if (EMF_ERROR_NONE != error) {
- LogError("Failed to destroy mailbox: " << error);
+ LoggerE("Failed to destroy mailbox: " << error);
}
*/
}
m_accountId = account.getIntId();
//MailSender::getInstance();
- LogDebug("account ID : " << m_accountId);
+ LoggerD("account ID : " << m_accountId);
ScopedMail mail(EmailService::createMailData(account));
setEmailAccount(account); //save account
{
LOG_ENTER
- LogDebug("mail ID :" << getIntId());
+ LoggerD("mail ID :" << getIntId());
m_mail.Reset(EmailService::readMail(getIntId())); //reset Mail Data
readHeader();
Assert(m_mail && "Body is NULL.");
if (m_mail->file_path_plain) {
- LogDebug("m_mail->file_path_plain : " << m_mail->file_path_plain);
+ LoggerD("m_mail->file_path_plain : " << m_mail->file_path_plain);
DPL::ScopedFClose file(::fopen(m_mail->file_path_plain, "r"));
if (!file) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
//html body.
if (m_mail->file_path_html) {
- LogDebug("m_mail->file_path_html : " << m_mail->file_path_html);
+ LoggerD("m_mail->file_path_html : " << m_mail->file_path_html);
DPL::ScopedFClose file(::fopen(m_mail->file_path_html, "r")); //auto close, scopedFClose
if (!file) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
if ( attachment && attachmentCount > 0)
{
- LogDebug("reading attachments , attahcment count = " << attachmentCount);
+ LoggerD("reading attachments , attahcment count = " << attachmentCount);
int i = 0;
for ( i = 0; i < attachmentCount; i++)
{
Try {
- LogDebug("attachment ID :" << attachment[i].attachment_id << " name :" << attachment[i].attachment_name << " download :" << attachment[i].save_status << "savefile :" << attachment[i].attachment_path);
- LogDebug("attachment inline status :" << attachment[i].inline_content_status);
+ LoggerD("attachment ID :" << attachment[i].attachment_id << " name :" << attachment[i].attachment_name << " download :" << attachment[i].save_status << "savefile :" << attachment[i].attachment_path);
+ LoggerD("attachment inline status :" << attachment[i].inline_content_status);
IAttachmentPtr tmpAtt(new Attachment());
if (attachment[i].attachment_path)
tmpAtt->init(attachment[i].attachment_path, false);
if (tmpAtt)
{
- LogDebug("attachment[i].inline_content_status : " << attachment[i].inline_content_status);
+ LoggerD("attachment[i].inline_content_status : " << attachment[i].inline_content_status);
tmpAtt->rename(std::string(attachment[i].attachment_name));
tmpAtt->setAttachmentID(attachment[i].attachment_id);
tmpAtt->setDownloaded(attachment[i].save_status);
tmpAtt->setIsInlineAttachment((bool)attachment[i].inline_content_status);
tmpAtt->setNth(i+1);
- LogDebug(" setNth(i+1) : " << i+1);
+ LoggerD(" setNth(i+1) : " << i+1);
if(attachment[i].inline_content_status == 0)
{
appendAttachment(tmpAtt);
appendInlineAttachment(tmpAtt);
}
}
- LogDebug(" append Attachment complete");
+ LoggerD(" append Attachment complete");
}
catch ( const WrtDeviceApis::Commons::Exception& ex )
{
- LogError("Error while trying to append attachment " << attachment[i].attachment_path << ": " << ex.DumpToString());
+ LoggerE("Error while trying to append attachment " << attachment[i].attachment_path << ": " << ex.DumpToString());
}
}
if (!m_mail)
{
- LogDebug("m_mail is NULL");
+ LoggerD("m_mail is NULL");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Info is NULL.");
}
if (isBodyValid()) { return; }
if (!m_mail) {
- LogDebug("m_mail is NULL");
+ LoggerD("m_mail is NULL");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Mail is NULL.");
}
if (!m_mail->file_path_plain) {
- LogDebug("file_path_plain is NULL");
+ LoggerD("file_path_plain is NULL");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Plain Body is NULL.");
}
locationChecker = EmailUtils::isFrameworkEmailData(m_mail->file_path_plain);
if(locationChecker == true) // already exist palin body file on email frame work, we can not update that file so make new temp file
{
- LogDebug("create new plain body");
+ LoggerD("create new plain body");
char buf[] = "XXXXXX";
mode_t mask = umask(S_IWGRP | S_IWOTH);
error = mkstemp(buf);
umask(mask);
std::string bodyFile = buf;
bodyFile = EmailUtils::TMP_DIR_PREFIX+bodyFile;
- LogDebug("bodyFile : " << bodyFile);
+ LoggerD("bodyFile : " << bodyFile);
FILE* f = fopen(bodyFile.c_str(), "w");
if (NULL != f) {
}
else
{
- LogDebug("Plain Body file open fail : " << m_mail->file_path_plain);
+ LoggerD("Plain Body file open fail : " << m_mail->file_path_plain);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Plain Body File Open Error");
}
locationChecker = EmailUtils::isFrameworkEmailData(m_mail->file_path_html);
if((locationChecker == true) || (!m_mail->file_path_html)) // html file is not exist or exist on email frame work then create tmp html file
{
- LogDebug("create new html body");
+ LoggerD("create new html body");
char buf[] = "XXXXXX";
mode_t mask = umask(S_IWGRP | S_IWOTH);
error = mkstemp(buf);
umask(mask);
std::string htmlFile = buf;
htmlFile = EmailUtils::TMP_DIR_PREFIX+htmlFile;
- LogDebug("htmlFile : " << htmlFile);
+ LoggerD("htmlFile : " << htmlFile);
FILE* f = fopen(htmlFile.c_str(), "w");
if (NULL != f) {
}
else
{
- LogDebug("html Body file open fail : " << m_mail->file_path_html);
+ LoggerD("html Body file open fail : " << m_mail->file_path_html);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "html Body File Open Error");
}
if (isSubjectValid()) { return; }
- LogDebug("update subject, msgId=" << getIdRef());
+ LoggerD("update subject, msgId=" << getIdRef());
if (!m_mail) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Mail not allocated.");
if (isReadStatusValid()) { return; }
- LogDebug("update read, msgId=" << getIdRef());
+ LoggerD("update read, msgId=" << getIdRef());
if (!m_mail) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Mail not allocated.");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Mail is NULL.");
}
- LogDebug("getCurrentFolder() = " << getCurrentFolder() );
- LogDebug("m_mail->mail_id = " << m_mail->mail_id );
- LogDebug("m_mail->file_path_plain = " << m_mail->file_path_plain );
- LogDebug("m_mail->file_path_html = " << m_mail->file_path_html );
+ LoggerD("getCurrentFolder() = " << getCurrentFolder() );
+ LoggerD("m_mail->mail_id = " << m_mail->mail_id );
+ LoggerD("m_mail->file_path_plain = " << m_mail->file_path_plain );
+ LoggerD("m_mail->file_path_html = " << m_mail->file_path_html );
if(getCurrentFolder() == DRAFTBOX)
{
int attachmentCount = 0;
int error = email_get_attachment_data_list( m_mail->mail_id, &attachment, &attachmentCount);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("email_get_attachment_data_list [" << error << "]");
+ LoggerW("email_get_attachment_data_list [" << error << "]");
}
error = email_get_meeting_request(m_mail->mail_id, &meeting_req);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("email_get_meeting_request() failed [%d]\n" << error);
+ LoggerW("email_get_meeting_request() failed [%d]\n" << error);
}
error = email_update_mail( m_mail.Get(), attachment, attachmentCount, meeting_req, 0);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("Nothing to update or error. [" << error << "]");
+ LoggerW("Nothing to update or error. [" << error << "]");
}
if(meeting_req) {
{
error = email_free_attachment_data(&attachment, attachmentCount);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("email_free_attachment_data [" << error << "]");
+ LoggerW("email_free_attachment_data [" << error << "]");
}
}
LOG_ENTER
MailSender::getInstance(); //start email service
- LogDebug("getUID: " << getUID());
+ LoggerD("getUID: " << getUID());
if ( getUID() > 0 && m_accountId > 0)
{
update();
EmailAccountInfo account = getEmailAccount();
m_accountId = account.getIntId(); //set account ID
- LogDebug("account ID : " << m_accountId);
+ LoggerD("account ID : " << m_accountId);
m_mail.Reset(EmailService::createMailData(account));
updateSubject();
}
if ( mailbox->mailbox_id )
m_mail->mailbox_id = mailbox->mailbox_id;
- LogDebug("mail MailBox id :" << m_mail->mailbox_id);
+ LoggerD("mail MailBox id :" << m_mail->mailbox_id);
error = email_add_mail(m_mail.Get(), NULL, 0, NULL, 0);
if (EMAIL_ERROR_NONE != error) {
"Couldn't add message to mailbox. [" << error << "]");
}
- LogDebug("m_mail->mail_id =" << m_mail->mail_id);
+ LoggerD("m_mail->mail_id =" << m_mail->mail_id);
setId(convertId(m_mail->mail_id));
setFolderType(OUTBOX);
error = email_free_mailbox(&mailbox, 1);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mailbox: " << error);
+ LoggerE("Failed to destroy mailbox: " << error);
}
- LogDebug("m_mail->from" << m_mail->full_address_from);
+ LoggerD("m_mail->from" << m_mail->full_address_from);
email_mail_data_t* result = NULL;
MailSender::getInstance(); //start email service
- LogDebug("getUID: " << getUID());
+ LoggerD("getUID: " << getUID());
if ( getUID() > 0 && m_accountId > 0)
{
update();
EmailAccountInfo account = getEmailAccount();
m_accountId = account.getIntId(); //set account ID
- LogDebug("account ID : " << m_accountId);
+ LoggerD("account ID : " << m_accountId);
m_mail.Reset(EmailService::createMailData(account));
updateSubject();
}
if ( mailbox->mailbox_id )
m_mail->mailbox_id = mailbox->mailbox_id;
- LogDebug("mail MailBox id :" << m_mail->mailbox_id);
+ LoggerD("mail MailBox id :" << m_mail->mailbox_id);
error = email_add_mail(m_mail.Get(), NULL, 0, NULL, 0);
if (EMAIL_ERROR_NONE != error) {
"Couldn't add message to mailbox. [" << error << "]");
}
- LogDebug("message id =" << m_mail->mail_id);
+ LoggerD("message id =" << m_mail->mail_id);
setId(convertId(m_mail->mail_id));
setFolderType(DRAFTBOX);
error = email_free_mailbox(&mailbox, 1);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mailbox: " << error);
+ LoggerE("Failed to destroy mailbox: " << error);
}
- LogDebug("m_mail->from" << m_mail->full_address_from);
+ LoggerD("m_mail->from" << m_mail->full_address_from);
email_mail_data_t* result = NULL;
Try {
//clean attachment
- LogDebug("update attachments, msgId=" << getIdRef());
- LogDebug("m_mail->mail_id=" << m_mail->mail_id);
+ LoggerD("update attachments, msgId=" << getIdRef());
+ LoggerD("m_mail->mail_id=" << m_mail->mail_id);
error = email_get_attachment_data_list( m_mail->mail_id, &attachment, &attachmentCount); //get Attachment list
if (EMAIL_ERROR_NONE != error) {
ThrowMsg( WrtDeviceApis::Commons::PlatformException, "Couldn't get attachment list: ");
if ( attachmentCount > 0 )
{
- LogDebug("attachmentCount=" << attachmentCount);
+ LoggerD("attachmentCount=" << attachmentCount);
int i = 0;
std::stringstream stream;
for ( i = 0; i < attachmentCount; i++)
{
- LogDebug("file name:" << attachment[i].attachment_name << " file path :" << attachment[i].attachment_path);
+ LoggerD("file name:" << attachment[i].attachment_name << " file path :" << attachment[i].attachment_path);
int attachmentId = attachment[i].attachment_id;
int error = email_delete_attachment(attachmentId);
if (EMAIL_ERROR_NONE != error) {
- LogDebug("Error Num = " << error);
+ LoggerD("Error Num = " << error);
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"Error while adding attachment. [" << error << "]");
}
std::size_t attachmentSize = getAttachmentsCount();
std::size_t inlineAttachmentSize = getInlineAttachmentsCount();
- LogDebug("update attachments, attachmentSize=" << attachmentSize);
+ LoggerD("update attachments, attachmentSize=" << attachmentSize);
if (attachmentSize > 0)
{
email_attachment_data_t* attachment_info = NULL;
{
IAttachmentPtr att = getAttachment(i);
if (!att) {
- LogDebug("skip att" << i);
+ LoggerD("skip att" << i);
continue;
}
attachment_info->save_status = true;
attachment_info->inline_content_status = 0;
- LogDebug("attachment_info->attachment_name=" << attachment_info->attachment_name);
- LogDebug("attachment_info->attachment_path=" << attachment_info->attachment_path);
- LogDebug("attachment_info->save_status=" << attachment_info->save_status);
- LogDebug("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
+ LoggerD("attachment_info->attachment_name=" << attachment_info->attachment_name);
+ LoggerD("attachment_info->attachment_path=" << attachment_info->attachment_path);
+ LoggerD("attachment_info->save_status=" << attachment_info->save_status);
+ LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
- LogDebug("Copy Command=" << cp_cmd.str());
+ LoggerD("Copy Command=" << cp_cmd.str());
if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
- LogDebug("att->getFullPath().c_str()=" << att->getFullPath().c_str());
+ LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), buf)) {
- LogDebug("buf=" << buf);
+ LoggerD("buf=" << buf);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to copy file");
}
}
}
*/
- LogDebug("add Attachment");
+ LoggerD("add Attachment");
int error = email_add_attachment(m_mail->mail_id, attachment_info);
if (EMAIL_ERROR_NONE != error) {
- LogDebug("error :" << error);
+ LoggerD("error :" << error);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Error while adding attachment. [" << error << "]");
}
else
{
- LogDebug(" attachment id : " << attachment_info->attachment_id);
- LogDebug(" attachment inline : " << attachment_info->inline_content_status);
- LogDebug(" setNth(i+1) : " << i+1);
+ LoggerD(" attachment id : " << attachment_info->attachment_id);
+ LoggerD(" attachment inline : " << attachment_info->inline_content_status);
+ LoggerD(" setNth(i+1) : " << i+1);
att->setDownloaded(true);
att->setIsInlineAttachment(FALSE);
att->setAttachmentID(attachment_info->attachment_id);
}
}
- LogDebug("update attachments, inlineAttachmentSize=" << inlineAttachmentSize);
+ LoggerD("update attachments, inlineAttachmentSize=" << inlineAttachmentSize);
if (inlineAttachmentSize > 0)
{
email_attachment_data_t* attachment_info = NULL;
attachment_info->attachment_path = String::strdup( buf );
attachment_info->save_status = true;
attachment_info->inline_content_status = 1;
- LogDebug("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
+ LoggerD("attachment_info->inline_content_status=" << attachment_info->inline_content_status);
- LogDebug("Copy Command=" << cp_cmd.str());
+ LoggerD("Copy Command=" << cp_cmd.str());
if (EINA_TRUE != ecore_file_is_dir(att->getFullPath().c_str())) {
- LogDebug("att->getFullPath().c_str()=" << att->getFullPath().c_str());
+ LoggerD("att->getFullPath().c_str()=" << att->getFullPath().c_str());
if (EINA_TRUE != ecore_file_cp(att->getFullPath().c_str(), buf)) {
- LogDebug("buf=" << buf);
+ LoggerD("buf=" << buf);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to copy file");
}
}
*/
- LogDebug("add Attachment");
+ LoggerD("add Attachment");
int error = email_add_attachment(m_mail->mail_id, attachment_info);
if (EMAIL_ERROR_NONE != error) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
}
else
{
- LogDebug(" attachment id : " << attachment_info->attachment_id);
- LogDebug(" attachment inline : " << attachment_info->inline_content_status);
- LogDebug(" setNth(i+(int)attachmentSize+1) : " << i+(int)attachmentSize+1);
+ LoggerD(" attachment id : " << attachment_info->attachment_id);
+ LoggerD(" attachment inline : " << attachment_info->inline_content_status);
+ LoggerD(" setNth(i+(int)attachmentSize+1) : " << i+(int)attachmentSize+1);
att->setDownloaded(true);
att->setIsInlineAttachment(TRUE);
att->setAttachmentID(attachment_info->attachment_id);
// limitations under the License.
//
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
-
#include "EmailConverter.h"
+#include <Logger.h>
-#define LOG_ENTER LogDebug("---> ENTER");
-#define LOG_EXIT LogDebug("---> EXIT");
+#define LOG_ENTER LoggerD("---> ENTER");
+#define LOG_EXIT LoggerD("---> EXIT");
namespace DeviceAPI {
namespace Messaging {
// TODO Think it through, log is enough or exception should be thrown.
// ThrowMsg(WrtDeviceApis::Commons::PlatformException,
// "Unsupported platform priority: " << priority);
- LogWarning("Unsupported platform priority");
+ LoggerW("Unsupported platform priority");
}
}
#include "ScopedMail.h"
#include "ScopedMailbox.h"
-#define LOG_ENTER LogDebug("---> ENTER");
-#define LOG_EXIT LogDebug("---> EXIT");
+#define LOG_ENTER LoggerD("---> ENTER");
+#define LOG_EXIT LoggerD("---> EXIT");
namespace DeviceAPI {
namespace Messaging {
umask(mask);
std::string bodyFile = buf;
bodyFile = EmailUtils::TMP_DIR_PREFIX+bodyFile;
- LogDebug("bodyFile : " << bodyFile);
+ LoggerD("bodyFile : " << bodyFile);
FILE* f = fopen(bodyFile.c_str(), "w");
if (NULL != f) {
// if ( mailbox->mailbox_name )
// mail->mailbox_name = strdup(mailbox->mailbox_name);
-// LogDebug("mail MailBox Name :" << mail->mailbox_name);
+// LoggerD("mail MailBox Name :" << mail->mailbox_name);
error = email_free_mailbox(&mailbox, 1);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mailbox: " << error);
+ LoggerE("Failed to destroy mailbox: " << error);
}
}
}
}
LOG_EXIT
- LogDebug("Mail to MailBox, mail id = " << mail->mail_id );
+ LoggerD("Mail to MailBox, mail id = " << mail->mail_id );
return mail->mail_id;
}
}
LOG_EXIT
- LogDebug("Mail to MailBox, mail id = " << mail->mail_id );
+ LoggerD("Mail to MailBox, mail id = " << mail->mail_id );
return mail->mail_id;
}
#endif
int error = email_free_attachment_data(&attachment, 1);
if (EMAIL_ERROR_NONE != error) {
- LogWarning("Couldn't free attachment. [" << error << "]");
+ LoggerW("Couldn't free attachment. [" << error << "]");
}
LOG_EXIT
}
if (EMAIL_ERROR_NONE !=
email_set_flags_field(accountId, &mailId, 0, EMAIL_FLAGS_SEEN_FIELD, isReadChangeStatus, 1) )
{
- LogWarning("email_modify_seen_flag failed\n");
+ LoggerW("email_modify_seen_flag failed\n");
}
else
{
- LogWarning("email_modify_seen_flag SUCCESS\n");
+ LoggerW("email_modify_seen_flag SUCCESS\n");
}
}
else
{
- LogWarning("Invaild Account ID\n");
+ LoggerW("Invaild Account ID\n");
}
LOG_EXIT
#include <sstream>
#include <pcrecpp.h>
-
#include <Commons/Exception.h>
#include <Commons/StringBuilder.h>
#include <Commons/StringUtils.h>
#include "EmailUtils.h"
-#include <dpl/log/log.h>
#include <Manager.h>
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
if(filePath == NULL)
{
- LogDebug("filePath is NULL");
+ LoggerD("filePath is NULL");
return false;
}
- LogDebug("filePath : " << filePath);
+ LoggerD("filePath : " << filePath);
tempString1.assign(filePath);
tempString2.assign(EMAIL_DATA_FILE_PATH);
if(tempString1.compare(0,tempString2.size(), tempString2) == 0)
{
- LogDebug("email frame work files");
+ LoggerD("email frame work files");
return true;
}
else{
- LogDebug("tmp files");
+ LoggerD("tmp files");
return false;
}
//
#include "EmptyMessage.h"
-#include <dpl/log/log.h>
//#include <Commons/Exception.h>
//#include "ReqReceiverMessage.h>
#include "Messaging.h"
//#include <MapiMessage.h>
}
+#include <Logger.h>
+
using namespace std;
namespace DeviceAPI {
IMessage(EMPTY_MESSAGE, id),
m_messageData(NULL)
{
- LogDebug("enter");
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("enter");
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
}
EmptyMessage::~EmptyMessage()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_messageData) {
// release platform message structure
void EmptyMessage::update(bool /*draftsOnly*/)
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
}
void EmptyMessage::readAllData()
#include "FolderFilterValidator.h"
#include "FolderFilterValidatorFactory.h"
-
-#include <dpl/log/log.h>
#include "log.h"
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
MsgLogWanning(">>>[Warning] attrName:[" << attrName << "] is invalid value:[" << matchValue->toString() << "]");
return false;
}
- LogDebug("## 001 ##");
+ LoggerD("## 001 ##");
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
- LogDebug("## 002 ##");
- LogDebug(">>> retBool:" << retBool);
+ LoggerD("## 002 ##");
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
bool FolderFilterValidator::validateAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
if(attrName.compare(FolderFilterValidatorFactory::ATTRIBUTE_ACCOUNTID)==0){
- LogDebug("<<< m_isAccountIdSetted :[" << m_isAccountIdSetted << "]");
+ LoggerD("<<< m_isAccountIdSetted :[" << m_isAccountIdSetted << "]");
if(m_isAccountIdSetted == true){
- LogError(">>> [ERROR] duplicated account :[" << attrName << "], value:[" <<
+ LoggerE(">>> [ERROR] duplicated account :[" << attrName << "], value:[" <<
value->toString()<< "]");
return false;
}else{
#include "FolderQueryGenerator.h"
#include "FolderFilterValidatorFactory.h"
#include "ConversationFilterValidatorFactory.h"
-
#include "IMessagingTypes.h"
#include "log.h"
#include <Commons/Exception.h>
-
#include <email-types.h>
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
void FolderQueryGenerator::visitPreComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
}
void FolderQueryGenerator::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(type != INTERSECTION_FILTER){
- LogError("[ERROR] >>> invalid Filter type:" << type);
+ LoggerE("[ERROR] >>> invalid Filter type:" << type);
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid Fiilter Type");
return;
}
}
void FolderQueryGenerator::visitPostComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
}
bool FolderQueryGenerator::getMatchExactlyClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value)
std::string FolderQueryGenerator::getMatchStartsWithClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value){
std::string retClause;
- LogDebug("<<< NOT IMPLEMENTED YET");
+ LoggerD("<<< NOT IMPLEMENTED YET");
return retClause;
}
std::string FolderQueryGenerator::getMatchEndsWithClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value){
std::string retClause;
- LogDebug("<<< NOT IMPLEMENTED YET");
+ LoggerD("<<< NOT IMPLEMENTED YET");
return retClause;
}
std::string FolderQueryGenerator::getMatchContainsClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value){
std::string retClause;
- LogDebug("<<< NOT IMPLEMENTED YET");
+ LoggerD("<<< NOT IMPLEMENTED YET");
return retClause;
}
void FolderQueryGenerator::visitAttribute(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag,
DeviceAPI::Tizen::AnyPtr& matchValue, int depth){
- LogDebug("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
+ LoggerD("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
if(matchValue == NULL)
return;
- LogDebug("matchValue:" << matchValue->toString());
+ LoggerD("matchValue:" << matchValue->toString());
visitAttributeEach(attrName, matchFlag, matchValue, depth);
- LogDebug(">>>");
+ LoggerD(">>>");
}
void FolderQueryGenerator::visitAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
if(matchFlag == DeviceAPI::Tizen::MATCH_EXACTLY){
- LogDebug("STRING_MATCH_EXACTLY");
+ LoggerD("STRING_MATCH_EXACTLY");
getMatchExactlyClause(attrName, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_CONTAINS){
- LogDebug("STRING_MATCH_CONTAINS");
+ LoggerD("STRING_MATCH_CONTAINS");
getMatchContainsClause(attrName, value);
}else if(matchFlag== DeviceAPI::Tizen::MATCH_STARTSWITH){
- LogDebug("STRING_MATCH_STARTSWITH");
+ LoggerD("STRING_MATCH_STARTSWITH");
getMatchStartsWithClause(attrName, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_ENDSWITH){
- LogDebug("STRING_MATCH_ENDSWITH");
+ LoggerD("STRING_MATCH_ENDSWITH");
getMatchEndsWithClause(attrName, value);
}else{
- LogDebug("[ERROR]invalid match flag[" << matchFlag << "]");
+ LoggerD("[ERROR]invalid match flag[" << matchFlag << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid match flag:[" << matchFlag << "]");
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void FolderQueryGenerator::visitAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth) {
- LogDebug("<<< NOT IMPLEMENTED YET");
+ LoggerD("<<< NOT IMPLEMENTED YET");
}
int FolderQueryGenerator::getAccountId()
bool FolderQueryGenerator::isFolderPathExist()
{
- LogError("m_folderPathProcessing : " << m_folderPathProcessing);
+ LoggerE("m_folderPathProcessing : " << m_folderPathProcessing);
return m_folderPathProcessing;
}
//
#include <algorithm>
-#include <dpl/log/log.h>
#include <dpl/errno_string.h>
#include <Commons/Exception.h>
#include "IAttachment.h"
#include <stdlib.h>
}
+#include <Logger.h>
+
using namespace WrtDeviceApis::Commons;
using namespace std;
{
struct stat buffer;
std::string l_fullPath;
- LogDebug("FULL Path : " << fullPath);
+ LoggerD("FULL Path : " << fullPath);
if (isVirtualPath) {
- LogDebug("translating path");
+ LoggerD("translating path");
l_fullPath = getRealPath(fullPath);
} else {
l_fullPath = fullPath;
}
- LogDebug("real path " << l_fullPath);
+ LoggerD("real path " << l_fullPath);
char buff[PATH_MAX + 1];
if ((NULL == realpath(l_fullPath.c_str(), buff)) || (l_fullPath.size() > PATH_MAX + 1)) {
std::string errnoString = DPL::GetErrnoString();
- LogError("get full path problem " << errnoString);
+ LoggerE("get full path problem " << errnoString);
m_fileSize = 0;
m_attachFullPath = "";
m_attachShortName = "";
else
{
if (-1 == lstat(buff, &buffer)) {
- LogError("Attachment file not exist");
+ LoggerE("Attachment file not exist");
m_validAttachment = false;
}
if (!S_ISREG(buffer.st_mode)) {
- LogError("Attachment file not exist");
+ LoggerE("Attachment file not exist");
m_validAttachment = false;
}
m_fileSize = buffer.st_size;
}
}
Catch(WrtDeviceApis::Commons::Exception) {
- LogError("attachment not created properly");
+ LoggerE("attachment not created properly");
m_isCreatedProperly = false;
}
}
IAttachment::~IAttachment()
{
- LogDebug("enter");
+ LoggerD("enter");
}
string IAttachment::getShortName() const
char buff[PATH_MAX + 1];
if ( NULL != realpath(m_dummyFilePath.c_str(), buff))
{
- LogDebug("dummy File is valided " << m_dummyFilePath);
+ LoggerD("dummy File is valided " << m_dummyFilePath);
m_hasDummyFile = true;
}
else
{
std::string errnoString = DPL::GetErrnoString();
- LogError("get full path problem " << errnoString);
+ LoggerE("get full path problem " << errnoString);
m_hasDummyFile = false;
}
bool IAttachment::getIsValidAttachment() const
{
- LogError("m_validAttachment : " << m_validAttachment);
+ LoggerE("m_validAttachment : " << m_validAttachment);
return m_validAttachment;
}
// find position of last occurence of / sign (get only file name from all path
pos = m_attachFullPath.find_last_of("/");
if ((pos + 1) >= m_attachFullPath.size()) {
- LogError("Problem with short name creation");
+ LoggerE("Problem with short name creation");
Throw(InvalidArgumentException);
}
m_attachShortName = m_attachFullPath.substr(pos + 1);
//
#include "IBinarySms.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
IBinarySms::IBinarySms(const std::string& id) :
IMessage(BINARYSMS, id)
{
- LogDebug("enter");
+ LoggerD("enter");
}
IBinarySms::~IBinarySms()
{
- LogDebug("enter");
+ LoggerD("enter");
}
}
}
//
#include "IEmail.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
IEmail::IEmail(const string& id) : IMessage(EMAIL, id)
{
- LogInfo("enter");
+ LoggerI("enter");
}
IEmail::~IEmail()
{
- LogInfo("enter");
+ LoggerI("enter");
}
IEmail & IEmail::operator <<(const VirtualMessage& msg)
//
#include "IEmptyMessage.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
IEmptyMessage::IEmptyMessage(const string& id) :
IMessage(SMS, id)
{
- LogInfo("enter");
+ LoggerI("enter");
}
IEmptyMessage::~IEmptyMessage()
{
- LogInfo("enter");
+ LoggerI("enter");
}
}
//
#include <pcrecpp.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "IMessage.h"
#include "EventSendMessage.h"
#include "EventMessagingService.h"
+#include <Logger.h>
using namespace std;
m_requestReceiver(NULL),
m_sendMessageEvent(NULL)
{
- LogDebug("message creation, msgId=" << m_id << ", msgType=" << m_msgType);
+ LoggerD("message creation, msgId=" << m_id << ", msgType=" << m_msgType);
//initialize dateTime of message
time_t rawtime;
if (local) {
m_dateTime = *local;
} else {
- LogError("Failed to initialize message dateTime");
+ LoggerE("Failed to initialize message dateTime");
}
}
IMessage::~IMessage()
{
- LogDebug("destroying message, msgId=" << m_id << ", msgType=" << m_msgType);
+ LoggerD("destroying message, msgId=" << m_id << ", msgType=" << m_msgType);
}
string IMessage::getId() const
string IMessage::getCurrentUserFolder() const
{
if (m_folder != USERDEFINED_FOLDER) {
- LogError("folder is not user folder type");
+ LoggerE("folder is not user folder type");
Throw(WrtDeviceApis::Commons::UnknownException);
}
return m_userFolderName;
bool IMessage::validatePhoneNumber(std::string& number)
{
- LogDebug("testing number=" << number);
+ LoggerD("testing number=" << number);
return true;
/*
pcrecpp::RE re("[^0-9#\\+\\*]?");
re.GlobalReplace("", &number); //remove invailde phone number. phone Number were composed only number.
if (number.empty()) {
- LogError("wrong phoneNumber=" << number);
+ LoggerE("wrong phoneNumber=" << number);
return false;
}
- LogDebug("phoneNumber=" << number);
+ LoggerD("phoneNumber=" << number);
pcrecpp::RE re2("^[+#]?[0-9]{1,22}$");
if (re2.FullMatch(number)) {
- LogDebug("vaildate Number=" << number);
+ LoggerD("vaildate Number=" << number);
return true;
}
else
{
- LogDebug("invaildate Number=" << number);
+ LoggerD("invaildate Number=" << number);
return false;
}
*/
{
for (size_t i = 0; i < addr.getRecipientSize(); i++) {
if (false == validateEmailAddr(addr.getRecipient(i))) {
- LogError("wrong email address");
+ LoggerE("wrong email address");
return false;
}
}
".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"
);
if (re.FullMatch(email)) {
- LogDebug("emailAddress=" << email);
+ LoggerD("emailAddress=" << email);
return true;
}
- LogError("wrong emailAddress=" << email);
+ LoggerE("wrong emailAddress=" << email);
return false;
}
void IMessage::setMessageStatus( MessageStatus status)
{
- LogDebug("setMessageStatus : " << status);
+ LoggerD("setMessageStatus : " << status);
m_msgStatus = status;
}
#include "IMessagingService.h"
#include "EventGetMessagingService.h"
#include "EventMessagingService.h"\r
+#include <Logger.h>\r
\r
using namespace WrtDeviceApis::Commons;\r
\r
IMessagingService::IMessagingService() :\r
m_messagingServiceType(-1)\r
{\r
- LogDebug("create IMessagingService");\r
+ LoggerD("create IMessagingService");\r
}\r
\r
IMessagingService::~IMessagingService()\r
{\r
- LogDebug("destory IMessagingService");\r
+ LoggerD("destory IMessagingService");\r
}\r
void IMessagingService::setMessagingServiceEvent(const EventMessagingServicePtr &event)
void IMessagingService::OnCancelEvent(const EventMessagingServicePtr &event)\r
{\r
- LogDebug("<<<<<<<<<<<<<<<<< OnCancelEvent >>>>>>>>>>>>>>>>>>>>>> " );\r
- LogDebug(" OpID " << event->opId);\r
- LogDebug(" Handle " << event->getHandle());\r
- LogDebug(" event Type " << event->getEventType());\r
+ LoggerD("<<<<<<<<<<<<<<<<< OnCancelEvent >>>>>>>>>>>>>>>>>>>>>> " );\r
+ LoggerD(" OpID " << event->opId);\r
+ LoggerD(" Handle " << event->getHandle());\r
+ LoggerD(" event Type " << event->getEventType());\r
cancelOperation(event->opId, event->getHandle(), event->getEventType(), event->m_message);\r
return;\r
}\r
#ifndef WRTPLUGINS_API_IMESSAGING_SERVICE_H_
#define WRTPLUGINS_API_IMESSAGING_SERVICE_H_
-#include <dpl/log/log.h>
#include "IMessagingTypes.h"
#include <string>
#include <dpl/shared_ptr.h>
#define WRTPLUGINS_API_IMESSAGING_SERVICE_MANAGER_H_
#include <vector>
-#include <dpl/log/log.h>
#include "IMessagingTypes.h"
#include <dpl/shared_ptr.h>
#include "IMms.h"
#include "ValidityPeriodHours.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
IMessage(MMS, id),
m_mmsType(MULTIPART_MIXED)
{
- LogInfo("enter");
+ LoggerI("enter");
}
IMms::~IMms()
{
- LogInfo("enter");
+ LoggerI("enter");
}
IMms::MMSType IMms::getMmsType() const
//
#include "ISms.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
ISms::ISms(const string& id) :
IMessage(SMS, id)
{
- LogInfo("enter");
+ LoggerI("enter");
}
ISms::~ISms()
{
- LogInfo("enter");
+ LoggerI("enter");
}
ISms & ISms::operator <<(const VirtualMessage& msg)
#include "ConverterMessage.h"
#include <JSWebAPIError.h>
+#include <Logger.h>
using namespace std;
void JSConversation::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("JSConversation::initialize ");
+ LoggerD("JSConversation::initialize ");
JSConversationPriv* priv = static_cast<JSConversationPriv*>(JSObjectGetPrivate(object));
;
if (priv == NULL)
{
- LogDebug("Private data is null ");
+ LoggerD("Private data is null ");
}
else
{
- LogDebug("JSConversation::already exist ");
+ LoggerD("JSConversation::already exist ");
}
}
void JSConversation::finalize(JSObjectRef object) {
JSConversationPriv* priv = static_cast<JSConversationPriv*>(JSObjectGetPrivate(object));
- LogDebug("JSConversation::Finalize");
+ LoggerD("JSConversation::Finalize");
if (priv != NULL)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("OK");
+ LoggerD("OK");
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
// WrtDeviceApis::CommonsJavaScript::Converter converter(context);
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
return JSValueMakeUndefined(context);
}
return NULL;
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
if (JSStringIsEqualToUTF8CString(propertyName, CONVID)) {
return true;
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStringRef propertyName = NULL;
propertyName = JSStringCreateWithUTF8CString(CONVID);
const std::string& msgId)
{
IMessagePtr msg;
- LogDebug("createJSObject with account ");
+ LoggerD("createJSObject with account ");
Try
{
if (msgType == EMAIL)
{
- LogDebug("Account Address:" << &account);
- LogDebug("Account Data ,ID" << account.getId() << "name:" << account.getName() << " Account:" << account.getAddress());
+ LoggerD("Account Address:" << &account);
+ LoggerD("Account Data ,ID" << account.getId() << "name:" << account.getName() << " Account:" << account.getAddress());
msg = MessageFactory::createMessage(msgType, account, msgId);
if (!msg)
}
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("wrong message type, object not created");
+ LoggerE("wrong message type, object not created");
return JSValueMakeUndefined(context);
}
}
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("wrong message type, object not created");
+ LoggerE("wrong message type, object not created");
return JSValueMakeUndefined(context);
}
return createJSObject(context, msg, listener);
JSObjectRef jsValueRef = JSObjectMake(context, jsClassRef, static_cast<void*>(priv));
JSClassRelease(jsClassRef);
if (NULL == jsValueRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return JSValueMakeUndefined(context);
}
return jsValueRef;
JSValueRef JSMessage::createJSObject(JSContextRef context,
const IMessagePtr& msg)
{
- LogDebug("createJSObject");
+ LoggerD("createJSObject");
JSClassRef jsClassRef = JSClassCreate(getClassInfo());
- LogDebug("jsClassRef success");
+ LoggerD("jsClassRef success");
JSMessagePrivateObject* priv = new JSMessagePrivateObject(context, msg);
- LogDebug("priv success");
+ LoggerD("priv success");
JSObjectRef jsValueRef = JSObjectMake(context, jsClassRef, static_cast<void*>(priv));
- LogDebug("JSObjectMake success");
+ LoggerD("JSObjectMake success");
JSClassRelease(jsClassRef);
if (NULL == jsValueRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return JSValueMakeUndefined(context);
}
return jsValueRef;
}
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("wrong message type, object not created");
+ LoggerE("wrong message type, object not created");
return JSValueMakeUndefined(context);
}
return createJSObject(context, msg, NULL);
}
else
{
- LogError("message type is invalid");
+ LoggerE("message type is invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
return createJSObject(context, msg);
void JSMessage::initialize(JSContextRef context,
JSObjectRef object)
{
- LogInfo("enter");
+ LoggerI("enter");
if (!JSObjectGetPrivate(object))
{
JSMessagePrivateObject *priv = new JSMessagePrivateObject(context, msg);
if (!JSObjectSetPrivate(object, priv))
{
- LogInfo("set Private Failed...");
+ LoggerI("set Private Failed...");
delete priv;
}
}
{
JSMessagePrivateObject* priv = static_cast<JSMessagePrivateObject*>(JSObjectGetPrivate(object));
if (priv) {
- LogDebug("deleting private object");
+ LoggerD("deleting private object");
delete priv;
JSObjectSetPrivate(object, NULL);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("Main getProperty()");
+ LoggerI("Main getProperty()");
int index = 0;
// for non-NULL property names
while(m_property[index].name != NULL) {
JSValueRef value,
JSValueRef* exception)
{
- LogInfo("Main setProperty()");
+ LoggerI("Main setProperty()");
int index = 0;
// for non-NULL property names
while(m_property[index].name != NULL) {
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
return true;
}
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogInfo("enter");
+ LoggerI("enter");
JSStringRef propertyName = NULL;
int index = 0;
// repeat for each declared property - until null on property name
while(m_property[index].name != NULL) {
- LogDebug("Property: " << m_property[index].name);
+ LoggerD("Property: " << m_property[index].name);
propertyName = JSStringCreateWithUTF8CString(m_property[index].name);
JSPropertyNameAccumulatorAddName(propertyNames, propertyName);
JSStringRelease(propertyName);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
return JSValueMakeUndefined(context);
}
JSValueRef possibleInstance,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
return true;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try {
ArgumentValidator validator(context, argumentCount, arguments);
else
{
// this should never happen - message type checking done in stringToMessageType()
- LogError("message type is invalid");
+ LoggerE("message type is invalid");
throw TypeMismatchException("Invalid message type");
}
if (msg == NULL) {
- LogDebug("Message Creation failed");
+ LoggerD("Message Creation failed");
throw DeviceAPI::Common::UnknownException("Message has been not created");
}
if (dictionary != NULL)
{
- LogDebug ("##### msg type is " << msgType);
+ LoggerD ("##### msg type is " << msgType);
JSValueRef subjectData = JSUtil::getProperty(context, dictionary, MESSAGE_ATTRIBUTE_SUBJECT);
JSValueRef toData = JSUtil::getProperty(context, dictionary, MESSAGE_ATTRIBUTE_TO);
if (!JSValueIsUndefined(context, subjectData) )
{
std::string subject = JSUtil::JSValueToString(context, subjectData);
- LogDebug (" Subject : " << subject);
+ LoggerD (" Subject : " << subject);
switch (msgType)
{
case MMS:
}
default:
{
- LogError("message not supported");
+ LoggerE("message not supported");
//Throw(WrtDeviceApis::Commons::UnsupportedException);
//break;
}
if (!JSValueIsUndefined(context, toData) )
{
Recipients to = converter->toRecipients(toData);
- LogDebug("setting to field, size=" << to.getRecipientSize());
+ LoggerD("setting to field, size=" << to.getRecipientSize());
msg->setToRecipients(to);
}
//cc
if (!JSValueIsUndefined(context, htmlBodyData))
{
std::string body = JSUtil::JSValueToString(context, htmlBodyData);
- LogDebug("html body : " << body);
+ LoggerD("html body : " << body);
email->setHtmlBody(body);
}
if (!JSValueIsUndefined(context, plainBodyData) )
{
std::string body = JSUtil::JSValueToString(context, plainBodyData);
- LogDebug("plain body : " << body);
+ LoggerD("plain body : " << body);
msg->setBody(body);
}
}
//return
JSClassRef jsClassRef = JSClassCreate(JSMessage::getClassInfo());
- LogDebug("jsClassRef success");
+ LoggerD("jsClassRef success");
JSMessagePrivateObject* priv = new JSMessagePrivateObject(context, msg);
- LogDebug("priv success");
+ LoggerD("priv success");
JSObjectRef jsObjRef = JSObjectMake(context, jsClassRef, static_cast<void*>(priv));
- LogDebug("JSObjectMake success");
+ LoggerD("JSObjectMake success");
JSClassRelease(jsClassRef);
if (NULL == jsObjRef) {
- LogError("JSObject creation error");
+ LoggerE("JSObject creation error");
throw DeviceAPI::Common::UnknownException("JSObject make error");
}
return jsObjRef;
}
catch(BasePlatformException &bex) {
- LogError("Message creation failed: " << bex.getMessage());
+ LoggerE("Message creation failed: " << bex.getMessage());
JSObjectRef error = JSWebAPIError::makeJSWebAPIError(context, bex);
*exception = error;
return NULL;
JSType type,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
try {
GlobalContextManager *gcm = GlobalContextManager::getInstance();
if(gcm == NULL) {
- LogError("Failed to get GlobalContextManager");
+ LoggerE("Failed to get GlobalContextManager");
throw DeviceAPI::Common::UnknownException("Unable to receive global context");
}
JSContextRef globalContext = gcm->getGlobalContext(context);
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
MessageType msgType = msg->getMessageType();
- LogInfo("msgType=" << msgType);
+ LoggerI("msgType=" << msgType);
// prepare common values
JSCallbackManagerPtr emptyCallbackMgr = JSCallbackManager::createObject(globalContext, NULL, NULL);
}
int count = attachments.size();
- LogDebug( "count : " << count);
+ LoggerD( "count : " << count);
JSObjectRef jsMessageAttachmentObject[count]; //make
for (unsigned int index = 0 ; index < attachments.size(); index++ )
{
- LogDebug( "Attachment ID : " << attachments[index]->getAttachmentID());
+ LoggerD( "Attachment ID : " << attachments[index]->getAttachmentID());
jsMessageAttachmentObject[index] = JSMessageAttachment::createJS(globalContext, attachments[index] );
}
JSObjectRef result = JSObjectMakeArray(globalContext, count, jsMessageAttachmentObject, NULL);
JSObjectRef arrayValue = JSObjectMakeArray(globalContext, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
return arrayValue;
}
default:
- LogError("Not supported message type");
+ LoggerE("Not supported message type");
/* unsupported type -> type is integral message attribute
* so error at this place means internal api error*/
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
}
}
catch(BasePlatformException &bex) {
- LogError("Attachments getting failure: " << bex.getMessage());
+ LoggerE("Attachments getting failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting attachments.");
+ LoggerE("UnknownError when getting attachments.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
JSValueRef referr;
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
return arrayValue;
}
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
/* unsupported type -> type is integral message attribute
* so error at this place means internal api error*/
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
}
}
catch(BasePlatformException &bex) {
- LogError("BCC addressess getting failure: " << bex.getMessage());
+ LoggerE("BCC addressess getting failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting BCC addressess.");
+ LoggerE("UnknownError when getting BCC addressess.");
return JSValueMakeUndefined(context);
}
}
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Message body getting failure: " << bex.getMessage());
+ LoggerE("Message body getting failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting Message body.");
+ LoggerE("UnknownError when getting Message body.");
return JSValueMakeUndefined(context);;
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
JSValueRef referr;
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
return arrayValue;
}
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
/* unsupported type -> type is integral message attribute
* so error at this place means internal api error*/
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
}
}
catch(BasePlatformException &bex) {
- LogError("CC addressess getting failure: " << bex.getMessage());
+ LoggerE("CC addressess getting failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting CC addressess.");
+ LoggerE("UnknownError when getting CC addressess.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if (NULL == arrayValue)
{
- LogError("Could not create js array object");
+ LoggerE("Could not create js array object");
return JSValueMakeUndefined(context);
}
- LogError("getRecipientSize() : " << recipient->getRecipientSize());
+ LoggerE("getRecipientSize() : " << recipient->getRecipientSize());
JSValueRef referr;
for(size_t i = 0; i < recipient->getRecipientSize(); i++)
{
return arrayValue;
}
catch(BasePlatformException &bex) {
- LogError("Destination addressess getting failure: " << bex.getMessage());
+ LoggerE("Destination addressess getting failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting destination addressess.");
+ LoggerE("UnknownError when getting destination addressess.");
return JSValueMakeUndefined(context);
}
}
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Checking if message is read failure: " << bex.getMessage());
+ LoggerE("Checking if message is read failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when checking if message is read.");
+ LoggerE("UnknownError when checking if message is read.");
return JSValueMakeUndefined(context);
}
}
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
const string& id = msg->getIdRef();
- LogDebug("msgId=" << id);
- LogDebug("msg->getMessageStatus()=" << msg->getMessageStatus());
+ LoggerD("msgId=" << id);
+ LoggerD("msg->getMessageStatus()=" << msg->getMessageStatus());
if((id.size() == 0) && msg->getMessageStatus() == MESSAGE_STATUS_CREATED)
{
return JSValueMakeNull(context);
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message id failure: " << bex.getMessage());
+ LoggerE("Getting message id failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message id.");
+ LoggerE("UnknownError when getting message id.");
return JSValueMakeUndefined(context);
}
}
switch (msgType) {
case SMS:
case MMS:
- LogError("priority : false");
+ LoggerE("priority : false");
return converter->toJSValueRef(false);
case EMAIL:
{
IEmailPtr email = MessageFactory::convertToEmail(msg);
int tmpint = email->getPriority();
- LogError("priority : " << tmpint);
+ LoggerE("priority : " << tmpint);
if(tmpint == MessagePriority::HIGH)
{
return converter->toJSValueRef(true);
return converter->toJSValueRef(false);
}
default:
- LogError("unsupported message type");
+ LoggerE("unsupported message type");
/* unsupported type -> type is integral message attribute
* so error at this place means internal api error*/
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
}
}
catch(BasePlatformException &bex) {
- LogError("Getting message priority failure: " << bex.getMessage());
+ LoggerE("Getting message priority failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message priority.");
+ LoggerE("UnknownError when getting message priority.");
return JSValueMakeUndefined(context);
}
}
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message type failure: " << bex.getMessage());
+ LoggerE("Getting message type failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message type.");
+ LoggerE("UnknownError when getting message type.");
return JSValueMakeUndefined(context);
}
}
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
string from = msg->getSourceAddress();
- LogDebug("from =" << from);
+ LoggerD("from =" << from);
if(from.size() == 0)
{
- LogDebug("JSValueMakeNull");
+ LoggerD("JSValueMakeNull");
return JSValueMakeNull(context);
}
return converter->toJSValueRef(from);
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message source address failure: " << bex.getMessage());
+ LoggerE("Getting message source address failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message source address.");
+ LoggerE("UnknownError when getting message source address.");
return JSValueMakeUndefined(context);
}
}
case SMS:
return converter->toJSValueRef("");
default:
- LogError("message not support subject");
+ LoggerE("message not support subject");
/* unsupported type -> type is integral message attribute
* so error at this place means internal api error*/
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
}
}
catch(BasePlatformException &bex) {
- LogError("Getting message subject failure: " << bex.getMessage());
+ LoggerE("Getting message subject failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message subject.");
+ LoggerE("UnknownError when getting message subject.");
return JSValueMakeUndefined(context);
}
}
IMessagePtr msg = converter->toIMessage(object);
struct tm dateTime = msg->getDateTime();
const string& id = msg->getIdRef();
- LogDebug("msg->getMessageStatus()=" << msg->getMessageStatus());
- LogInfo("id.size() : " << id.size());
+ LoggerD("msg->getMessageStatus()=" << msg->getMessageStatus());
+ LoggerI("id.size() : " << id.size());
if((id.size() == 0) && msg->getMessageStatus() == MESSAGE_STATUS_CREATED)
{
- LogInfo("JSValueMakeNull");
+ LoggerI("JSValueMakeNull");
return JSValueMakeNull(context);
}
return converter->toJSValueRef(dateTime);
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message time failure: " << bex.getMessage());
+ LoggerE("Getting message time failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message time.");
+ LoggerE("UnknownError when getting message time.");
return JSValueMakeUndefined(context);
}
}
int tmpInt = msg->getMessageStatus();
- LogError("folder : " << folder);
- LogError("msg->getMessageStatus() : " << tmpInt);
+ LoggerE("folder : " << folder);
+ LoggerE("msg->getMessageStatus() : " << tmpInt);
if(tmpInt == MESSAGE_STATUS_CREATED)
{
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message folder failure: " << bex.getMessage());
+ LoggerE("Getting message folder failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message folder.");
+ LoggerE("UnknownError when getting message folder.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("getMessageBody");
+ LoggerI("getMessageBody");
try {
GlobalContextManager *gcm = GlobalContextManager::getInstance();
if(gcm == NULL) {
- LogError("Failed to get GlobalContextManager");
+ LoggerE("Failed to get GlobalContextManager");
throw DeviceAPI::Common::UnknownException("Unable to receive global context");
}
JSContextRef globalContext = gcm->getGlobalContext(context);
return JSMessageBody::createJS(globalContext, msg);
}
catch(BasePlatformException &bex) {
- LogError("Getting message body failure: " << bex.getMessage());
+ LoggerE("Getting message body failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message body.");
+ LoggerE("UnknownError when getting message body.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("getAccountID");
+ LoggerI("getAccountID");
try {
GlobalContextManager *gcm = GlobalContextManager::getInstance();
if(gcm == NULL) {
- LogError("Failed to get GlobalContextManager");
+ LoggerE("Failed to get GlobalContextManager");
throw DeviceAPI::Common::UnknownException("Unable to receive global context");
}
JSContextRef globalContext = gcm->getGlobalContext(context);
IMessagePtr msg = converter->toIMessage(object); //get message point
- LogInfo("create JS");
+ LoggerI("create JS");
//getAccountID
if (msg->getMessageType() == EMAIL)
{
}
}
catch(BasePlatformException &bex) {
- LogError("Getting account id failure: " << bex.getMessage());
+ LoggerE("Getting account id failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting account id.");
+ LoggerE("UnknownError when getting account id.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("getUID");
+ LoggerI("getUID");
try {
GlobalContextManager *gcm = GlobalContextManager::getInstance();
if(gcm == NULL) {
- LogError("Failed to get GlobalContextManager");
+ LoggerE("Failed to get GlobalContextManager");
throw DeviceAPI::Common::UnknownException("Unable to receive global context");
}
JSContextRef globalContext = gcm->getGlobalContext(context);
IMessagePtr msg = converter->toIMessage(object); //get message point
- LogInfo("create JS");
+ LoggerI("create JS");
//getAccountID
if (msg->getMessageType() == EMAIL)
{
}
}
catch(BasePlatformException &bex) {
- LogError("Getting account id failure: " << bex.getMessage());
+ LoggerE("Getting account id failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting account id.");
+ LoggerE("UnknownError when getting account id.");
return JSValueMakeUndefined(context);
}
}
JSValueRef value,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
if (JSIsArrayValue(context, value)) {
JSObjectRef valueObj = converter->toJSObjectRef(value);
unsigned int len = JSGetArrayLength(context, valueObj);
- LogDebug("Array Length = " << len);
+ LoggerD("Array Length = " << len);
for (unsigned int i = 0; i < len; ++i)
{
JSValueRef att = JSObjectGetPropertyAtIndex(context, valueObj, i, NULL);
if (JSValueIsUndefined(context, att) || JSValueIsNull(context, att)) {
- LogWarning("Invalid array element. Skipping.");
+ LoggerW("Invalid array element. Skipping.");
continue;
}
IAttachmentPtr attachment = converter->toIAttachment(att);
if(attachment->getIsValidAttachment() == false)
{
- LogDebug("invalid attachment : " << i);
+ LoggerD("invalid attachment : " << i);
throw DeviceAPI::Common::InvalidValuesException("Invalid attachment in array");
}
- LogDebug("Adding attachment , shotname: " << attachment->getShortName());
+ LoggerD("Adding attachment , shotname: " << attachment->getShortName());
attachments.push_back(attachment);
}
}
else
{
IAttachmentPtr attachment = converter->toIAttachment(value);
- LogDebug("Adding attachment , shotname: " << attachment->getShortName());
+ LoggerD("Adding attachment , shotname: " << attachment->getShortName());
if(attachment->getIsValidAttachment() == false)
{
- LogDebug("invalid attachment");
+ LoggerD("invalid attachment");
throw DeviceAPI::Common::InvalidValuesException("Invalid attachments array");
}
attachments.push_back(attachment);
}
- LogDebug("Attachment Size =" << attachments.size());
+ LoggerD("Attachment Size =" << attachments.size());
if ( attachments.size() > 0)
{
IMessagePtr msg = converter->toIMessage(object);
break;
}
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
break;
}
}
else
{
- LogError("Message converter failed...");
+ LoggerE("Message converter failed...");
throw DeviceAPI::Common::UnknownException("Message conversion failure");
}
}
}
catch(BasePlatformException &bex) {
- LogError("Setting attachments failed: " << bex.getMessage());
+ LoggerE("Setting attachments failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting attachments.");
+ LoggerE("UnknownError when setting attachments.");
return true;
}
return true;
JSValueRef value,
JSValueRef* exception)
{
- LogInfo("enter");
+ LoggerI("enter");
Try
{
}
}
Catch(WrtDeviceApis::Commons::NullPointerException) {
- LogError("Error on pointer, null value");
+ LoggerE("Error on pointer, null value");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
JSValueRef att = JSGetArrayElement(context, valueObj, i);
if (JSValueIsUndefined(context,
att) || JSValueIsNull(context, att)) {
- LogWarning("Invalid array element. Skipping.");
+ LoggerW("Invalid array element. Skipping.");
continue;
}
DeviceAPI::Filesystem::INodePtr node = converter->toFilesystemNode(
att);
- LogDebug("Adding attachment: " << node->getPath()->getFullPath());
+ LoggerD("Adding attachment: " << node->getPath()->getFullPath());
attachments.push_back(node->getPath()->getFullPath());
}
} else {
- LogWarning("Invalid or null element passed as attachment array." <<
+ LoggerW("Invalid or null element passed as attachment array." <<
"Setting empty vector.");
}
return false; // ignore
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
return true;
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("Error on conversion");
+ LoggerE("Error on conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::NullPointerException) {
- LogError("Error on pointer, null value");
+ LoggerE("Error on pointer, null value");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogError("Invalid argument");
+ LoggerE("Invalid argument");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
Recipients bcc = converter->toRecipients(value);
- LogDebug("setting bcc field, size=" << bcc.getRecipientSize());
+ LoggerD("setting bcc field, size=" << bcc.getRecipientSize());
MessageType msgType = msg->getMessageType();
switch (msgType) {
break;
}
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
break;
}
return true;
}
catch(BasePlatformException &bex) {
- LogError("Setting BCC addresses failed: " << bex.getMessage());
+ LoggerE("Setting BCC addresses failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting BCC addresses.");
+ LoggerE("UnknownError when setting BCC addresses.");
return true;
}
return true;
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Setting BCC addresses failed: " << bex.getMessage());
+ LoggerE("Setting BCC addresses failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting BCC addresses.");
+ LoggerE("UnknownError when setting BCC addresses.");
return true;
}
return true;
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
Recipients cc = converter->toRecipients(value);
- LogDebug("setting cc field, size=" << cc.getRecipientSize());
+ LoggerD("setting cc field, size=" << cc.getRecipientSize());
MessageType msgType = msg->getMessageType();
switch (msgType) {
break;
}
default:
- LogError("unsuported message type");
+ LoggerE("unsuported message type");
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
break;
}
return true;
}
catch(BasePlatformException &bex) {
- LogError("Setting CC addresses failed: " << bex.getMessage());
+ LoggerE("Setting CC addresses failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting CC addresses.");
+ LoggerE("UnknownError when setting CC addresses.");
return true;
}
return true;
JSValueRef value,
JSValueRef * exception)
{
- LogInfo("enter");
+ LoggerI("enter");
try
{
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagePtr msg = converter->toIMessage(object);
Recipients to = converter->toRecipients(value);
- LogDebug("setting to field, size=" << to.getRecipientSize());
+ LoggerD("setting to field, size=" << to.getRecipientSize());
msg->setToRecipients(to);
return true;
}
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Setting destination addresses failed: " << bex.getMessage());
+ LoggerE("Setting destination addresses failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting destination addresses.");
+ LoggerE("UnknownError when setting destination addresses.");
return true;
}
return true;
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Setting destination addresses failed: " << bex.getMessage());
+ LoggerE("Setting destination addresses failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting destination addresses.");
+ LoggerE("UnknownError when setting destination addresses.");
return true;
}
return true;
break;
default:
- LogError("unsuported message type");
+ LoggerE("unsuported message type");
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
break;
}
return true;
}
catch(BasePlatformException &bex) {
- LogError("Setting message priority failed: " << bex.getMessage());
+ LoggerE("Setting message priority failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting message priority.");
+ LoggerE("UnknownError when setting message priority.");
return true;
}
return true;
return true; // ignore
default:
- LogError("message not supported");
+ LoggerE("message not supported");
throw DeviceAPI::Common::NotSupportedException("Unsupported message type");
break;
}
return true;
}
catch(BasePlatformException &bex) {
- LogError("Setting message priority failed: " << bex.getMessage());
+ LoggerE("Setting message priority failed: " << bex.getMessage());
return true;
}
catch(...) {
- LogError("UnknownError when setting message priority.");
+ LoggerE("UnknownError when setting message priority.");
return true;
}
return true;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getConversationId");
+ LoggerD("getConversationId");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
int convId = 0;
IMessagePtr msg = converter->toIMessage(object);
- LogDebug("msg->getMessageStatus()=" << msg->getMessageStatus());
- LogDebug("msg.getConvId()=" << msg->getConvId());
+ LoggerD("msg->getMessageStatus()=" << msg->getMessageStatus());
+ LoggerD("msg.getConvId()=" << msg->getConvId());
convId = msg->getConvId();
if((msg->getConvId() == -1) && msg->getMessageStatus() == MESSAGE_STATUS_CREATED)
{
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting conversation id failure: " << bex.getMessage());
+ LoggerE("Getting conversation id failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting conversation id.");
+ LoggerE("UnknownError when getting conversation id.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("getInResponseTo");
+ LoggerD("getInResponseTo");
try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
if (msg->getMessageType() != EMAIL)
{
- LogDebug("not EMAIL type return empty string");
+ LoggerD("not EMAIL type return empty string");
return converter->toJSValueRef("");
}
IEmailPtr email = MessageFactory::convertToEmail(msg);
msgId = email->getUID();
- LogDebug("msg.getConvId()=" << msg->getConvId());
+ LoggerD("msg.getConvId()=" << msg->getConvId());
convId = msg->getConvId();
if (convId == msgId)
{
- LogDebug("Not forwared and replied, return empty string");
+ LoggerD("Not forwared and replied, return empty string");
return converter->toJSValueRef("");
}
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting in response to failure: " << bex.getMessage());
+ LoggerE("Getting in response to failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting in response to.");
+ LoggerE("UnknownError when getting in response to.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("getMessageStatus");
+ LoggerI("getMessageStatus");
try
{
IMessagePtr msg = converter->toIMessage(object); //get message point
- LogInfo("create JS");
+ LoggerI("create JS");
return converter->toJSValueRef(converter->toMessageStatusType(msg->getMessageStatus()));
}
catch(BasePlatformException &bex) {
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting message status failure: " << bex.getMessage());
+ LoggerE("Getting message status failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting message status.");
+ LoggerE("UnknownError when getting message status.");
return JSValueMakeUndefined(context);
}
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogInfo("hasAttachment");
+ LoggerI("hasAttachment");
Try {
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
/* Currently this exception will not be caught here as converter
* is using od-style, DPL exceptions. This catch sections
* is prepared for future converter refactoring */
- LogError("Getting hasAttachment flag failure: " << bex.getMessage());
+ LoggerE("Getting hasAttachment flag failure: " << bex.getMessage());
return JSValueMakeUndefined(context);
}
catch(...) {
- LogError("UnknownError when getting hasAttachment flag.");
+ LoggerE("UnknownError when getting hasAttachment flag.");
return JSValueMakeUndefined(context);
}
}
#ifndef JSMESSAGE_H
#define JSMESSAGE_H
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "IMessagingTypes.h"
#include "IMessage.h"
#include "EventUpdateMessage.h"
#include "JSMessageBody.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
*/
static JSClassRef jsInit(JSContextRef context)
{
- LogInfo("enter");
+ LoggerI("enter");
return JSClassCreate(&m_classInfo);
}
static const JSClassDefinition* getClassInfo()
{
- LogInfo("enter");
+ LoggerI("enter");
return &(m_classInfo);
}
static JSClassRef getClassRef()
{
- LogInfo("enter");
+ LoggerI("enter");
if (!m_jsClassRef) {
m_jsClassRef = JSClassCreate(&m_classInfo);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "ConverterMessage.h"
#include <JSWebAPIError.h>
#include <ArgumentValidator.h>
+#include <Logger.h>
#if 0
namespace {
void JSMessageAttachment::initialize(JSContextRef context,
JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
if (!JSObjectGetPrivate(object)) {
- LogDebug("Private object not set... setting it.");
+ LoggerD("Private object not set... setting it.");
IAttachmentPtr attachment(new Attachment());
JSMessageAttachmentPrivate *priv = new JSMessageAttachmentPrivate(context, attachment);
void JSMessageAttachment::finalize(JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
JSMessageAttachmentPrivate* priv = static_cast<JSMessageAttachmentPrivate*>(JSObjectGetPrivate(object));
JSContextRef gContext = priv->getContext();
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
IAttachmentPtr attachment = getAttachment(context, object);
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
- LogDebug("mine type :" << attachment->getMimeType());
+ LoggerD("mine type :" << attachment->getMimeType());
if (attachment->getMimeType().size() == 0)
{
- LogDebug("return NULL");
+ LoggerD("return NULL");
return JSValueMakeNull(context);
}
return converter.toJSValueRef(attachment->getMimeType());
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
IAttachmentPtr attachment = getAttachment(context, object);
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
- LogDebug("Message ID :" << (attachment->getMessage()));
+ LoggerD("Message ID :" << (attachment->getMessage()));
if ( (attachment->getAttachmentID() < 0) && (attachment->getMessage() == 0))
{
- LogDebug("return NULL");
+ LoggerD("return NULL");
return JSValueMakeNull(context);
}
return converter.toJSValueRef(attachment->getMessage()->getId());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("invalid value conversion");
+ LoggerE("invalid value conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Unkown Exception");
+ LoggerE("Unkown Exception");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
IAttachmentPtr attachment = getAttachment(context, object);
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
- LogDebug("Attachment Loaded :" << (attachment->getDownloaded() ));
+ LoggerD("Attachment Loaded :" << (attachment->getDownloaded() ));
if ( attachment->getAttachmentID() < 0)
{
- LogDebug("return NULL");
+ LoggerD("return NULL");
return JSValueMakeNull(context);
}
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("invalid value conversion");
+ LoggerE("invalid value conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Unkown Exception");
+ LoggerE("Unkown Exception");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
IAttachmentPtr attachment = getAttachment(context, object);
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
- LogDebug("Attachment Loaded :" << (attachment->getDownloaded() ));
+ LoggerD("Attachment Loaded :" << (attachment->getDownloaded() ));
return converter.toJSValueRef(attachment->getDownloaded());
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("invalid value conversion");
+ LoggerE("invalid value conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Unkown Exception");
+ LoggerE("Unkown Exception");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
JSMessageAttachmentPrivate* priv = static_cast<JSMessageAttachmentPrivate*>(JSObjectGetPrivate(object));
if (priv)
- LogDebug("priv is vaild");
+ LoggerD("priv is vaild");
JSContextRef globalContext = priv ? priv->getContext() : context;
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
std::string fullPath = attachment->getFullPath();
- LogDebug("fullPath=" << fullPath);
+ LoggerD("fullPath=" << fullPath);
if (fullPath.empty()) {
return JSValueMakeNull(context);
std::string filePath;
Try {
filePath = DeviceAPI::Filesystem::Utils::toVirtualPath(globalContext, fullPath);
- LogDebug("return virtual path : " << filePath);
+ LoggerD("return virtual path : " << filePath);
return converter.toJSValueRef(filePath);
}
catch (WrtDeviceApis::Commons::ConversionException)
{
- LogDebug("return real path : " << fullPath);
+ LoggerD("return real path : " << fullPath);
return converter.toJSValueRef(fullPath);
/*
- LogDebug("It is not in the the list of root locations ");
+ LoggerD("It is not in the the list of root locations ");
if (attachment->hasDummyFile())
{
- LogDebug("Get Dummy File Path " << attachment->getDummyFilePath());
+ LoggerD("Get Dummy File Path " << attachment->getDummyFilePath());
filePath = attachment->getDummyFilePath();
}
else
{
- LogDebug("Create DummyFile");
+ LoggerD("Create DummyFile");
std::string tmpPath = AttachmentFactory::getDummyFileFromRealPath(globalContext, fullPath);
- LogDebug("tmp Path : " << tmpPath);
+ LoggerD("tmp Path : " << tmpPath);
if (tmpPath.length())
{
attachment->setDummyFilePath(tmpPath);
if ( !attachment->hasDummyFile())
{
- LogDebug("dummy File Path is invalided But Can't access this file.");
+ LoggerD("dummy File Path is invalided But Can't access this file.");
return JSValueMakeNull(context);
}
else
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("invalid value conversion");
+ LoggerE("invalid value conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Unkown Exception");
+ LoggerE("Unkown Exception");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
}
/* // MESSAGING ATTACHMENT IS BLOCKED
- LogDebug("enter");
+ LoggerD("enter");
Try
{
IAttachmentPtr attachment = getAttachment(context, object);
}
std::string fullPath = attachment->getFullPath();
- LogDebug("full Path = " << fullPath );
+ LoggerD("full Path = " << fullPath );
if (fullPath.empty()) {
return JSValueMakeUndefined(context);
}
WrtDeviceApis::Commons::ExceptionCodes::Enumeration code = event->getExceptionCode();
if (code != WrtDeviceApis::Commons::ExceptionCodes::None) {
- LogError("Attachment location not resolved. Exception code: " << code);
+ LoggerE("Attachment location not resolved. Exception code: " << code);
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
DeviceAPI::Filesystem::INodePtr node = event->getResult();
if (!node) {
- LogError("Resolved attachment location is empty.");
+ LoggerE("Resolved attachment location is empty.");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
DeviceAPI::Filesystem::IPathPtr path = node->getPath();
- LogError(" Path = " << path->getPath() << " Full Path = " << path->getFullPath());
+ LoggerE(" Path = " << path->getPath() << " Full Path = " << path->getFullPath());
JSObjectRef result = WrtDeviceApis::CommonsJavaScript::JSUtils::makeObject(context,
JSFile::getClassRef(),
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("invalid value conversion");
+ LoggerE("invalid value conversion");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Unkown Exception");
+ LoggerE("Unkown Exception");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
JSMessageAttachmentPrivate* thisPrivate =
static_cast<JSMessageAttachmentPrivate*>(JSObjectGetPrivate(thisObject));
if (!thisPrivate) {
- LogError("no private");
+ LoggerE("no private");
Throw(WrtDeviceApis::Commons::NullPointerException);
}
return thisPrivate;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
std::string path = validator.toString(0);
std::string mimetype = validator.toString(1, true);
- LogDebug("path size() : " << path.size());
+ LoggerD("path size() : " << path.size());
if(path.size() != 0)
{
DeviceAPI::Filesystem::IPathPtr src = DeviceAPI::Filesystem::Utils::fromVirtualPath(context, path);
if (src)
{
- LogDebug("path size() : " << path.size());
+ LoggerD("path size() : " << path.size());
path = src->getFullPath();
}
else
{
- LogDebug("path size() : " << path.size());
+ LoggerD("path size() : " << path.size());
path = ""; //set empty string.
}
}
else
{
- LogDebug("path size() : " << path.size());
+ LoggerD("path size() : " << path.size());
path = ""; //set empty string.
}
- LogDebug("real path = " << path);
+ LoggerD("real path = " << path);
IAttachmentPtr attachment = AttachmentFactory::createAttachment(
path,
mimetype);
if (attachment)
{
JSClassRef jsClassRef = JSClassCreate(getClassInfo());
- LogDebug("jsClassRef success");
+ LoggerD("jsClassRef success");
JSMessageAttachmentPrivate* priv = new JSMessageAttachmentPrivate(context, attachment);
- LogDebug("priv success");
+ LoggerD("priv success");
JSObjectRef jsObjRef = JSObjectMake(context, jsClassRef, static_cast<void*>(priv));
- LogDebug("JSObjectMake success");
+ LoggerD("JSObjectMake success");
JSClassRelease(jsClassRef);
if (NULL == jsObjRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
throw DeviceAPI::Common::UnknownException("JSObject make error");
}
return jsObjRef;
}
else
{
- LogDebug("attachment can't create");
+ LoggerD("attachment can't create");
throw DeviceAPI::Common::UnknownException("attachment create failed");
}
}catch(BasePlatformException & e) {
- LogError("Message creation failed: " << e.getMessage());
+ LoggerE("Message creation failed: " << e.getMessage());
JSObjectRef error = JSWebAPIError::makeJSWebAPIError(context, e);
*exception = error;
}
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("OK");
+ LoggerD("OK");
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
// WrtDeviceApis::CommonsJavaScript::Converter converter(context);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
return JSValueMakeUndefined(context);
}
return NULL;
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
if (JSStringIsEqualToUTF8CString(propertyName, ATTACHMENTID)) {
return true;
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStringRef propertyName = NULL;
propertyName = JSStringCreateWithUTF8CString(ATTACHMENTID);
//
#include <iomanip>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include "ConverterMessage.h"
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "MessagingErrorMsg.h"
-
#include "JSMessageAttachment.h"
-
#include <JSWebAPIError.h>
#include <ArgumentValidator.h>
#include <JSUtil.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
void JSMessageBody::initialize(JSContextRef context,
JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
}
void JSMessageBody::finalize(JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
JSMessageBodyPrivate* priv = static_cast<JSMessageBodyPrivate*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
delete priv;
{
JSMessageBodyPrivate* thisPrivate = static_cast<JSMessageBodyPrivate*>(JSObjectGetPrivate(thisObject));
if (!thisPrivate) {
- LogError("no private");
+ LoggerE("no private");
Throw(WrtDeviceApis::Commons::NullPointerException);
}
return thisPrivate;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
try {
IMessagePtr msg = getMessage(context, object);
if (JSStringIsEqualToUTF8CString(propertyName, MSGID)) {
std::string id = msg->getId();
- LogDebug("msgId=" << id);
- LogDebug("msg->getMessageStatus()=" << msg->getMessageStatus());
+ LoggerD("msgId=" << id);
+ LoggerD("msg->getMessageStatus()=" << msg->getMessageStatus());
if((id.size() == 0) && (msg->getMessageStatus() == MESSAGE_STATUS_CREATED)) {
id = "";
}
return JSUtil::toJSValueRef(context, email->isBodyDownloaded() > 0 ? true : false);
}
else {
- LogDebug("msgId=" << msg->getId());
- LogDebug("msg->getMessageStatus()=" << msg->getMessageStatus());
+ LoggerD("msgId=" << msg->getId());
+ LoggerD("msg->getMessageStatus()=" << msg->getMessageStatus());
if ((msg->getId().size() == 0) && msg->getMessageStatus() == MESSAGE_STATUS_CREATED) {
return JSUtil::toJSValueRef(context, false);
}
}
else if (JSStringIsEqualToUTF8CString(propertyName, PLAINBODY)) {
std::string body = msg->getBody();
- LogDebug("getPlainBody plainBody" << body );
+ LoggerD("getPlainBody plainBody" << body );
return JSUtil::toJSValueRef(context, body);
}
else if (JSStringIsEqualToUTF8CString(propertyName, HTMLBODY)) {
- LogDebug("message Type : " << msg->getMessageType() );
+ LoggerD("message Type : " << msg->getMessageType() );
std::string emailHtmlBody = "";
if (msg->getMessageType() == EMAIL) {
IEmailPtr email = MessageFactory::convertToEmail(msg);
emailHtmlBody = email->getHtmlBody();
- LogDebug("Html Body : " << emailHtmlBody );
+ LoggerD("Html Body : " << emailHtmlBody );
}
return JSUtil::toJSValueRef(context, emailHtmlBody);
}
inlineAttachments = emailAttachments->getInlineAttachments();
count = inlineAttachments.size();
- LogDebug( "attachments.size(): " << count);
+ LoggerD( "attachments.size(): " << count);
JSObjectRef jsMessageAttachmentObject[count]; //make
for(int i = 0; i < count; i++) {
- LogDebug("Attachment ID: " << inlineAttachments[i]->getAttachmentID());
+ LoggerD("Attachment ID: " << inlineAttachments[i]->getAttachmentID());
jsMessageAttachmentObject[i] = JSMessageAttachment::createJS(context, inlineAttachments[i]);
}
JSObjectRef result = JSObjectMakeArray(context, count, jsMessageAttachmentObject, NULL);
{
JSObjectRef arrayValue = JSObjectMakeArray(context, 0, NULL, NULL);
if(NULL == arrayValue){
- LogError("Could not create JS array object");
+ LoggerE("Could not create JS array object");
return JSValueMakeUndefined(context);
}
return arrayValue;
}
}
else {
- LogDebug("Not supported property.");
+ LoggerD("Not supported property.");
}
}
catch (const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSValueMakeUndefined(context);
}
catch (const WrtDeviceApis::Commons::Exception& err) {
- LogError(err.GetMessage().c_str());
+ LoggerE(err.GetMessage().c_str());
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
try {
if (JSStringIsEqualToUTF8CString(propertyName, MSGID)) {
IMessagePtr msg = getMessage(context, object);
std::string body = JSUtil::JSValueToString(context, value);
msg->setBody(body);
- LogDebug("setPlainBody plainBody" << body );
+ LoggerD("setPlainBody plainBody" << body );
return true;
}
else if (JSStringIsEqualToUTF8CString(propertyName, HTMLBODY)) {
{
IEmailPtr email = MessageFactory::convertToEmail(msg);
std::string body = JSUtil::JSValueToString(context, value);
- LogDebug("input String : " << body);
+ LoggerD("input String : " << body);
email->setHtmlBody(body);
return true;
}
if (JSIsArrayValue(context, value)) {
JSObjectRef valueObj = converter->toJSObjectRef(value);
unsigned int len = JSGetArrayLength(context, valueObj);
- LogDebug("Array Length = " << len);
+ LoggerD("Array Length = " << len);
for (unsigned int i = 0; i < len; ++i) {
JSValueRef att = JSGetArrayElement(context, valueObj, i);
if (JSValueIsUndefined(context, att) || JSValueIsNull(context, att)) {
- LogWarning("Invalid array element. Skipping.");
+ LoggerW("Invalid array element. Skipping.");
continue;
}
IAttachmentPtr attachment = converter->toIAttachment(att);
throw DeviceAPI::Common::InvalidValuesException(logMsg.c_str());
}
- LogDebug("Adding attachment , shortname: " << attachment->getShortName());
+ LoggerD("Adding attachment , shortname: " << attachment->getShortName());
inlineAttachments.push_back(attachment);
}
}
else {
IAttachmentPtr attachment = converter->toIAttachment(value);
- LogDebug("Adding attachment , shortname: " << attachment->getShortName());
+ LoggerD("Adding attachment , shortname: " << attachment->getShortName());
if (attachment->getIsValidAttachment() == false) {
throw DeviceAPI::Common::InvalidValuesException("Invalid attachment.");
}
inlineAttachments.push_back(attachment);
}
- LogDebug("inlineAttachments Size =" << inlineAttachments.size());
+ LoggerD("inlineAttachments Size =" << inlineAttachments.size());
if ( inlineAttachments.size() > 0) {
IMessagePtr msg = converter->toIMessage(object);
if (msg) {
return true;
}
else {
- LogDebug("Not supported property.");
+ LoggerD("Not supported property.");
}
}
catch (const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return true;
}
catch (const WrtDeviceApis::Commons::Exception& err) {
- LogError(err.GetMessage().c_str());
+ LoggerE(err.GetMessage().c_str());
return true;
}
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStringRef propertyName = NULL;
propertyName = JSStringCreateWithUTF8CString(MSGID);
#include "IMessagingTypes.h"
#include <JSWebAPIError.h>
-
+#include <Logger.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
void JSMessageFolder::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("JSMessageFolder::initialize ");
+ LoggerD("JSMessageFolder::initialize ");
JSMessageFolderPriv* priv = static_cast<JSMessageFolderPriv*>(JSObjectGetPrivate(object));
if (priv == NULL)
}
else
{
- LogDebug("JSMessageFolder::already exist ");
+ LoggerD("JSMessageFolder::already exist ");
}
}
void JSMessageFolder::finalize(JSObjectRef object) {
JSMessageFolderPriv* priv = static_cast<JSMessageFolderPriv*>(JSObjectGetPrivate(object));
- LogDebug("JSMessageFolder::Finalrize");
+ LoggerD("JSMessageFolder::Finalrize");
if (priv != NULL)
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("<<<");
+ LoggerD("<<<");
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
JSMessageFolderPriv* priv = static_cast<JSMessageFolderPriv*>(JSObjectGetPrivate(object));
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
return JSValueMakeUndefined(context);
}
return NULL;
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
try
}
catch(const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
return true;
}
return false;
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStringRef propertyName = NULL;
propertyName = JSStringCreateWithUTF8CString(FOLDERID);
}
void JSMessagingService::initialize(JSContextRef context, JSObjectRef object) {
- LogDebug("creation messaging Service instance");
+ LoggerD("creation messaging Service instance");
}
void JSMessagingService::finalize(JSObjectRef object) {
- LogDebug("finalize messaging instance");
+ LoggerD("finalize messaging instance");
//JSMessagingServicePriv *priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(object));
JSMessagingServicePriv *priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(object));
delete priv;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(object)); //get private object
if (!priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
if (JSStringIsEqualToUTF8CString(propertyName, MESSAGING_SERVICE_TYPE)) {
- LogDebug("type" << ": " << imessagingService->getType());
+ LoggerD("type" << ": " << imessagingService->getType());
return JSUtil::toJSValueRef(context, converter->toMessageType(imessagingService->getType()));
}
else if (JSStringIsEqualToUTF8CString(propertyName, MESSAGING_SERVICE_NAME)) {
- LogDebug("name : " << imessagingService->getName());
+ LoggerD("name : " << imessagingService->getName());
return JSUtil::toJSValueRef(context, imessagingService->getName());
}
else if (JSStringIsEqualToUTF8CString(propertyName, MESSAGING_SERVICE_ID)) {
- LogDebug("accountId : " << imessagingService->getAccountID());
+ LoggerD("accountId : " << imessagingService->getAccountID());
std::stringstream stream;
stream << imessagingService->getAccountID();
MessagingStoragePrivObjPtr storagePrivObj(new MessagingStoragePrivObj());
storagePrivObj->m_index = imessagingService->getAccountID();
- LogDebug("accountId" << ": " << storagePrivObj->m_index);
+ LoggerD("accountId" << ": " << storagePrivObj->m_index);
storagePrivObj->m_type = imessagingService->getType();
- LogDebug("type" << ": " << storagePrivObj->m_type);
+ LoggerD("type" << ": " << storagePrivObj->m_type);
MessagingStoragePriv *privStorage = new MessagingStoragePriv(l_globalContext, storagePrivObj);
}
}
catch (const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSValueMakeUndefined(context);
}
catch (const WrtDeviceApis::Commons::Exception& err) {
- LogError(err.GetMessage().c_str());
+ LoggerE(err.GetMessage().c_str());
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
if (JSStringIsEqualToUTF8CString(propertyName, MESSAGING_SERVICE_ID)) {
return true;
JSObjectRef object,
JSPropertyNameAccumulatorRef propertyNames)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStringRef propertyName = NULL;
propertyName = JSStringCreateWithUTF8CString(MESSAGING_SERVICE_ID);
const JSValueRef arguments[], JSValueRef* exception)
{
- LogInfo("<<<");
- LogDebug("arumentConunt:" << argumentCount);
+ LoggerI("<<<");
+ LoggerD("arumentConunt:" << argumentCount);
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (priv)
JSValueRef objMsg = NULL;
MessageType msgType = (MessageType)imessagingService->getType();
- LogInfo("msgType :" << msgType);
+ LoggerI("msgType :" << msgType);
if (msgType == EMAIL)
{
EmailAccountInfo account = imessagingService->getCurrentEmailAccount();
- LogDebug("Account Address:" << &account);
+ LoggerD("Account Address:" << &account);
objMsg = JSMessage::createJSObject(l_globalContext, account, msgType); //make message JSValueRef.
}
else
if (!msg)
ThrowMsg(WrtDeviceApis::Commons::PlatformException,"platform exception");
- LogDebug ("##### msg type is " << msg->getId());
+ LoggerD ("##### msg type is " << msg->getId());
const ScopedJSStringRef subjectStr(JSStringCreateWithUTF8CString("subject"));
const ScopedJSStringRef toStr(JSStringCreateWithUTF8CString("to"));
//subject
if (!JSValueIsUndefined(l_globalContext, subjectData) )
{
- LogDebug ( " Subject : " << converter->toString(subjectData) );
+ LoggerD ( " Subject : " << converter->toString(subjectData) );
std::string subject = converter->toString(subjectData);
switch (msgType)
{
}
default:
{
- LogError("message not supported");
+ LoggerE("message not supported");
//Throw(WrtDeviceApis::Commons::UnsupportedException);
//break;
}
if (!JSValueIsUndefined(l_globalContext, toData) )
{
Recipients to = converter->toRecipients(toData);
- LogDebug("setting to field, size=" << to.getRecipientSize());
+ LoggerD("setting to field, size=" << to.getRecipientSize());
msg->setToRecipients(to);
}
//cc
if (!JSValueIsUndefined(l_globalContext, htmlBodyData))
{
std::string body = converter->toString(htmlBodyData);
- LogDebug("html body : " << body);
+ LoggerD("html body : " << body);
email->setHtmlBody(body);
}
if (!JSValueIsUndefined(l_globalContext, plainBodyData) )
{
std::string body = converter->toString(plainBodyData);
- LogDebug("plain body : " << body);
+ LoggerD("plain body : " << body);
msg->setBody(body);
}
JSTizenException::TYPE_MISMATCH_ERROR, JSMESSAGING_EXCEPTION_MSG_TYPE_MISMATCH);
}
-// LogInfo(">>>");
+// LoggerI(">>>");
// return JSValueMakeUndefined(context);
}
else
{
- LogDebug(" Private Object is NULL ");
+ LoggerD(" Private Object is NULL ");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, JSMESSAGING_EXCEPTION_MSG_NOT_FOUND);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Message ( mandatory )
- IMessagePtr msg = converter->toIMessage(validator.toObject(0));
+ JSObjectRef messageArg = validator.toObject(0);
+ if(JSObjectGetPrivate(messageArg) == NULL) {
+ // no private object in argument -> possibly it's an invalid object
+ throw DeviceAPI::Common::TypeMismatchException("Invalid first argument content.");
+ }
+ IMessagePtr msg = converter->toIMessage(messageArg);
// argu 2. Success callback (optional)
JSObjectRef successcb = validator.toFunction(1, true);
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, globalContext);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Message ( mandatory )
- IMessagePtr msg = converter->toIMessage(validator.toObject(0));
+ JSObjectRef messageArg = validator.toObject(0);
+ if(JSObjectGetPrivate(messageArg) == NULL) {
+ // no private object in argument -> possibly it's an invalid object
+ throw DeviceAPI::Common::TypeMismatchException("Invalid first argument content.");
+ }
+ IMessagePtr msg = converter->toIMessage(messageArg);
// argu 2. Success callback
callbackManager->setOnSuccess(validator.toFunction(1));
privateData->setMessageJSValueRef(arguments[0]); //set Message JSValueRef.
}
- LogInfo(" Checked Message Type " );
+ LoggerI(" Checked Message Type " );
IMessagingServicePtr imessagingService = priv->getObject();
int opId = imessagingService->createOpId(MESSAGING_SERVICE_OP_DOWNLOAD_BODY);
- LogDebug("Operation ID is = " << opId);
+ LoggerD("Operation ID is = " << opId);
event->opId = opId;
imessagingService->setMessageToOpId(opId, event->m_message);
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, globalContext);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
//argu 1. Attachment (mandatory)
- IAttachmentPtr iAttchmentPtr = converter->toIAttachment(validator.toObject(0));
+ JSObjectRef attachmentArg = validator.toObject(0);
+ if(JSObjectGetPrivate(attachmentArg) == NULL) {
+ // no private object in argument -> possibly it's an invalid object
+ throw DeviceAPI::Common::TypeMismatchException("Invalid first argument content.");
+ }
+ IAttachmentPtr iAttchmentPtr = converter->toIAttachment(attachmentArg);
// argu 2. Success callback
callbackManager->setOnSuccess(validator.toFunction(1));
throw DeviceAPI::Common::UnknownException("Private data is NULL.");
}
- LogInfo("iAttchmentPtr->getDownloaded() : " << iAttchmentPtr->getDownloaded());
+ LoggerI("iAttchmentPtr->getDownloaded() : " << iAttchmentPtr->getDownloaded());
if(iAttchmentPtr->getDownloaded() > 0)
{
callbackManager->callOnSuccess(converter->toJSValueRef(iAttchmentPtr));
if (imessagingService)
{
int opId = imessagingService->createOpId(MESSAGING_SERVICE_OP_DOWNLOAD_ATTACHMENT);
- LogDebug("Operation ID is = " << opId);
+ LoggerD("Operation ID is = " << opId);
event->opId = opId;
imessagingService->setMessageToOpId(opId, event->m_message);
}
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingService::sync(JSContextRef context, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
// argu 3. limit ( optional )
int limit = validator.toLong(2, true, -1); //sync limit
- LogDebug("limit : " << limit);
+ LoggerD("limit : " << limit);
IMessagingServicePtr imessagingService = priv->getObject(); //get MessagingService.
MessageType msgType = (MessageType)imessagingService->getType();
- LogInfo("msgType :" << msgType);
+ LoggerI("msgType :" << msgType);
if (msgType != EMAIL) {
std::string errMessage = converter->toMessageType(imessagingService->getType()) + " not supported";
throw DeviceAPI::Common::NotSupportedException(errMessage.c_str());
return JSUtil::toJSValueRef(context, (long int)event->opId);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingService::syncFolder(JSContextRef context, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Folder (mandatory)
- IMessageFolderPtr folder = converter->toIMessageFolder(validator.toObject(0));
+ JSObjectRef folderArg = validator.toObject(0);
+ if(JSObjectGetPrivate(folderArg) == NULL) {
+ // no private object in argument -> possibly it's an invalid object
+ throw DeviceAPI::Common::TypeMismatchException("Invalid first argument content.");
+ }
+ IMessageFolderPtr folder = converter->toIMessageFolder(folderArg);
// argu 2. Success callback (optional & nullable)
callbackManager->setOnSuccess(validator.toFunction(1, true));
// argu 4. limit ( optional )
int limit = validator.toLong(3, true, -1); //sync limit
- LogDebug("limit : " << limit);
+ LoggerD("limit : " << limit);
IMessagingServicePtr imessagingService = priv->getObject(); //get MessagingService.
MessageType msgType = (MessageType)imessagingService->getType();
- LogInfo("msgType :" << msgType);
+ LoggerI("msgType :" << msgType);
if (msgType != EMAIL) {
std::string errMessage = converter->toMessageType(imessagingService->getType()) + " not supported";
throw DeviceAPI::Common::NotSupportedException(errMessage.c_str());
event->m_sync_folder_id = folder->getId(); //it will be changed to the folder ptr
}
- LogDebug("folderName : " << event->m_folder_name);
+ LoggerD("folderName : " << event->m_folder_name);
event->opId = imessagingService->createOpId(MESSAGING_SERVICE_OP_SYNC_FOLDER);
event->m_sync_account_id = imessagingService->getAccountID() ;
event->m_sync_limit = limit;
return JSUtil::toJSValueRef(context, (long int)event->opId);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingService::cancelOperation(JSContextRef context, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject)); //get private object
IMessagingServicePtr imessagingService = priv->getObject();
Try
{
- LogInfo(">>> argument count : " << argumentCount);
+ LoggerI(">>> argument count : " << argumentCount);
if ( argumentCount == 1 && !Validator(context).isCallback(arguments[0]))
{
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
MessageType msgType = (MessageType)imessagingService->getType();
- LogInfo("msgType :" << msgType);
+ LoggerI("msgType :" << msgType);
int opId = converter->toLong( arguments[0] ); //Fetch operation ID
int handle = imessagingService->getHandleFromOpId(opId);
}
int opType = imessagingService->getOpTypeFromOpId(opId);
- LogInfo("operation ID :" << opId << " operation Type : " << opType);
+ LoggerI("operation ID :" << opId << " operation Type : " << opType);
if ( opType == MESSAGING_SERVICE_OP_SEND_MESSAGE)
{
IMessagePtr msg = imessagingService->getMessageFromOpId(opId);
if (msg)
{
- LogDebug("Call Cancel Function");
+ LoggerD("Call Cancel Function");
msg->sendCancel(handle);
imessagingService->deleteOpId(opId);
}
if ( opType == MESSAGING_SERVICE_OP_DOWNLOAD_BODY )
{
- LogDebug("Cancel Download Body , handle = " << handle);
+ LoggerD("Cancel Download Body , handle = " << handle);
email->downloadBodyCancel(handle);
}
else if ( opType == MESSAGING_SERVICE_OP_DOWNLOAD_ATTACHMENT)
{
- LogDebug("Cancel Download Attachment , handle = " << handle);
+ LoggerD("Cancel Download Attachment , handle = " << handle);
email->downloadAttachmentCancel(handle);
}
else if ( opType == MESSAGING_SERVICE_OP_SYNC )
{
- LogDebug("Cancel Sync , handle = " << handle);
+ LoggerD("Cancel Sync , handle = " << handle);
imessagingService->syncCancel(handle);
}
else if ( opType == MESSAGING_SERVICE_OP_SYNC_FOLDER )
{
- LogDebug("Cancel Sync Folder, handle = " << handle);
+ LoggerD("Cancel Sync Folder, handle = " << handle);
imessagingService->syncFolderCancel(handle);
}
imessagingService->deleteOpId(opId);
}
Catch (WrtDeviceApis::Commons::InvalidArgumentException){
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT);
}
Catch (WrtDeviceApis::Commons::NotFoundException){
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, JSMESSAGING_EXCEPTION_MSG_NOT_FOUND);
}
Catch (WrtDeviceApis::Commons::UnsupportedException){
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_SUPPORTED_ERROR, JSMESSAGING_EXCEPTION_MSG_NOT_SUPPORTED);
}
Catch (WrtDeviceApis::Commons::Exception){
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
}
else
{
- LogDebug(" Private Object is NULL ");
+ LoggerD(" Private Object is NULL ");
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::NOT_FOUND_ERROR, JSMESSAGING_EXCEPTION_MSG_NOT_FOUND);
}
- LogDebug(">>>");
+ LoggerD(">>>");
return JSValueMakeUndefined(context);
}
#endif
JSValueRef JSMessagingService::stopSync(JSContextRef context, JSObjectRef function, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSMessagingServicePriv* priv = static_cast<JSMessagingServicePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
// argu 1. opId
int opId = validator.toLong(0);
- LogDebug("opId : " << opId);
+ LoggerD("opId : " << opId);
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
IMessagingServicePtr imessagingService = priv->getObject();
MessageType msgType = (MessageType)imessagingService->getType();
- LogInfo("msgType :" << msgType);
+ LoggerI("msgType :" << msgType);
if (msgType != EMAIL) {
std::string errMessage = converter->toMessageType(imessagingService->getType()) + " not supported";
throw DeviceAPI::Common::NotSupportedException(errMessage.c_str());
int handle = imessagingService->getHandleFromOpId(opId);
if ( handle < 0 )
{
- throw DeviceAPI::Common::InvalidValuesException("Operation ID Not found");
+ LogInfo("operation ID is not found : " << opId);
+ return JSValueMakeUndefined(context);
}
int opType = imessagingService->getOpTypeFromOpId(opId);
- LogInfo("operation ID :" << opId << " operation Type : " << opType);
+ LoggerI("operation ID :" << opId << " operation Type : " << opType);
if ( opType == MESSAGING_SERVICE_OP_SYNC )
{
- LogDebug("Cancel Sync , handle = " << handle);
+ LoggerD("Cancel Sync , handle = " << handle);
imessagingService->syncCancel(handle);
}
else if ( opType == MESSAGING_SERVICE_OP_SYNC_FOLDER )
{
- LogDebug("Cancel Sync Folder, handle = " << handle);
+ LoggerD("Cancel Sync Folder, handle = " << handle);
imessagingService->syncFolderCancel(handle);
}
else
EventMessagingServicePtr event = imessagingService->getEventFromOpId(opId);
if (event)
{
- LogDebug("get callback Manager");
+ LoggerD("get callback Manager");
EventMessagingServicePrivateDataPtr privateData =
DPL::StaticPointerCast<EventMessagingServicePrivateData>(event->getPrivateData());
JSContextRef globalContext = callbackManager->getContext();
if (callbackManager)
{
- LogDebug("call error callback.");
+ LoggerD("call error callback.");
callbackManager->callOnError(JSDOMExceptionFactory::AbortException.make(globalContext, JSMESSAGING_EXCEPTION_MSG_ABORT_ERROR));
}
}
imessagingService->deleteOpId(opId);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
}
void JSMessagingServiceManager::initialize(JSContextRef context, JSObjectRef object) {
- LogDebug("creation messaging instance");
+ LoggerD("creation messaging instance");
JSMessagingServiceManagerPriv *priv = static_cast<JSMessagingServiceManagerPriv*>(JSObjectGetPrivate(object));
if (priv == NULL)
priv = new JSMessagingServiceManagerPriv( context, MessagingServiceManager);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
}
else
{
- LogDebug("already exist");
- LogDebug("global context=" << priv->getContext());
+ LoggerD("already exist");
+ LoggerD("global context=" << priv->getContext());
}
}
void JSMessagingServiceManager::finalize(JSObjectRef object) {
- LogDebug("enter");
+ LoggerD("enter");
JSMessagingServiceManagerPriv* priv = static_cast<JSMessagingServiceManagerPriv*>(JSObjectGetPrivate(object));
MessagingListener::getInstance().deregisterMessageReceivedEmitter();
JSObjectSetPrivate(object, NULL);
delete priv; // object will be deleted, but used to show that private object is deleted
}
- LogDebug("Leave");
+ LoggerD("Leave");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSMessagingServiceManagerPriv* priv = static_cast<JSMessagingServiceManagerPriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
callbackManager->setOnSuccess(validator.toFunction(1));
callbackManager->setOnError(validator.toFunction(2, true));
- LogDebug("Messaging Service Type: " << messagingType);
+ LoggerD("Messaging Service Type: " << messagingType);
// JSCallbackManager contains function pointers of successCallback and errorCallback.
// The function pointers is be using to return results to Javascriptcore. So JSCallbackManager should be executed by main thread.
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, gContext);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
void JSMessagingStorage::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("creation messaging instance");
+ LoggerD("creation messaging instance");
}
void JSMessagingStorage::finalize(JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(object));
if (priv)
{
- LogDebug("deleting private object (messaging)");
+ LoggerD("deleting private object (messaging)");
// for messaging object, private object is shared pointer, so will be deleted automatically
delete priv;
// object will be deleted, but used to show that private object is deleted
#if 0
JSValueRef JSMessagingStorage::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("<<< ");
+ LoggerD("<<< ");
JSValueRef retVal = NULL;
Try
Converter convert(context);
if (JSStringIsEqualToUTF8CString(propertyName, "FOLDER_INBOX"))
{
- LogDebug("FOLDER_INBOX" << ":" << "1");
+ LoggerD("FOLDER_INBOX" << ":" << "1");
retVal = convert.toJSValueRef(INBOX);
}
else if (JSStringIsEqualToUTF8CString(propertyName, "FOLDER_OUTBOX"))
{
- LogDebug("FOLDER_OUTBOX" << ":" << "2");
+ LoggerD("FOLDER_OUTBOX" << ":" << "2");
retVal = convert.toJSValueRef(OUTBOX);
}
else if (JSStringIsEqualToUTF8CString(propertyName, "FOLDER_DRAFTS"))
{
- LogDebug("FOLDER_DRAFTS" << ":" << "3");
+ LoggerD("FOLDER_DRAFTS" << ":" << "3");
retVal = convert.toJSValueRef(DRAFTBOX);
}
else if (JSStringIsEqualToUTF8CString(propertyName, "FOLDER_SENTBOX"))
{
- LogDebug("FOLDER_SENTBOX" << ":" << "4");
+ LoggerD("FOLDER_SENTBOX" << ":" << "4");
retVal = convert.toJSValueRef(SENTBOX);
}
else
}
Catch (WrtDeviceApis::Commons::Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN);
}
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
#endif
JSValueRef JSMessagingStorage::addDraftMessage(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::removeMessages(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::findConversations(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::removeConversations(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::findFolders(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager(NULL);
callbackManager = JSCallbackManager::createObject(priv->getContext());
if (!callbackManager) {
- LogError("callbackManager is NULL.");
+ LoggerE("callbackManager is NULL.");
DeviceAPI::Common::UnknownException err("callbackManager is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessageAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, priv->getContext());
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::NullPointerException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Messages Change Callback ( mandatory )
- functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0));
+ functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0), MESSAGES_MULTI_FUNCTION);
funtionIndex = functionResult.functionIndex;
if(funtionIndex < 0)
{
}
onSuccessForCbm = functionResult.messagesAdded;
- messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
- messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
+ if(functionResult.messagesUpdated)
+ messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
+ if(functionResult.messagesRemoved)
+ messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
EventOnMessagingStorageChangesPrivateDataPtr privData(
new EventOnMessagingStorageChangesPrivateData(callbackManager, messagesUpdatedCbm, messagesRemovedCbm, funtionIndex));
return JSValueMakeNumber(context, id);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::UnsupportedException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::AlreadyInUseException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::addConversationsChangeListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Messages Change Callback ( mandatory )
- functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0));
+ functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0), CONVERSATIONS_MULTI_FUNCTION);
funtionIndex = functionResult.functionIndex;
if(funtionIndex < 0)
{
}
onSuccessForCbm = functionResult.messagesAdded;
- messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
- messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
+ if(functionResult.messagesUpdated)
+ messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
+ if(functionResult.messagesRemoved)
+ messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
EventOnMessagingStorageChangesPrivateDataPtr privData(
new EventOnMessagingStorageChangesPrivateData(callbackManager, messagesUpdatedCbm, messagesRemovedCbm, funtionIndex));
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::UnsupportedException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::AlreadyInUseException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::addFoldersChangeListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
ArgumentValidator validator(context, argumentCount, arguments);
// argu 1. Messages Change Callback ( mandatory )
- functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0));
+ functionResult = converter->toMessageMultifunctions(validator.toJSValueRef(0), FOLDERS_MULTI_FUNCTION);
funtionIndex = functionResult.functionIndex;
if(funtionIndex < 0)
{
}
onSuccessForCbm = functionResult.messagesAdded;
- messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
- messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
+ if(functionResult.messagesUpdated)
+ messagesUpdatedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesUpdated, NULL);
+ if(functionResult.messagesRemoved)
+ messagesRemovedCbm = JSCallbackManager::createObject(priv->getContext(), functionResult.messagesRemoved, NULL);
EventOnMessagingStorageChangesPrivateDataPtr privData(
new EventOnMessagingStorageChangesPrivateData(callbackManager, messagesUpdatedCbm, messagesRemovedCbm, funtionIndex));
return JSValueMakeNumber(context, id);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::UnsupportedException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::AlreadyInUseException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
JSValueRef JSMessagingStorage::removeChangeListener(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount,
const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("Entered");
+ LoggerD("Entered");
//check permission.
AceSecurityStatus status = MESSAGING_CHECK_ACCESS(
MessagingStoragePriv* priv = static_cast<MessagingStoragePriv*>(JSObjectGetPrivate(thisObject));
if (!priv) {
- LogError("Private object is NULL.");
+ LoggerE("Private object is NULL.");
DeviceAPI::Common::UnknownException err("Private object is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
MessagingStoragePrivObjPtr objectPriv = priv->getObject();
if (!objectPriv) {
- LogError("objectPriv is NULL.");
+ LoggerE("objectPriv is NULL.");
DeviceAPI::Common::UnknownException err("objectPriv is NULL.");
return JSWebAPIError::throwException(context, exception, err);
}
// argu 1. watchId ( mandatory )
long handler = validator.toLong(0);
- MessagingListener::getInstance().removeIncomingMsgCallback(handler, objectPriv->getType(), objectPriv->getIndex());
+ try{
+ MessagingListener::getInstance().removeIncomingMsgCallback(handler, objectPriv->getType(), objectPriv->getIndex());
+ }
+ catch(const WrtDeviceApis::Commons::NotFoundException& exc)
+ {
+ LogError(exc.GetMessage().c_str());
+ return JSValueMakeUndefined(context);
+ }
MessageListenerCancellerPtr canceller = MessageListenerCancellerPtr(new MessageListenerCanceller(priv->getContext(), thisObject, objectPriv->getIndex()));
IListenerItemPtr listenerItem = DPL::StaticPointerCast<IListenerItem>(canceller);
MessageListenerManagerSingleton::Instance().unregisterListener(listenerItem);
}
catch(const BasePlatformException& err) {
- LogError(err.getMessage().c_str());
+ LoggerE(err.getMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::ConversionException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::TypeMismatchException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::InvalidArgumentException& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::InvalidValuesException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
catch (const WrtDeviceApis::Commons::Exception& exc) {
- LogError(exc.GetMessage().c_str());
+ LoggerE(exc.GetMessage().c_str());
DeviceAPI::Common::UnknownException err(exc.GetMessage().c_str());
return JSWebAPIError::throwException(context, exception, err);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include "JSRecipientArray.h"
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
+#include <Logger.h>
namespace {
const char* FUNCTION_CONCAT = "concat";
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
JSRecipientArrayPrivate* priv =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid conversion");
+ LoggerE("invalid conversion");
}
return JSValueMakeUndefined(context);
}
JSRecipientArrayPrivate* priv =
static_cast<JSRecipientArrayPrivate*>(JSObjectGetPrivate(object));
if (!priv) {
- LogError("Array contains no private object");
+ LoggerE("Array contains no private object");
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Array contains no private object");
}
return priv->getObject();
void JSRecipientArray::initialize(JSContextRef context,
JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
}
void JSRecipientArray::finalize(JSObjectRef object)
{
- LogDebug("enter");
+ LoggerD("enter");
JSRecipientArrayPrivate* priv =
static_cast<JSRecipientArrayPrivate*>(JSObjectGetPrivate(object));
delete priv;
JSObjectRef object,
JSStringRef propertyName)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
Try
{
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
Try
{
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("invalid property");
+ LoggerE("invalid property");
}
return JSValueMakeUndefined(context);
}
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::Converter converter(context);
Try
{
address = converter.toString(value);
}
if (!checkValue(address)) {
- LogError("trying to assing invalid value");
+ LoggerE("trying to assing invalid value");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
JSRecipientArrayPrivate* priv =
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("error occured");
+ LoggerE("error occured");
}
return false;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
return JSValueMakeUndefined(context);
}
}
#include <email-api-init.h>
#include <email-api-account.h>
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include <Commons/ThreadPool.h>
#include "MailSender.h"
#include "NetworkStatus.h"
#include "Messaging.h"
+#include <Logger.h>
namespace {
const char* DBUS_FILTER_NETWORK_STATUS =
Assert(mail && "Mail must not be NULL.");
int mailId = mail->convertId(mail->getIdRef());
- LogDebug("send mailId = " << mailId);
+ LoggerD("send mailId = " << mailId);
SendRequestsIterator it = m_requests.find(mailId);
if (m_requests.end() != it) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
if (m_requests.end() == it) {
//ThrowMsg(WrtDeviceApis::Commons::PlatformException,
// "Email handle : " << handle << " not found.");
- LogDebug("Email handle" << handle << " not found!");
+ LoggerD("Email handle" << handle << " not found!");
return;
}
else
// TODO Copied from former solution, refactor it.
void MailSender::OnEventReceived(const DBus::MessageEvent& event)
{
- LogDebug("enter");
+ LoggerD("enter");
NetworkStatusPtr msg(new NetworkStatus(event.GetArg0()));
int mailId = msg->getMailId();
- LogDebug("status : " << msg->getStatus() << " mailId : " << mailId);
+ LoggerD("status : " << msg->getStatus() << " mailId : " << mailId);
int handle = 0;
if ( msg->getStatus() == NOTI_SEND_FINISH || msg->getStatus() == NOTI_SEND_FAIL)
if ( it->second.mail->getUID() == mailId)
{
handle = it->first;
- LogDebug("handle : " << handle);
+ LoggerD("handle : " << handle);
break;
}
}
if (msg->getStatus() == NOTI_SEND_FAIL)
{
- LogDebug(" Error Code : " << msg->getErrorCode());
+ LoggerD(" Error Code : " << msg->getErrorCode());
}
}
else
{
if ( msg->getStatus() == NOTI_SEND_START )
{
- LogDebug("NOTI_SEND_START");
+ LoggerD("NOTI_SEND_START");
}
else if ( msg->getStatus() == NOTI_SEND_CANCEL )
{
- LogDebug("NOTI_SEND_CANCEL");
+ LoggerD("NOTI_SEND_CANCEL");
}
return ;
}
- LogDebug("handle : " << handle);
+ LoggerD("handle : " << handle);
SendRequestsIterator it = m_requests.find(handle); //find reqeuset
if (m_requests.end() != it) {
switch (msg->getStatus()) {
case NOTI_SEND_START:
- LogInfo("Start sending e-mail: " << mailId);
+ LoggerI("Start sending e-mail: " << mailId);
break;
case NOTI_SEND_FINISH:
}
mail->setMessageStatus(MESSAGE_STATUS_SENT);
- LogInfo("E-mail sent: " << mailId);
+ LoggerI("E-mail sent: " << mailId);
m_requests.erase(mailId);
break;
}
}
mail->setMessageStatus(MESSAGE_STATUS_FAILED);
- LogInfo("Sending e-mail: " << mailId <<
+ LoggerI("Sending e-mail: " << mailId <<
" failed with error: " << msg->getErrorCode());
m_requests.erase(mailId);
break;
m_dbusThread(new DPL::Thread()),
m_dbus(new DBus::Connection())
{
- LogDebug("enter");
+ LoggerD("enter");
m_dbusThread->Run();
m_dbus->setWorkerThread(m_dbusThread.Get());
//start email service
if (EMAIL_ERROR_NONE == email_service_begin()) {
- LogDebug("Email service Begin\n");
+ LoggerD("Email service Begin\n");
if (EMAIL_ERROR_NONE == email_open_db()) {
- LogDebug("Email open DB success\n");
+ LoggerD("Email open DB success\n");
}
else{
- LogDebug("Email open DB failed\n");
+ LoggerD("Email open DB failed\n");
}
}
else{
- LogDebug("Email service not started\n");
+ LoggerD("Email service not started\n");
}
}
//close email service
if (EMAIL_ERROR_NONE == email_close_db()) {
- LogDebug("Email Close DB Success\n");
+ LoggerD("Email Close DB Success\n");
if (EMAIL_ERROR_NONE == email_service_end()){
- LogDebug("Email service close Success\n");
+ LoggerD("Email service close Success\n");
}
else{
- LogDebug("Email service end failed\n");
+ LoggerD("Email service end failed\n");
}
}
else{
- LogDebug("Email Close DB failed\n");
+ LoggerD("Email Close DB failed\n");
}
}
&email_handle);
if (EMAIL_ERROR_NONE != error) {
- LogDebug("Send Fail error = " << error );
+ LoggerD("Send Fail error = " << error );
m_requests.erase(mailId);
mail->setMessageStatus(MESSAGE_STATUS_SENDING);
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
m_requests.insert(std::make_pair(email_handle, SendRequestData(email_handle, mail)));
}
- LogDebug("emf Handle : " << email_handle
+ LoggerD("emf Handle : " << email_handle
<< "requests size :" << m_requests.size() );
return email_handle;
#include <email-api-init.h>
#include <email-api-account.h>
-#include <dpl/log/log.h>
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include <Commons/ThreadPool.h>
#include <vconf.h>
#include <vconf-keys.h>
+#include <Logger.h>
+
namespace {
const char* DBUS_FILTER_NETWORK_STATUS =
"type='signal',interface='User.Email.NetworkStatus'";
//start email service
int error = email_service_begin();
if (error == EMAIL_ERROR_NONE) {
- LogDebug("Email service Begin\n");
+ LoggerD("Email service Begin\n");
if (EMAIL_ERROR_NONE == email_open_db()) {
- LogDebug("Email open DB success\n");
+ LoggerD("Email open DB success\n");
}
else{
- LogDebug("Email open DB failed\n");
+ LoggerD("Email open DB failed\n");
}
}
else{
- LogDebug("Email service not started\n");
- LogDebug("Error : " << error);
+ LoggerD("Email service not started\n");
+ LoggerD("Error : " << error);
}
//get retriving count
if ( slot_size > 0 )
m_default_slot_size = slot_size;
- LogDebug( "Slot Size : " << m_default_slot_size );
+ LoggerD( "Slot Size : " << m_default_slot_size );
}
//close email service
if (EMAIL_ERROR_NONE == email_close_db()) {
- LogDebug("Email Close DB Success\n");
+ LoggerD("Email Close DB Success\n");
if (EMAIL_ERROR_NONE == email_service_end())
{
- LogDebug("Email service close Success\n");
+ LoggerD("Email service close Success\n");
}
else
{
- LogDebug("Email service end failed\n");
+ LoggerD("Email service end failed\n");
}
}
else{
- LogDebug("Email Close DB failed\n");
+ LoggerD("Email Close DB failed\n");
}
}
if ( mail )
{
int mailId = mail->convertId(mail->getIdRef()); // get mail id
- LogDebug("start attachment, mail Id : " << mail->getIdRef());
+ LoggerD("start attachment, mail Id : " << mail->getIdRef());
SyncRequestIterator it;
int synType;
for( it = m_SyncRequests.begin(); it != m_SyncRequests.end(); ++it)
{
synType = it->second.syncType;
- LogDebug("synType : " << synType);
+ LoggerD("synType : " << synType);
if( synType != MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_BODY )
{
- LogDebug("skip");
+ LoggerD("skip");
continue;
}
const IEmailPtr& email = it->second.mail;
- LogDebug ( "Requests mail ID:" << mail->convertId(email->getIdRef()) );
+ LoggerD ( "Requests mail ID:" << mail->convertId(email->getIdRef()) );
if ( mailId == mail->convertId(email->getIdRef()))
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
}
else
{
- LogDebug("Don't find cancel DownloadBody handle : " << handle);
+ LoggerD("Don't find cancel DownloadBody handle : " << handle);
//ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Email: " << mailId << " not found.");
}
}
else
{
- LogDebug("Don't find cancel DownloadAttachment handle : " << handle);
+ LoggerD("Don't find cancel DownloadAttachment handle : " << handle);
}
}
if ( mail && attachment )
{
//int mailId = mail->convertId(mail->getIdRef()); // get mail id
- LogDebug("start attachment, mail Id : " << mail->getIdRef());
+ LoggerD("start attachment, mail Id : " << mail->getIdRef());
SyncRequestIterator it;
int synType;
for( it = m_SyncRequests.begin(); it != m_SyncRequests.end(); ++it)
{
synType = it->second.syncType;
- LogDebug("synType : " << synType);
+ LoggerD("synType : " << synType);
if( synType != MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_ATTACHMENT )
{
- LogDebug("skip");
+ LoggerD("skip");
continue;
}
const IAttachmentPtr& iattachment = it->second.attachment;
- LogDebug ( "Requests Attachment ID:" << iattachment->getAttachmentID() << " Input Attachment ID: " << attachment->getAttachmentID());
+ LoggerD ( "Requests Attachment ID:" << iattachment->getAttachmentID() << " Input Attachment ID: " << attachment->getAttachmentID());
if (iattachment->getAttachmentID() == attachment->getAttachmentID())
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
int MailSync::syncAccount(const IMessagingServicePtr& messagingService, const int limit)
{
- LogDebug("syncAccount : " << limit);
+ LoggerD("syncAccount : " << limit);
if (messagingService)
{
int accountId = messagingService->getAccountID();
- LogDebug("start sync, account Id : " << accountId);
+ LoggerD("start sync, account Id : " << accountId);
SyncRequestIterator it;
int synType;
for( it = m_SyncRequests.begin(); it != m_SyncRequests.end(); ++it)
{
synType = it->second.syncType;
- LogDebug("synType : " << synType);
+ LoggerD("synType : " << synType);
if( synType != MESSAGING_SERVICE_SYNC_TYPE_SYNC )
{
- LogDebug("skip");
+ LoggerD("skip");
continue;
}
const IMessagingServicePtr& messagingService = it->second.messagingService;
if (messagingService && messagingService->getAccountID() == accountId)
{
- LogDebug("accountId is sync requested already");
+ LoggerD("accountId is sync requested already");
// ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Sync: " << accountId << " already requested to be Sync Account.");
}
}
}
else
{
- LogDebug("messagingService is NULL");
+ LoggerD("messagingService is NULL");
}
- LogDebug("end sync" );
+ LoggerD("end sync" );
return -1;
}
int MailSync::syncAccountInternal( const IMessagingServicePtr& messagingService, const int limit)
{
- LogDebug("syncAccountInternal limit: " << limit);
+ LoggerD("syncAccountInternal limit: " << limit);
int account_id = messagingService->getAccountID();
int err = 0;
email_set_mail_slot_size(0, 0, slot_size);
-// LogDebug("mailbox.account_id " << mailbox.account_id );
+// LoggerD("mailbox.account_id " << mailbox.account_id );
// err = email_sync_header(&mailbox, &email_handle);
-// LogDebug("emf_handle " << emf_handle);
+// LoggerD("emf_handle " << emf_handle);
err = email_sync_header(account_id, 0, &email_handle);
- LogDebug("email_handle " << email_handle);
+ LoggerD("email_handle " << email_handle);
if (err != EMAIL_ERROR_NONE) {
- LogDebug("fail to sync all folders - err : " << err);
+ LoggerD("fail to sync all folders - err : " << err);
}
else
{
- LogDebug("Insert sync request");
+ LoggerD("Insert sync request");
SyncRequestData data = SyncRequestData(email_handle, MESSAGING_SERVICE_SYNC_TYPE_SYNC, messagingService);
m_SyncRequests.insert(std::make_pair(email_handle, data));
}
void MailSync::syncAccountCancel(const int handle)
{
- LogDebug("sync cancel");
+ LoggerD("sync cancel");
Assert(handle > -1);
SyncRequestIterator it = m_SyncRequests.find(handle);
}
else
{
- LogDebug("Don't find cancel Sync handle : " << handle);
+ LoggerD("Don't find cancel Sync handle : " << handle);
//ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Email: " << mailId << " not found.");
}
}
int MailSync::syncFolder(const IMessagingServicePtr& messagingService, const int folder_id, const int limit)
{
- LogDebug("sync folder : " << folder_id << " limit : " << limit);
+ LoggerD("sync folder : " << folder_id << " limit : " << limit);
if (messagingService)
{
int accountId = messagingService->getAccountID();
- LogDebug("start sync, account Id : " << accountId);
+ LoggerD("start sync, account Id : " << accountId);
SyncRequestIterator it;
int synType;
for( it = m_SyncRequests.begin(); it != m_SyncRequests.end(); ++it)
{
synType = it->second.syncType;
- LogDebug("synType : " << synType);
+ LoggerD("synType : " << synType);
if( synType != MESSAGING_SERVICE_SYNC_TYPE_SYNC_FOLDER )
{
- LogDebug("skip");
+ LoggerD("skip");
continue;
}
if (messagingService && messagingService->getAccountID() == accountId
&& it->second.folderId == folder_id)
{
- LogDebug("accountId is syncFolder requested already");
+ LoggerD("accountId is syncFolder requested already");
// ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Sync: " << accountId << " already requested to be Sync Account.");
}
}
}
else
{
- LogDebug("messagingService is NULL");
+ LoggerD("messagingService is NULL");
}
return -1;
void MailSync::syncFolderCancel(const int handle)
{
- LogDebug("sync Folder Cancel");
+ LoggerD("sync Folder Cancel");
Assert(handle > -1);
SyncRequestIterator it = m_SyncRequests.find(handle);
}
else
{
- LogDebug("Don't find cancel Sync Folder handle : " << handle);
+ LoggerD("Don't find cancel Sync Folder handle : " << handle);
//ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Email: " << mailId << " not found.");
}
}
int MailSync::syncFolderInternal(const IMessagingServicePtr& messagingService, const int folder_id, const int limit)
{
- LogDebug("Folder Id=" << folder_id << " limit : " << limit);
+ LoggerD("Folder Id=" << folder_id << " limit : " << limit);
int account_id = messagingService->getAccountID();
// err = email_sync_header(mailbox, &email_handle);
err = email_sync_header(account_id, mailbox->mailbox_id, &email_handle);
if (err != EMAIL_ERROR_NONE) {
- LogDebug("fail to sync folders - err : " << err);
+ LoggerD("fail to sync folders - err : " << err);
}
else
{
- LogDebug("Insert sync request");
+ LoggerD("Insert sync request");
SyncRequestData data = SyncRequestData(email_handle, MESSAGING_SERVICE_SYNC_TYPE_SYNC_FOLDER, messagingService, folder_id);
m_SyncRequests.insert(std::make_pair(email_handle, data));
if ( mailbox != NULL )
{
if ( EMAIL_ERROR_NONE != email_free_mailbox( &mailbox , 1) )
- LogDebug("fail to email_free_mailbox - err ");
+ LoggerD("fail to email_free_mailbox - err ");
mailbox = NULL;
}
// TODO Copied from former solution, refactor it.
void MailSync::OnEventReceived(const DBus::MessageEvent& event)
{
- LogDebug("OnEventReceived");
+ LoggerD("OnEventReceived");
SyncNetworkStatusPtr syncNetworkStatus(new SyncNetworkStatus(event.GetArg0()));
int mailId = syncNetworkStatus->getMailId(); //if email body download mode.
int status = syncNetworkStatus->getStatus();
int handle = syncNetworkStatus->getHandle();
- LogDebug("mailId : " << mailId << " status : " << status << " handle : " << handle);
+ LoggerD("mailId : " << mailId << " status : " << status << " handle : " << handle);
// if Attachment Load
if ( status == NOTI_DOWNLOAD_ATTACH_FINISH ||status == NOTI_DOWNLOAD_ATTACH_FAIL )
{
int nth = handle;
- LogDebug(" Debus mailID = " << mailId << " , Nth = " << nth );
+ LoggerD(" Debus mailID = " << mailId << " , Nth = " << nth );
SyncRequestIterator it = m_SyncRequests.begin();
for ( ; it != m_SyncRequests.end(); it++ )
{
const IEmailPtr& mail = it->second.mail;
- LogDebug(" request mailID = " << mail->getUID() << " , Nth = " << (it->second.attachment)->getNth() );
+ LoggerD(" request mailID = " << mail->getUID() << " , Nth = " << (it->second.attachment)->getNth() );
if ( mail->getUID() == mailId && nth == (it->second.attachment)->getNth())
{
EventMessagingServiceReqReceiver* requestReceiver = mail->getRequestReceiver();
if (status == NOTI_DOWNLOAD_ATTACH_FINISH)
{
- LogDebug(" Attachment Finish " );
+ LoggerD(" Attachment Finish " );
const IAttachmentPtr& attachment = it->second.attachment;
if (attachment)
{
email_attachment_data_t* attachment_data = NULL;
int attachmentId = attachment->getAttachmentID();
- LogDebug("Attachment ID = " << attachmentId);
+ LoggerD("Attachment ID = " << attachmentId);
int err = email_get_attachment_data(attachmentId, &attachment_data);
if (err == EMAIL_ERROR_NONE) {
- LogDebug("attachment Name : " << attachment_data->attachment_name);
- LogDebug("attachment ID : " << attachment_data->attachment_id);
+ LoggerD("attachment Name : " << attachment_data->attachment_name);
+ LoggerD("attachment ID : " << attachment_data->attachment_id);
attachment->init(attachment_data->attachment_path, false);
}
else
{
- LogDebug("fail to email_get_attachment_data - err : " << err);
+ LoggerD("fail to email_get_attachment_data - err : " << err);
}
if ( attachment_data != NULL )
else
{
event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
- LogDebug(" Attachment Failed " );
+ LoggerD(" Attachment Failed " );
}
- LogDebug("remove downloadAttachment request");
- LogDebug("handle : " << it->first );
+ LoggerD("remove downloadAttachment request");
+ LoggerD("handle : " << it->first );
requestReceiver->ManualAnswer(event);
m_SyncRequests.erase(it->first);
}
else if ( status == NOTI_DOWNLOAD_ATTACH_START )
{
- LogDebug("DownLoading... attachment : size = " << syncNetworkStatus->getErrorCode());
+ LoggerD("DownLoading... attachment : size = " << syncNetworkStatus->getErrorCode());
return;
}
if ( m_SyncRequests.end() != it)
{
int syncType = it->second.syncType;
- LogDebug(" Sync ... handle : " << handle << " status : " << status << " SyncType: " << syncType);
+ LoggerD(" Sync ... handle : " << handle << " status : " << status << " SyncType: " << syncType);
switch(syncType)
{
case MESSAGING_SERVICE_SYNC_TYPE_SYNC:
{
- LogDebug(" Sync Account");
+ LoggerD(" Sync Account");
const IMessagingServicePtr& messagingService = it->second.messagingService;
EventMessagingServiceReqReceiver* requestReceiver = messagingService->getRequestReceiver();
{
if ( status == NOTI_DOWNLOAD_FINISH )
{
- LogDebug("Sync Success");
+ LoggerD("Sync Success");
requestReceiver->ManualAnswer(event);
m_SyncRequests.erase( handle );
}
else if ( status == NOTI_DOWNLOAD_FAIL )
{
- LogDebug("Sync Fail");
+ LoggerD("Sync Fail");
event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException );
requestReceiver->ManualAnswer(event);
m_SyncRequests.erase( handle );
}
case MESSAGING_SERVICE_SYNC_TYPE_SYNC_FOLDER:
{
- LogDebug("Sync Folder");
+ LoggerD("Sync Folder");
const IMessagingServicePtr& messagingService = it->second.messagingService;
EventMessagingServiceReqReceiver* requestReceiver = messagingService->getRequestReceiver();
{
if ( status == NOTI_DOWNLOAD_FINISH )
{
- LogDebug("Sync Success");
+ LoggerD("Sync Success");
requestReceiver->ManualAnswer(event);
m_SyncRequests.erase( handle );
}
else if ( status == NOTI_DOWNLOAD_FAIL )
{
- LogDebug("Sync Fail");
+ LoggerD("Sync Fail");
event->setExceptionCode( WrtDeviceApis::Commons::ExceptionCodes::UnknownException );
requestReceiver->ManualAnswer(event);
m_SyncRequests.erase( handle );
}
case MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_BODY:
{
- LogDebug(" DownLoad Body");
+ LoggerD(" DownLoad Body");
const IEmailPtr& mail = it->second.mail; // IEmailPtr
EventMessagingServiceReqReceiver* requestReceiver = mail->getRequestReceiver();
if (mail && requestReceiver) {
int MailSync::downloadBodyInternal( const IEmailPtr& mail, int account_id)
{
- LogDebug("downloadInternal");
+ LoggerD("downloadInternal");
int err = 0;
int mailId = mail->convertId(mail->getIdRef());
int email_handle = 0;
- LogDebug("folder type = " << mail->getCurrentFolder());
- LogDebug("mail ID :" << mailId );
+ LoggerD("folder type = " << mail->getCurrentFolder());
+ LoggerD("mail ID :" << mailId );
err = email_download_body(mailId, 0, &email_handle);
if (err != EMAIL_ERROR_NONE) {
- LogDebug("fail to downloadBody - err : " << err);
+ LoggerD("fail to downloadBody - err : " << err);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to initialize downloadBody request. [" << err << "]");
}
else
{
- LogDebug("Insert downloadBody request");
- LogDebug("handle : " << email_handle);
+ LoggerD("Insert downloadBody request");
+ LoggerD("handle : " << email_handle);
SyncRequestData data = SyncRequestData(email_handle, MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_BODY, mail);
m_SyncRequests.insert(std::make_pair(email_handle, data));
}
int MailSync::downloadAttachmentInternal(const IEmailPtr& mail, int account_id, const IAttachmentPtr& attachment)
{
- LogDebug("downloadAttachmentInternal");
+ LoggerD("downloadAttachmentInternal");
Assert(mail);
int err = 0;
"Couldn't find message " << mailId << ". [" << error << "]");
}
- LogDebug("Attachment ID :" << attachment->getAttachmentID());
+ LoggerD("Attachment ID :" << attachment->getAttachmentID());
//get nth
std::vector<IAttachmentPtr> attachments = mail->getAttachments();
unsigned int attachmentSize = attachments.size();
unsigned int inlineAttachmentSize = inlineAttachments.size();
- LogDebug( "attachment sizes = " << attachmentSize << ",inline attachment size : " << inlineAttachmentSize);
+ LoggerD( "attachment sizes = " << attachmentSize << ",inline attachment size : " << inlineAttachmentSize);
for ( unsigned int i = 0 ; i < attachmentSize ; i ++)
{
- LogDebug( "attachment ID is = " << attachments[i]->getAttachmentID());
+ LoggerD( "attachment ID is = " << attachments[i]->getAttachmentID());
if (attachments[i]->getAttachmentID() == attachment->getAttachmentID())
{
// nth = i;
}
for ( unsigned int i = 0 ; i < inlineAttachmentSize ; i ++)
{
- LogDebug( "inline attachment ID is = " << inlineAttachments[i]->getAttachmentID());
+ LoggerD( "inline attachment ID is = " << inlineAttachments[i]->getAttachmentID());
if (inlineAttachments[i]->getAttachmentID() == attachment->getAttachmentID())
{
// nth = i;
}
}
- LogDebug("nth = " << nth);
- LogDebug("attachment Order Index = " << nth);
+ LoggerD("nth = " << nth);
+ LoggerD("attachment Order Index = " << nth);
err = email_download_attachment(mailId, nth , &email_handle);
if (err != EMAIL_ERROR_NONE) {
- LogDebug("fail to downloadAttachment - err : " << err);
+ LoggerD("fail to downloadAttachment - err : " << err);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to initialize downloadAttachment request. [" << err << "]");
}
else
{
- LogDebug("Insert downloadAttachment request");
- LogDebug("handle : " << email_handle);
+ LoggerD("Insert downloadAttachment request");
+ LoggerD("handle : " << email_handle);
SyncRequestData data = SyncRequestData( email_handle,
MESSAGING_SERVICE_SYNC_TYPE_DOWNLOAD_ATTACHMENT, mail, attachment );
m_SyncRequests.insert(std::make_pair(email_handle, data));
if ( result )
if ( EMAIL_ERROR_NONE != email_free_mail_data( &result , 1) )
- LogDebug("fail to email_free_mail_data - err ");
+ LoggerD("fail to email_free_mail_data - err ");
return email_handle;
}
void MailSync::cancelEmailJobInternal(int accountId, int handle)
{
- LogDebug("cancel Email Job, account : " <<accountId << " handle : " << handle);
+ LoggerD("cancel Email Job, account : " <<accountId << " handle : " << handle);
int error = email_cancel_job(accountId, handle,EMAIL_CANCELED_BY_USER);
if (EMAIL_ERROR_NONE != error) {
- LogDebug("error code : " << error );
+ LoggerD("error code : " << error );
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"Couldn't cancel email job handle: " << handle);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "Sms.h"
#include "BinarySms.h"
#include "EmptyMessage.h"
#include "MessageFactory.h"
#include "IAttachment.h"
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::Commons;
const std::string& id)
{
- LogInfo("enter");
+ LoggerI("enter");
ISms* retSms = NULL;
IMms* retMms =NULL;
switch (msgType) {
case SMS:
{
- LogDebug("creation sms message with id");
+ LoggerD("creation sms message with id");
retSms = new Sms(id);
imsg = (IMessagePtr) retSms;
break;
case BINARYSMS:
{
- LogDebug("creation binary sms message with id");
+ LoggerD("creation binary sms message with id");
retBinarySms = new BinarySms(id);
imsg = (IMessagePtr) retBinarySms;
break;
case MMS:
{
- LogDebug("creation mms message with id");
+ LoggerD("creation mms message with id");
retMms = new Mms(id);
imsg = (IMessagePtr) retMms;
unsigned int idx = 0;
for (; idx < attachments.size() ; idx++ )
{
- LogDebug("set Messsage ID = " << attachments[idx]->getAttachmentID());
+ LoggerD("set Messsage ID = " << attachments[idx]->getAttachmentID());
attachments[idx]->setMessage(imsg);
}
break;
}
case EMAIL:
{
- LogDebug("creation email message with id");
+ LoggerD("creation email message with id");
retEmail= new Email(id);
imsg = (IMessagePtr) retEmail;
break;
}
case EMPTY_MESSAGE:
{
- LogDebug("creation empty message with id");
+ LoggerD("creation empty message with id");
retEmptyMessage = new EmptyMessage(id);
imsg = (IMessagePtr) retEmptyMessage;
break;
}
default:
- LogError("creation error, unknown message type");
+ LoggerE("creation error, unknown message type");
break;
}
- LogInfo("end");
+ LoggerI("end");
return imsg;
}
IMessagePtr MessageFactory::createMessage(const MessageType msgType,
const int id, const msg_struct_t msg_data)
{
- LogInfo("enter");
+ LoggerI("enter");
IMessage* retVal = NULL;
std::ostringstream stream;
stream << id;
switch (msgType) {
case SMS:
- LogDebug("creation sms message with data");
+ LoggerD("creation sms message with data");
retVal = new Sms(idStr, msg_data);
break;
case MMS:
- LogDebug("creation mms message with data");
+ LoggerD("creation mms message with data");
retVal = new Mms(idStr, msg_data);
break;
case EMPTY_MESSAGE:
- LogDebug("creation empty message with data");
+ LoggerD("creation empty message with data");
retVal = new EmptyMessage(idStr);
break;
default:
- LogError("creation error, unknown message type");
+ LoggerE("creation error, unknown message type");
break;
}
- LogInfo("end");
+ LoggerI("end");
return IMessagePtr(retVal);
}
IMessagePtr MessageFactory::createMessage(const MessageType msgType,
EmailAccountInfo& account, const std::string& id )
{
- LogInfo("enter, CreateMessage with account");
+ LoggerI("enter, CreateMessage with account");
std::ostringstream stream;
stream << id;
std::string idStr = stream.str();
- LogInfo("createMessage with , idstr =" << idStr);
+ LoggerI("createMessage with , idstr =" << idStr);
if (msgType == EMAIL)
{
- LogDebug("Account Address:" << &account);
+ LoggerD("Account Address:" << &account);
IMessage* retVal = NULL;
- LogDebug("creation email message with account");
+ LoggerD("creation email message with account");
retVal = new Email(account);
return IMessagePtr(retVal);
}
IMessagePtr MessageFactory::createEmailMessage(const int accountId, const int mailId)
{
- LogInfo("enter, Create Email Message with account ID");
+ LoggerI("enter, Create Email Message with account ID");
IEmail* email = NULL;
- LogDebug("creation email message with account ID");
+ LoggerD("creation email message with account ID");
std::stringstream stream;
unsigned int idx;
for (idx = 0; idx < attachments.size() ; idx++ )
{
- LogDebug("set Attachment ID = " << attachments[idx]->getAttachmentID());
+ LoggerD("set Attachment ID = " << attachments[idx]->getAttachmentID());
attachments[idx]->setMessage(imsg);
}
for (idx = 0; idx < inlineAttachments.size() ; idx++ )
{
- LogDebug("set inline Attachment ID = " << inlineAttachments[idx]->getAttachmentID());
+ LoggerD("set inline Attachment ID = " << inlineAttachments[idx]->getAttachmentID());
inlineAttachments[idx]->setMessage(imsg);
}
#if 0
IMessage* retVal = NULL;
- LogDebug("creation email message with account ID");
+ LoggerD("creation email message with account ID");
std::stringstream stream;
IMessagePtr MessageFactory::createEmailMessage()
{
- LogInfo("enter, Create Temporary Email Message without account");
+ LoggerI("enter, Create Temporary Email Message without account");
IEmail* email = NULL;
*/
#include "MessageFilterConverter.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
MessageMessagesFilterConverter::~MessageMessagesFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MessageConversationsFilterConverter::MessageConversationsFilterConverter(JSContextRef context) :
MessageConversationsFilterConverter::~MessageConversationsFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MessageFoldersFilterConverter::MessageFoldersFilterConverter(JSContextRef context) :
MessageFoldersFilterConverter::~MessageFoldersFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MessageMessagesChangeFilterConverter::MessageMessagesChangeFilterConverter(JSContextRef context) :
MessageMessagesChangeFilterConverter::~MessageMessagesChangeFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MessageConversationsChangeFilterConverter::MessageConversationsChangeFilterConverter(JSContextRef context) :
MessageConversationsChangeFilterConverter::~MessageConversationsChangeFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
MessageFoldersChangeFilterConverter::MessageFoldersChangeFilterConverter(JSContextRef context) :
MessageFoldersChangeFilterConverter::~MessageFoldersChangeFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
} // Messaging
#include "MessageFilterValidator.h"
#include "MessageFilterValidatorFactory.h"
-
-#include <dpl/log/log.h>
#include "log.h"
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
bool retVal = false;
if(attrName.compare(MessageFilterValidatorFactory::ATTRIBUTE_TIMESTAMP)!=0){
- MsgLogError(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
+ MsgLoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
return false;
}
}
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
bool MessageFilterValidator::validateAttributeEach(std::string& attrName,MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
if(attrName.compare(MessageFilterValidatorFactory::ATTRIBUTE_TYPE)==0){
if(m_isTypeSetted == true){
- MsgLogError(">>> [ERROR] duplicated type :[" << attrName << "], value:[" <<
+ MsgLoggerE(">>> [ERROR] duplicated type :[" << attrName << "], value:[" <<
value->toString()<< "]");
return false;
}else{
return false;
}
- LogDebug(">>> return true");
+ LoggerD(">>> return true");
return true;
}
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSMessagingStorage.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
if (!priv)
{
- LogDebug("priv is NULL.");
+ LoggerD("priv is NULL.");
return;
}
if (!objectPriv)
{
- LogDebug("objectPriv is NULL.");
+ LoggerD("objectPriv is NULL.");
return;
}
Try
{
- LogDebug("objectPriv type : " << objectPriv->getType() << " Id : " << objectPriv->getIndex());
+ LoggerD("objectPriv type : " << objectPriv->getType() << " Id : " << objectPriv->getIndex());
MessagingListener::getInstance().removeIncomingMsgCallback(m_watchId, objectPriv->getType(), objectPriv->getIndex());
}Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogError("Try to deregister by unmatched service");
+ LoggerE("Try to deregister by unmatched service");
return;
}
}
#include <sstream>
#include <time.h>
#include <iomanip>
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
MessageQueryGenerator::MessageQueryGenerator(const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset):
m_messageType(MESSAGE_TYPE_NOT_INITIALIZED){
- LogDebug("<<< limit:" << limit << ", offset:" << offset);
+ LoggerD("<<< limit:" << limit << ", offset:" << offset);
m_query.append(getQueryPrefix());
MessageQueryGenerator::MessageQueryGenerator(const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset, const int type):
m_messageType(MESSAGE_TYPE_NOT_INITIALIZED){
- LogDebug("<<< limit:" << limit << ", offset:" << offset);
+ LoggerD("<<< limit:" << limit << ", offset:" << offset);
m_query.append(getQueryPrefix());
//TODO check sort mode validation
}
void MessageQueryGenerator::setSmsMmsAttributeMap(){
- LogDebug("<<<");
+ LoggerD("<<<");
attributeMap.clear();
attributeMap.insert(
std::pair<std::string, std::string>(
MessageFilterValidatorFactory::ATTRIBUTE_TYPE, "A.MAIN_TYPE"));
- LogDebug(">>");
+ LoggerD(">>");
}
void MessageQueryGenerator::initAttributeMap(){
switch (m_mode){
case MODE_EMAIL:
- LogDebug("MODE_EMAIL");
+ LoggerD("MODE_EMAIL");
setEmailAttributeMap();
break;
case MODE_SMS:
case MODE_MMS:
- LogDebug("MODE_SMS or MODE_MMS");
+ LoggerD("MODE_SMS or MODE_MMS");
setSmsMmsAttributeMap();
break;
default: //TODO throw exception
}
void MessageQueryGenerator::visitPreComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
m_queryVector.push_back("(");
- LogDebug("getServiceType = " << getServiceType());
- LogDebug(">>>");
+ LoggerD("getServiceType = " << getServiceType());
+ LoggerD(">>>");
}
void MessageQueryGenerator::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(m_typeProcessing == 1){
m_typeProcessing = 0;
if(type != INTERSECTION_FILTER){
- LogError("[ERROR] >>> invalid Filter type:" << type);
+ LoggerE("[ERROR] >>> invalid Filter type:" << type);
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid Fiilter Type");
}
- LogDebug(">>>");
+ LoggerD(">>>");
if(m_mode == MODE_EMAIL)
{
return;
// m_queryVector.push_back("OR");
// }
else{
- LogError("[ERROR] invalid Filter type:" << type);
+ LoggerE("[ERROR] invalid Filter type:" << type);
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid Fiilter Type");
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void MessageQueryGenerator::visitPostComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(m_typeProcessing == 1){
m_typeProcessing = 0;
if(m_mode == MODE_EMAIL)
}
m_queryVector.push_back(")");
- LogDebug(">>>");
+ LoggerD(">>>");
}
std::string MessageQueryGenerator::convertToEmfAttrName(std::string attrName){
- LogDebug("<<< attrName:[" << attrName << "]");
+ LoggerD("<<< attrName:[" << attrName << "]");
std::string retString;
retString = static_cast<std::string>(attributeMap.find(attrName)->second);
}
- LogDebug(">> retString:[" << retString << "]");
+ LoggerD(">> retString:[" << retString << "]");
return retString;
}
std::string MessageQueryGenerator::createTimeString(std::string& timeString)
{
- LogDebug("<<< timeString:[" << timeString << "]");
+ LoggerD("<<< timeString:[" << timeString << "]");
size_t pos = timeString.find("-",0);
while(pos!= std::string::npos){
pos = timeString.find('-',0);
}
- LogDebug(">>> timeString:[" << timeString << "]");
+ LoggerD(">>> timeString:[" << timeString << "]");
return timeString;
}
std::string MessageQueryGenerator::createFolderType(std::string& value)
{
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string retFolderType;
std::ostringstream outstream;
if(value.compare("1") == 0){
- LogDebug("<<< value:[INBOX]");
+ LoggerD("<<< value:[INBOX]");
outstream << MSG_INBOX_ID;
}else if(value.compare("2") == 0){
- LogDebug("<<< value:[OUTBOX]");
+ LoggerD("<<< value:[OUTBOX]");
outstream << MSG_OUTBOX_ID;
}else if(value.compare("3") == 0){
- LogDebug("<<< value:[DRAFTBOX]");
+ LoggerD("<<< value:[DRAFTBOX]");
outstream << MSG_DRAFT_ID;
}else if(value.compare("4") == 0){
- LogDebug("<<< value:[SENTBOX]");
+ LoggerD("<<< value:[SENTBOX]");
outstream << MSG_SENTBOX_ID;
}else{
- LogDebug("[ERROR] unsupported type:["<< value << "]");
+ LoggerD("[ERROR] unsupported type:["<< value << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid folder id");
}
retFolderType = outstream.str();
- LogDebug(">>> retFolderType:[" << retFolderType << "]");
+ LoggerD(">>> retFolderType:[" << retFolderType << "]");
return retFolderType;
}
std::string MessageQueryGenerator::createPriorityTypeForEmail(std::string& value)
{
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string retPriorityType;
if(value.compare("true")==0){
}
std::string MessageQueryGenerator::createPriorityTypeForSmsMms(std::string& value){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string retPriorityType;
if(value.compare("true")==0){
}else if(value.compare("false")==0){
retPriorityType = "0";
}else{
- LogError(">>> invalid value:[" << value << "]");
+ LoggerE(">>> invalid value:[" << value << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "unsupported value");
}
std::string MessageQueryGenerator::convertToTimeFormat(const std::string& timeString){
- LogDebug("<<< timeString:[" << timeString << "]");
+ LoggerD("<<< timeString:[" << timeString << "]");
std::string retString;
retString.append("'");
retString.append(timeString.substr(nextStart, secondLength));
retString.append("'");
- LogDebug(">>> retString:[" << retString << "]");
+ LoggerD(">>> retString:[" << retString << "]");
return retString;
}
//convert from '20111115000000' to 2011-11-15 00:00:00
std::string MessageQueryGenerator::createDateTimeTypeForSmsMms(DeviceAPI::Tizen::AnyPtr& value){
std::string initialValueStr;
- LogDebug("<<< value:[" << value->toString() << "]");
+ LoggerD("<<< value:[" << value->toString() << "]");
if (!value->isNullOrUndefined()) {
if( value->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *value->getDateTm();
initialValueStr = toDateDbStr(date);
- LogDebug("<<<valueStr[" << initialValueStr <<"]");
+ LoggerD("<<<valueStr[" << initialValueStr <<"]");
}
else {
- LogError("initialValue->getType()");
+ LoggerE("initialValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid value Type");
}
}
secondsSinceType.append(tmpValueString);
secondsSinceType.append(")");
- LogDebug(">>> retPriorityType:[" << secondsSinceType << "]");
+ LoggerD(">>> retPriorityType:[" << secondsSinceType << "]");
return secondsSinceType;
}
std::string MessageQueryGenerator::createDateTimeTypeForSmsMms(std::string& timeString){
- LogDebug("<<< value:[" << timeString << "]");
+ LoggerD("<<< value:[" << timeString << "]");
std::string tmpValueString;
std::string secondsSinceType;
secondsSinceType.append(tmpValueString);
secondsSinceType.append(")");
- LogDebug(">>> retPriorityType:[" << secondsSinceType << "]");
+ LoggerD(">>> retPriorityType:[" << secondsSinceType << "]");
return secondsSinceType;
}
std::string MessageQueryGenerator::createDateTimeTypeForEmail(DeviceAPI::Tizen::AnyPtr& value)
{
std::string initialValueStr;
- LogDebug("<<< value:[" << value->toString() << "]");
+ LoggerD("<<< value:[" << value->toString() << "]");
if(!value->isType(PrimitiveType_Time)){
- LogError("[ERROR]>> invalid type");
+ LoggerE("[ERROR]>> invalid type");
return NULL;
}
if (!value->isNullOrUndefined()) {
if( value->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *value->getDateTm();
initialValueStr = toDateDbStr(date);
- LogDebug("<<<valueStr[" << initialValueStr <<"]");
+ LoggerD("<<<valueStr[" << initialValueStr <<"]");
}
else {
- LogError("initialValue->getType()");
+ LoggerE("initialValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid value Type");
}
}
}else if(booleanString.compare("false") == 0){
retString = "0";
}else{
- LogError("invalid booleanString:[" << booleanString << "]");
+ LoggerE("invalid booleanString:[" << booleanString << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid booleanString :[" + booleanString + "]");
}
return retString;
void MessageQueryGenerator::visitAttribute(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag,
DeviceAPI::Tizen::AnyPtr& matchValue, int depth){
- LogDebug("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
+ LoggerD("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
if(matchValue == NULL)
return;
- LogDebug("matchValue:" << matchValue->toString());
+ LoggerD("matchValue:" << matchValue->toString());
visitAttributeEach(attrName, matchFlag, matchValue, depth);
- LogDebug(">>>");
+ LoggerD(">>>");
}
int MessageQueryGenerator::convertMessageType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("messaging.email") ==0){
retMessageType = EMAIL;
}else{
- MsgLogError("invalid type:[" << stringType << "]");
+ MsgLoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
std::string MessageQueryGenerator::convertMessageTypeToString(std::string& stringType){
- LogDebug("<<< value:[" << stringType << "]");
+ LoggerD("<<< value:[" << stringType << "]");
std::string retMessageType;
std::ostringstream outstream;
}
void MessageQueryGenerator::visitAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
if(attrName.compare("type")==0){
m_typeProcessing = 1;
m_messageType = convertMessageType(m_currentType);
if(m_messageType == EMAIL)
{
- LogDebug(">>> skip type");
+ LoggerD(">>> skip type");
return;
}
}
std::string emfAttributeName = convertToEmfAttrName(attrName);
// if(emfAttributeName == NULL){
-// LogDebug(">>> emfAttributeName is NULL");
+// LoggerD(">>> emfAttributeName is NULL");
// return;
// }
std::string tmpStringBuffer;
if(matchFlag == DeviceAPI::Tizen::MATCH_EXACTLY){
- LogDebug("STRING_MATCH_EXACTLY");
+ LoggerD("STRING_MATCH_EXACTLY");
tmpStringBuffer.append(getMatchExactlyClause(attrName, value));
}else if(matchFlag == DeviceAPI::Tizen::MATCH_CONTAINS){
- LogDebug("STRING_MATCH_CONTAINS");
+ LoggerD("STRING_MATCH_CONTAINS");
tmpStringBuffer.append(getMatchContainsClause(attrName, value));
}else if(matchFlag == DeviceAPI::Tizen::MATCH_STARTSWITH){
- LogDebug("STRING_MATCH_STARTSWITH");
+ LoggerD("STRING_MATCH_STARTSWITH");
tmpStringBuffer.append(getMatchStartsWithClause(attrName, value));
}else if(matchFlag == DeviceAPI::Tizen::MATCH_ENDSWITH){
- LogDebug("STRING_MATCH_ENDSWITH");
+ LoggerD("STRING_MATCH_ENDSWITH");
tmpStringBuffer.append(getMatchEndsWithClause(attrName, value));
}else{
- LogDebug("[ERROR]invalid match flag[" << matchFlag << "]");
+ LoggerD("[ERROR]invalid match flag[" << matchFlag << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid match flag:[" << matchFlag << "]");
}
// else if(iter->find(MATCH_CASESENSITIVE)){ //TODO check case sensitive
// }
m_queryVector.push_back(tmpStringBuffer);
- LogDebug(">>>");
+ LoggerD(">>>");
}
void MessageQueryGenerator::visitAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth) {
- LogDebug("<<< sttrName:[" << attrName <<"]");
+ LoggerD("<<< sttrName:[" << attrName <<"]");
string initialValueStr;
string endValueStr;
if (!initialValue->isNullOrUndefined()) {
if( initialValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *initialValue->getDateTm();
initialValueStr = toDateDbStr(date);
- LogDebug("<<<valueStr[" << initialValueStr <<"]");
+ LoggerD("<<<valueStr[" << initialValueStr <<"]");
}
else {
- LogError("initialValue->getType()");
+ LoggerE("initialValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid initialValue Type");
}
}
if (!endValue->isNullOrUndefined()) {
if( endValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
tm date = *endValue->getDateTm();
endValueStr = toDateDbStr(date);
} else {
- LogError("endValue->getType()");
+ LoggerE("endValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid endValue Type");
}
}
}
m_queryVector.push_back(tmpStringBuffer);
- LogDebug(">>>");
+ LoggerD(">>>");
}
std::string MessageQueryGenerator::getQueryFromVector()
it++;
}
- LogDebug(">>> retString:" << retString);
+ LoggerD(">>> retString:" << retString);
return retString;
}
m_query.append(getQueryFromVector());
- LogDebug("m_limit : " << m_limit << " m_offset : " << m_offset);
+ LoggerD("m_limit : " << m_limit << " m_offset : " << m_offset);
if(m_sortMode != NULL)
{
m_orderLimit.append(buffer.str());
if(m_query.compare(getQueryPrefix())==0){
- LogDebug("m_query null");
+ LoggerD("m_query null");
return "";
}else{
m_query.append(getQuerySuffix());
- LogDebug("m_query not null");
+ LoggerD("m_query not null");
return m_query;
}
}
#include <Commons/Exception.h>
#include <Commons/StringUtils.h>
-#include <dpl/log/log.h>
#include <dpl/scoped_free.h>
#include "Messaging.h"
#include "Sms.h"
#include "BinarySms.h"
#include "Email.h"
#include "EmailConverter.h"
-
#include "log.h"
-
-
-
#include "StorageChangesMessageFilterValidatorFactory.h"
#include "StorageChangesConversationFilterValidatorFactory.h"
#include "StorageChangesFolderFilterValidatorFactory.h"
#include "MessageQueryGenerator.h"
-
#include "ConversationQueryGenerator.h"
#include "FolderQueryGenerator.h"
-
#include "messageDB/MessageStorageReader.h"
extern "C" {
#include "Conversation.h"
#include "MessageFolder.h"
#include <dpl/singleton_safe_impl.h>
+#include <Logger.h>
IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::MsgServiceHandle)
-#define LOG_ENTER LogDebug("---> ENTER");
-#define LOG_EXIT LogDebug("---> EXIT");
+#define LOG_ENTER LoggerD("---> ENTER");
+#define LOG_EXIT LoggerD("---> EXIT");
using namespace std;
Try
{
const vector<EmailAccountInfo> accounts = getEmailAccounts();
- LogDebug("Number of emails account=" << accounts.size());
+ LoggerD("Number of emails account=" << accounts.size());
if (accounts.size() > 0) {
// set default email account - first from the list
setCurrentEmailAccount(accounts[0]);
} else {
- LogError("no default email account set");
+ LoggerE("no default email account set");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("No email accounts available");
+ LoggerE("No email accounts available");
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogError("No email accounts available");
+ LoggerE("No email accounts available");
//current email not configured, skipped
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("unknown error");
+ LoggerE("unknown error");
}
// Begin service for email management ?? pmi question if it should be added before email actions
if (0 == m_objCounter) {
int error = email_service_begin();
if (EMAIL_ERROR_NONE != error) {
- LogError("email_service_begin() returned error " << error);
+ LoggerE("email_service_begin() returned error " << error);
} else {
- LogInfo("email_service_begin() executed without error");
+ LoggerI("email_service_begin() executed without error");
}
}
++m_objCounter;
if (!--m_objCounter) {
int error = email_service_end();
if (EMAIL_ERROR_NONE != error) {
- LogError("email_service_end() returned error " << error);
+ LoggerE("email_service_end() returned error " << error);
} else {
- LogDebug("email_service_end() executed without error");
+ LoggerD("email_service_end() executed without error");
}
}
}
{
if (NULL == readed ||
NULL == unReaded) {
- LogError("output pointers are NULL");
+ LoggerE("output pointers are NULL");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
*readed = 0;
} else if (EMAIL == msgType) {
getNumberOfEmails(folder, readed, unReaded);
} else {
- LogError("wrong message type");
+ LoggerE("wrong message type");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
const string &folder,
const DeviceAPI::Tizen::FilterPtr& filter)
{
- LogDebug("enter");
+ LoggerD("enter");
vector<IMessagePtr> retVal;
back_insert_iterator< vector<IMessagePtr> > biit(retVal);
vector<MessageType>::const_iterator it = msgTypes.begin();
for (; it != msgTypes.end(); ++it) {
- LogDebug("Finding messages (" << *it << ") in folder: " << folder);
+ LoggerD("Finding messages (" << *it << ") in folder: " << folder);
vector<IMessagePtr> result;
switch (*it) {
break;
}
default:
- LogError("message type unknown");
+ LoggerE("message type unknown");
Throw(WrtDeviceApis::Commons::PlatformException);
}
- LogDebug("Found: " << result.size());
+ LoggerD("Found: " << result.size());
copy(result.begin(), result.end(), biit);
}
}
*/
std::string Messaging::generateFilterSql(const DeviceAPI::Tizen::FilterPtr& filter){
- LogDebug("<<<");
+ LoggerD("<<<");
std::string filterSql;
MessageQueryGeneratorPtr queryGenerator(new MessageQueryGenerator());
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug(">>> filterSql:[" << filterSql << "]");
+ LoggerD(">>> filterSql:[" << filterSql << "]");
return filterSql;
}
vector<IMessagePtr> Messaging::findMessages(const vector<MessageType>& msgTypes, FolderType folder,
const DeviceAPI::Tizen::FilterPtr& filter)
{
- LogDebug("enter");
+ LoggerD("enter");
vector<IMessagePtr> retVal;
back_insert_iterator< vector<IMessagePtr> > biit(retVal);
vector<MessageType>::const_iterator it = msgTypes.begin();
for (; it != msgTypes.end(); ++it) {
- LogDebug("Finding messages (" << *it << ") in folder: " << folder);
+ LoggerD("Finding messages (" << *it << ") in folder: " << folder);
vector<IMessagePtr>(Messaging::*findFnPtr)(FolderType folder, const DeviceAPI::Tizen::FilterPtr& filter) = NULL;
switch (*it) {
break;
}
default:
- LogError("message type unknown");
+ LoggerE("message type unknown");
Throw(WrtDeviceApis::Commons::PlatformException);
}
vector<IMessagePtr> result = (this->*findFnPtr)(folder, filter);
- LogDebug("Found: " << result.size());
+ LoggerD("Found: " << result.size());
copy(result.begin(), result.end(), biit);
}
void Messaging::printErrorMessage(int errorCode){
switch(errorCode){
case EMAIL_ERROR_MAIL_NOT_FOUND:{
- LogDebug("EMAIL_ERROR_MAIL_NOT_FOUND");
+ LoggerD("EMAIL_ERROR_MAIL_NOT_FOUND");
break;
}
case EMAIL_ERROR_DB_FAILURE:{
- LogDebug("EMAIL_ERROR_DB_FAILURE");
+ LoggerD("EMAIL_ERROR_DB_FAILURE");
break;
}
default:{
- LogDebug("other error message:" << errorCode);
+ LoggerD("other error message:" << errorCode);
}
}
}
vector<IMessagePtr> Messaging::createVectorFromeMessageList(const msg_struct_list_s &message_list){
// vector<IMessagePtr> Messaging::createVectorFromeMessageList(const msg_struct_list_s message_list){
- LogDebug("<<<");
+ LoggerD("<<<");
vector<IMessagePtr> retVal;
int tempInt;
// int l_msgId = 0;
MessageType webApiMsgType;
- LogDebug("message_list.nCount:" << message_list.nCount);
+ LoggerD("message_list.nCount:" << message_list.nCount);
for (int i = 0; i < message_list.nCount; i++) {
int err = msg_get_int_value(message_list.msg_struct_info[i], MSG_MESSAGE_TYPE_INT, &tempInt);
if(err != MSG_SUCCESS)
{
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get message type fail");
}
- LogDebug("Message type : " << tempInt);
+ LoggerD("Message type : " << tempInt);
switch(tempInt){
case MSG_TYPE_SMS:{
break;
}
default:{
- LogError("[ERROR]invalid message type:" << tempInt);
+ LoggerE("[ERROR]invalid message type:" << tempInt);
continue;
}
}
// int l_msgId = msg_get_message_id(message_list.msgInfo[i]);
err = msg_get_int_value(message_list.msg_struct_info[i], MSG_MESSAGE_ID_INT, &tempInt);
- LogDebug("Message Id : " << tempInt);
+ LoggerD("Message Id : " << tempInt);
if(err != MSG_SUCCESS)
{
ThrowMsg(WrtDeviceApis::Commons::UnknownException, "get message id fail");
retVal.push_back(msg);
} //for
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
vector<IConversationPtr> recVec;
if (threadViewList.nCount <= 0) {
- LogDebug("Empty...");
+ LoggerD("Empty...");
} else {
for (int i = 0; i < threadViewList.nCount; i++) {
// IConversationPtr convPtr(new Conversation(i));
}
vector<IMessagePtr> Messaging::querySmsMmsMessages(const std::string& queryString){
- LogDebug("<<< queryString:[" << queryString <<"]");
+ LoggerD("<<< queryString:[" << queryString <<"]");
vector<IMessagePtr> retVal;
std::string tempString = "";
res = reader.queryMessage(queryString, tempString, &message_list);
if (MSG_SUCCESS != res) {
- LogError("msg_get_folder_view_list failed " << res);
+ LoggerE("msg_get_folder_view_list failed " << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
reader.MsgStoDisconnectDB();
retVal = createVectorFromeMessageList(message_list);
reader.msg_release_list_struct_private(&message_list);
}Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (message_list.nCount) {
reader.msg_release_list_struct_private(&message_list);
}
throw;
} //Catch
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
vector<IMessagePtr> Messaging::querySmsMmsMessages(const std::string& queryString, const std::string& orderLimitString){
- LogDebug("<<< queryString:[" << queryString <<"]");
- LogDebug("<<< orderLimitString:[" << orderLimitString <<"]");
+ LoggerD("<<< queryString:[" << queryString <<"]");
+ LoggerD("<<< orderLimitString:[" << orderLimitString <<"]");
vector<IMessagePtr> retVal;
// MSG_LIST_S message_list = {0, NULL};
res = reader.queryMessage(queryString, orderLimitString, &message_list);
if (MSG_SUCCESS != res) {
- LogError("msg_get_folder_view_list failed " << res);
+ LoggerE("msg_get_folder_view_list failed " << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
reader.MsgStoDisconnectDB();
retVal = createVectorFromeMessageList(message_list);
- LogDebug("<<< message_list.nCount:[" << message_list.nCount <<"]");
+ LoggerD("<<< message_list.nCount:[" << message_list.nCount <<"]");
reader.msg_release_list_struct_private(&message_list);
}Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (message_list.nCount) {
reader.msg_release_list_struct_private(&message_list);
}
throw;
} //Catch
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
vector<IConversationPtr> Messaging::querySmsMmsConversation(const std::string& sqlWhereClause, const std::string& orderLimitString){
- LogDebug("sqlWhereClause:[" << sqlWhereClause << "]");
- LogDebug("<<< orderLimitString:[" << orderLimitString <<"]");
+ LoggerD("sqlWhereClause:[" << sqlWhereClause << "]");
+ LoggerD("<<< orderLimitString:[" << orderLimitString <<"]");
std::vector<IConversationPtr> recVec;
// MSG_THREAD_VIEW_LIST_S threadViewList;
res = reader.queryConversation(sqlWhereClause, orderLimitString, &threadViewList);
if (MSG_SUCCESS != res) {
- LogError("queryConversation failed:" << res);
+ LoggerE("queryConversation failed:" << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
reader.MsgStoDisconnectDB();
reader.msg_release_list_struct_private(&threadViewList);
- LogDebug(">>>");
+ LoggerD(">>>");
return recVec;
}
vector<IConversationPtr> Messaging::queryEmailConversation(const std::string& sqlWhereClause){
- LogDebug("sqlWhereClause:[" << sqlWhereClause << "]");
+ LoggerD("sqlWhereClause:[" << sqlWhereClause << "]");
std::vector<IConversationPtr> emailResultVector;
email_mail_list_item_t* mailList = NULL;
errCode = email_query_mail_list(const_cast<char*>(sqlWhereClause.c_str()), &mailList, &mailListCount);
if(errCode != EMAIL_ERROR_NONE){
- LogError("[ERROR]email_query_mail_list failed:" << errCode);
+ LoggerE("[ERROR]email_query_mail_list failed:" << errCode);
printErrorMessage(errCode);
}else{
- LogDebug("message found mailListCount:" << mailListCount);
+ LoggerD("message found mailListCount:" << mailListCount);
std::map<int, int> checkUnique;
for(int i=0; i<mailListCount; i++){
IConversationPtr convPtr(new Conversation(mailList[i].thread_id, EMAIL));
//TODO for debug
- LogDebug("mailList[i].thread_id:[" << mailList[i].thread_id << "]");
- LogDebug("mailList[i].full_address_from:[" << mailList[i].full_address_from << "]");
- LogDebug("mailList[i].email_address_sender : [" << mailList[i].email_address_sender <<"]");
- LogDebug("mailList[i].subject:[" << mailList[i].subject << "]");
- LogDebug("mailList[i].preview_text:[" << mailList[i].preview_text << "]");
- LogDebug("mailList[i].flags_seen_field:[" << mailList[i].flags_seen_field << "]");
- LogDebug("mailList[i].priority:[" << mailList[i].priority<< "]");
+ LoggerD("mailList[i].thread_id:[" << mailList[i].thread_id << "]");
+ LoggerD("mailList[i].full_address_from:[" << mailList[i].full_address_from << "]");
+ LoggerD("mailList[i].email_address_sender : [" << mailList[i].email_address_sender <<"]");
+ LoggerD("mailList[i].subject:[" << mailList[i].subject << "]");
+ LoggerD("mailList[i].preview_text:[" << mailList[i].preview_text << "]");
+ LoggerD("mailList[i].flags_seen_field:[" << mailList[i].flags_seen_field << "]");
+ LoggerD("mailList[i].priority:[" << mailList[i].priority<< "]");
if (convPtr->getResult() == true)
{
free(mailList);
}
- LogDebug(">>>");
+ LoggerD(">>>");
return emailResultVector;
}
vector<IMessagePtr> Messaging::queryEmailMessage(const std::string& sqlWhereClause){
- LogDebug("sqlWhereClause:[" << sqlWhereClause << "]");
+ LoggerD("sqlWhereClause:[" << sqlWhereClause << "]");
vector<IMessagePtr> emailResultVector;
errCode = email_query_mail_list(const_cast<char*>(sqlWhereClause.c_str()), &mailList, &mailListCount);
if(errCode != EMAIL_ERROR_NONE){
- LogError("[ERROR]email_query_mail_list failed:" << errCode);
+ LoggerE("[ERROR]email_query_mail_list failed:" << errCode);
printErrorMessage(errCode);
}else{
- LogDebug("message found mailListCount:" << mailListCount);
+ LoggerD("message found mailListCount:" << mailListCount);
for(int i=0; i<mailListCount; i++){
//IMessagePtr msg = MessageFactory::createMessage(EMAIL, mailList[i].mail_id);
IMessagePtr msg = MessageFactory::createEmailMessage(mailList[i].account_id, mailList[i].mail_id);
//TODO for debug
- LogDebug("mailList[i].full_address_from:[" << mailList[i].full_address_from << "]");
- LogDebug("mailList[i].email_address_sender : [" << mailList[i].email_address_sender <<"]");
- //LogDebug("mailList[i].datetime:[" << mailList[i].datetime << "]");
- LogDebug("mailList[i].subject:[" << mailList[i].subject << "]");
-// LogDebug("mailList[i].mailbox_name:[" << mailList[i].mailbox_name << "]");
- LogDebug("mailList[i].preview_text:[" << mailList[i].preview_text << "]");
- LogDebug("mailList[i].flags_seen_field:[" << mailList[i].flags_seen_field << "]");
- LogDebug("mailList[i].priority:[" << mailList[i].priority<< "]");
+ LoggerD("mailList[i].full_address_from:[" << mailList[i].full_address_from << "]");
+ LoggerD("mailList[i].email_address_sender : [" << mailList[i].email_address_sender <<"]");
+ //LoggerD("mailList[i].datetime:[" << mailList[i].datetime << "]");
+ LoggerD("mailList[i].subject:[" << mailList[i].subject << "]");
+// LoggerD("mailList[i].mailbox_name:[" << mailList[i].mailbox_name << "]");
+ LoggerD("mailList[i].preview_text:[" << mailList[i].preview_text << "]");
+ LoggerD("mailList[i].flags_seen_field:[" << mailList[i].flags_seen_field << "]");
+ LoggerD("mailList[i].priority:[" << mailList[i].priority<< "]");
emailResultVector.push_back(msg);
}//for
free(mailList);
}
- LogDebug(">>>");
+ LoggerD(">>>");
return emailResultVector;
}
/*
vector<IMessagePtr> Messaging::findMessages(const DeviceAPI::Tizen::FilterPtr& filter){
- LogDebug("<<<");
+ LoggerD("<<<");
vector<IMessagePtr> retVal;
std::string filterSql;
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
int messageType = queryGenerator->getMessageType();
switch(messageType){
case EMAIL:
- LogDebug("message type is EMAIL:[" << messageType <<"]");
+ LoggerD("message type is EMAIL:[" << messageType <<"]");
retVal = queryEmailMessage(filterSql);
break;
case SMS:
case MMS:
- LogDebug("message type is SMS or MMS:[" << messageType <<"]");
+ LoggerD("message type is SMS or MMS:[" << messageType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_SMS_MMS);
filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor);
break;
default:
- LogError("[ERROR] >>> invlid message type:[" << messageType <<"]");
+ LoggerE("[ERROR] >>> invlid message type:[" << messageType <<"]");
return retVal;
}
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
*/
//TODO refactoring
vector<IMessagePtr> Messaging::findMessages(const DeviceAPI::Tizen::FilterPtr& filter, const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset)
{
- LogDebug("<<<");
+ LoggerD("<<<");
vector<IMessagePtr> retVal;
std::string filterSql;
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
int messageType = queryGenerator->getMessageType();
switch(messageType){
case EMAIL:
- LogDebug("message type is EMAIL:[" << messageType <<"]");
+ LoggerD("message type is EMAIL:[" << messageType <<"]");
retVal = queryEmailMessage(filterSql);
break;
case SMS:
case MMS:
- LogDebug("message type is SMS or MMS:[" << messageType <<"]");
+ LoggerD("message type is SMS or MMS:[" << messageType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_SMS_MMS);
filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor);
break;
default:
- MsgLogError("[ERROR] >>> invlid message type:[" << messageType <<"]");
+ MsgLoggerE("[ERROR] >>> invlid message type:[" << messageType <<"]");
return retVal;
}
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
*/
vector<IMessagePtr> Messaging::findMessages(const DeviceAPI::Tizen::FilterPtr& filter, const DeviceAPI::Tizen::SortModePtr& sortMode, const long limit, const long offset, const int type)
{
- LogDebug("<<<");
+ LoggerD("<<<");
vector<IMessagePtr> retVal;
std::string filterSql;
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
orderLimitSql = queryGenerator->getOrderLimit();
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql:[" << orderLimitSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql:[" << orderLimitSql <<"]");
int messageType = queryGenerator->getMessageType();
if(messageType != -1)
{
if(messageType != type)
{
- LogDebug("filter messageType and service msg type is diff");
+ LoggerD("filter messageType and service msg type is diff");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid Fiilter Type");
}
}
switch(type){
case EMAIL:
- LogDebug("message type is EMAIL:[" << messageType <<"]");
+ LoggerD("message type is EMAIL:[" << messageType <<"]");
emailFilterSql = filterSql + orderLimitSql;
- LogDebug("filterSql:[" << emailFilterSql <<"]");
+ LoggerD("filterSql:[" << emailFilterSql <<"]");
retVal = queryEmailMessage(emailFilterSql);
break;
case SMS:
- LogDebug("message type is SMS :[" << messageType <<"]");
+ LoggerD("message type is SMS :[" << messageType <<"]");
typeString.append("1");
typeAndString.append("1");
if(filterSql.length() == 0)
{
filterSql.append(typeString);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
}
else
{
filterSql.append(typeAndString);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
}
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql.length():[" << orderLimitSql.length() <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql.length():[" << orderLimitSql.length() <<"]");
retVal = querySmsMmsMessages(filterSql, orderLimitSql);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
break;
case MMS:
- LogDebug("message type is MMS:[" << messageType <<"]");
+ LoggerD("message type is MMS:[" << messageType <<"]");
typeString.append("2");
typeAndString.append("2");
if(filterSql.length() == 0)
{
filterSql.append(typeString);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
}
else
{
filterSql.append(typeAndString);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
}
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql.length():[" << orderLimitSql.length() <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql.length():[" << orderLimitSql.length() <<"]");
retVal = querySmsMmsMessages(filterSql, orderLimitSql);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
break;
default:
- MsgLogError("[ERROR] >>> invlid message type:[" << messageType <<"]");
+ MsgLoggerE("[ERROR] >>> invlid message type:[" << messageType <<"]");
return retVal;
}
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
case EMAIL:
return getEmailIds(folder);
default:
- LogError("not supported message type");
+ LoggerE("not supported message type");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
&folder_list_view);
if (MSG_SUCCESS != res) {
- LogError("msg_Get_folder_view_list failed" << res);
+ LoggerE("msg_Get_folder_view_list failed" << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (folder_list_view.nCount) {
msg_release_list_struct(&folder_list_view);
}
&folder_list_view);
if (MSG_SUCCESS != res) {
- LogError("msg_Get_folder_view_list failed" << res);
+ LoggerE("msg_Get_folder_view_list failed" << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (folder_list_view.nCount) {
msg_release_list_struct(&folder_list_view);
}
vector<string> retVal;
//TODO
- LogError("TODO");
+ LoggerE("TODO");
Throw(WrtDeviceApis::Commons::UnknownException);
return retVal;
*/
vector<EmailAccountInfo> Messaging::getEmailAccounts() const
{
- LogError("enter");
+ LoggerE("enter");
email_account_t* accounts = NULL;
int count = 0;
Try {
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't get e-mail accounts.");
}
- LogError( "count : " << count);
+ LoggerE( "count : " << count);
if (0 == count) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "No e-mail account found.");
{
if(accounts[i].incoming_server_user_name != NULL)
{
- LogError("server user name is NULL");
+ LoggerE("server user name is NULL");
EmailAccountInfo account(accounts[i].account_id,
accounts[i].incoming_server_user_name,
accounts[i].user_email_address);
}
else
{
- LogError("normal case");
+ LoggerE("normal case");
std::string Unknown = "UNKNOWN";
EmailAccountInfo account(accounts[i].account_id,
Unknown,
if (accounts != NULL) {
email_free_account(&accounts, count);
}
- LogError("end");
+ LoggerE("end");
return result;
}
Catch(WrtDeviceApis::Commons::PlatformException) {
if (accounts != NULL) {
email_free_account(&accounts, count);
}
- LogError("PlatformException");
+ LoggerE("PlatformException");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "No e-mail account found.");
}
Catch(WrtDeviceApis::Commons::UnknownException) {
if (accounts != NULL) {
email_free_account(&accounts, count);
}
- LogError("UnknownException");
+ LoggerE("UnknownException");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't convert e-mail account id");
}
}
if (account.empty()) {
tmpAccount = getCurrentEmailAccount().getAddress();
if (tmpAccount.empty()) {
- LogError(
+ LoggerE(
"current email account is not set, possible that no account created");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
if (!email_get_account_list(&pAccountArray, &iCount)) {
- LogError("email_get_account_list error");
+ LoggerE("email_get_account_list error");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (0 == iCount) {
- LogError("no email account exist");
+ LoggerE("no email account exist");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
if (0 == m_currentEmailAccountId) {
- LogError("wrong email account ID");
+ LoggerE("wrong email account ID");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (pAccountArray != NULL) {
- LogDebug("free account, ptr=" << pAccountArray);
+ LoggerD("free account, ptr=" << pAccountArray);
email_free_account(&pAccountArray, iCount);
}
if (0 == retVal) {
- LogError("no email account created");
+ LoggerE("no email account created");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("exception catch, platform exception");
+ LoggerE("exception catch, platform exception");
if (pAccountArray != NULL) {
email_free_account(&pAccountArray, iCount);
}
int error = 0;
mailbox = static_cast<email_mailbox_t*>(calloc(sizeof (email_mailbox_t), 1));
if (!mailbox) {
- LogError("calloc failed");
+ LoggerE("calloc failed");
return;
}
mailbox->account_id = m_currentEmailAccountId;
mailbox->mailbox_name = strdup(EMAIL_INBOX_NAME);
// if (EMAIL_ERROR_NONE != email_sync_header(mailbox, &handle)) {
if (EMAIL_ERROR_NONE != email_sync_header(mailbox->account_id, 0, &handle)) {
- LogError("email_sync_header failed");
+ LoggerE("email_sync_header failed");
}
error = email_free_mailbox(&mailbox, 1);
- LogError("email_free_mailbox : " << error);
+ LoggerE("email_free_mailbox : " << error);
*/
}
case SPAMBOX:
// intentionally not break in platform is no spambox
default:
- LogError("Invalid folder: " << folder);
+ LoggerE("Invalid folder: " << folder);
Throw(WrtDeviceApis::Commons::PlatformException);
}
{
if (MSG_SUCCESS !=
msg_get_folder_list(MsgGetCommonHandle(), &folderList)) {
- LogError("msg_get_folder_list error");
+ LoggerE("msg_get_folder_list error");
Throw(WrtDeviceApis::Commons::PlatformException);
}
for (int i = 0; i < folderList.nCount; ++i) {
void Messaging::addOnMessageReceived(
const EmitterMessageReceivedPtr& emitter, const DeviceAPI::Tizen::FilterPtr& filter, int funtionIndex)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
if(filter != NULL)
{
Try
{
- LogDebug("funtionIndex = " << funtionIndex);
+ LoggerD("funtionIndex = " << funtionIndex);
bool isValidFilter = validateFilter(filter, funtionIndex);
if(isValidFilter == false){
- LogError("[ERROR]this filter is invalid");
+ LoggerE("[ERROR]this filter is invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
}
}else
{
- LogDebug("filter is NULL");
+ LoggerD("filter is NULL");
}
this);
}
Catch(WrtDeviceApis::Commons::PlatformException){
- LogDebug("addOnMessageReceived failed");
+ LoggerD("addOnMessageReceived failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (err != MSG_SUCCESS) {
- LogError("Couldn't register on MMS received callback, err=" << err);
+ LoggerE("Couldn't register on MMS received callback, err=" << err);
}
m_dbusConnection->open(DBUS_BUS_SYSTEM);
void Messaging::addOnMessageReceived(
const EmitterConversationReceivedPtr& emitter, const DeviceAPI::Tizen::FilterPtr& filter, int funtionIndex)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
if(filter != NULL)
{
Try
{
- LogDebug("funtionIndex = " << funtionIndex);
+ LoggerD("funtionIndex = " << funtionIndex);
bool isValidFilter = validateFilter(filter, funtionIndex);
if(isValidFilter == false){
- LogError("[ERROR]this filter is invalid");
+ LoggerE("[ERROR]this filter is invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
}
}else
{
- LogDebug("filter is NULL");
+ LoggerD("filter is NULL");
}
this);
}
Catch(WrtDeviceApis::Commons::PlatformException){
- LogDebug("addOnMessageReceived failed");
+ LoggerD("addOnMessageReceived failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (err != MSG_SUCCESS) {
- LogError("Couldn't register on MMS received callback, err=" << err);
+ LoggerE("Couldn't register on MMS received callback, err=" << err);
}
m_dbusConnection->open(DBUS_BUS_SYSTEM);
void Messaging::addOnMessageReceived(
const EmitterFolderReceivedPtr& emitter, const DeviceAPI::Tizen::FilterPtr& filter, int funtionIndex)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
if(filter != NULL)
{
Try
{
- LogDebug("funtionIndex = " << funtionIndex);
+ LoggerD("funtionIndex = " << funtionIndex);
bool isValidFilter = validateFilter(filter, funtionIndex);
if(isValidFilter == false){
- LogError("[ERROR]this filter is invalid");
+ LoggerE("[ERROR]this filter is invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
}
}else
{
- LogDebug("filter is NULL");
+ LoggerD("filter is NULL");
}
this);
}
Catch(WrtDeviceApis::Commons::PlatformException){
- LogDebug("addOnMessageReceived failed");
+ LoggerD("addOnMessageReceived failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (err != MSG_SUCCESS) {
- LogError("Couldn't register on MMS received callback, err=" << err);
+ LoggerE("Couldn't register on MMS received callback, err=" << err);
// Throw(WrtDeviceApis::Commons::UnknownException);
}
}
bool Messaging::validateFilter(const DeviceAPI::Tizen::FilterPtr& filter, const int funtionIndex){
- LogDebug("<<<");
+ LoggerD("<<<");
bool retBool = false;
- LogDebug("funtionIndex = " << funtionIndex);
+ LoggerD("funtionIndex = " << funtionIndex);
if(filter != NULL){
if(funtionIndex == 0)
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}else{
- LogDebug("filter is NULL");
+ LoggerD("filter is NULL");
retBool = false;
}
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
void Messaging::removeOnMessageMsgReceived(EmitterMessageReceived::IdType id)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
m_onMessageReceived.detach(id);
EmittersMessageReceived::LockType lock = m_onMessageReceived.getLock();
if ((m_onMessageReceived.size()+m_onConversationReceived.size()+m_onFolderReceived.size()) == 0) {
void Messaging::removeOnMessageConvReceived(EmitterConversationReceived::IdType id)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
m_onConversationReceived.detach(id);
EmittersConversationReceived::LockType lock = m_onConversationReceived.getLock();
if ((m_onMessageReceived.size()+m_onConversationReceived.size()+m_onFolderReceived.size()) == 0) {
void Messaging::removeOnMessageFolderReceived(EmitterFolderReceived::IdType id)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
m_onFolderReceived.detach(id);
EmittersFolderReceived::LockType lock = m_onFolderReceived.getLock();
if ((m_onMessageReceived.size()+m_onConversationReceived.size()+m_onFolderReceived.size()) == 0) {
void Messaging::OnEventReceived(const DBus::MessageEvent& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
EventMessageReceivedPtr jsEvent(new EventMessageReceived());
DBus::MessagePtr message = event.GetArg0();
if ((i == 0) && (it->getArgType() == DBUS_TYPE_INT32))
{
status = it->getInt();
- LogInfo("status: " << status);
+ LoggerI("status: " << status);
}
else if ((i == 1) && (it->getArgType() == DBUS_TYPE_INT32))
{
account_id = it->getInt();
- LogInfo("account_id: " << account_id);
+ LoggerI("account_id: " << account_id);
}
else if ((i == 2) && (it->getArgType() == DBUS_TYPE_INT32))
{
mail_id = it->getInt();
- LogInfo("mail_id: " << mail_id);
+ LoggerI("mail_id: " << mail_id);
}
else if ((i == 3) && (it->getArgType() == DBUS_TYPE_STRING))
{
name = it->getString();
- LogInfo("name: " << name);
+ LoggerI("name: " << name);
}
else if ((i == 4) && (it->getArgType() == DBUS_TYPE_INT32))
{
thread_id = it->getInt();
- LogInfo("thread_id: " << thread_id);
+ LoggerI("thread_id: " << thread_id);
}
}
if ((mail_id > 0) && (NOTI_MAIL_ADD == status))
{ // TODO also RECEIVE_THREAD_ITEM?
- LogInfo("Email received. mail_id: " << mail_id);
+ LoggerI("Email received. mail_id: " << mail_id);
IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
IConversationPtr conversation(new Conversation(thread_id, EMAIL));
FolderType folder = msg->getCurrentFolder();
jsEvent->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
- LogInfo("Added message is in folder: " << folder);
+ LoggerI("Added message is in folder: " << folder);
jsEvent->setMessage(msg);
jsEvent->setConversation(conversation);
}
} else {
- LogWarning("New email message in ignored folder: " << folder);
+ LoggerW("New email message in ignored folder: " << folder);
}
*/
}
else if ((mail_id > 0) && (NOTI_MAIL_DELETE == status))
{ // TODO also RECEIVE_THREAD_ITEM?
- LogInfo("Email received. delete type: " << mail_id);
+ LoggerI("Email received. delete type: " << mail_id);
std::vector<std::string> strIds = String::split(name, ',');
std::stringstream stream;
for (std::vector<std::string>::iterator it = strIds.begin(); it != strIds.end(); ++it)
{
- LogDebug("ID is :" << *it);
+ LoggerD("ID is :" << *it);
if ( (*it).length() > 0 ) //vaild id
{
}
}
else {
- LogWarning("New email message in ignored folder: " << folder);
+ LoggerW("New email message in ignored folder: " << folder);
}
}
}
else if ((mail_id > 0) && (NOTI_MAIL_UPDATE == status))
{ // TODO also RECEIVE_THREAD_ITEM?
- LogInfo("Email received. mail_id: " << mail_id);
+ LoggerI("Email received. mail_id: " << mail_id);
IMessagePtr msg = MessageFactory::createMessage(EMAIL, mail_id);
IConversationPtr conversation(new Conversation(thread_id, EMAIL));
if(m_onConversationReceived.size() > 0)
m_onConversationReceived.emit(jsEvent);
} else {
- LogWarning("New email message in ignored folder: " << folder);
+ LoggerW("New email message in ignored folder: " << folder);
}
}
else if ((mail_id > 0) && (NOTI_THREAD_DELETE == status))
{ // TODO also RECEIVE_THREAD_ITEM?
- LogInfo("Email received. delete thread Id : " << mail_id);
+ LoggerI("Email received. delete thread Id : " << mail_id);
IConversationPtr conversation(new Conversation());
conversation->setConvId(mail_id);
}
else if (NOTI_MAILBOX_ADD == status)
{
- LogInfo("Emailbox received. account Id: " << account_id);
- LogInfo("name Id: " << name);
- LogInfo("mailBox Id: " << mail_id);
+ LoggerI("Emailbox received. account Id: " << account_id);
+ LoggerI("name Id: " << name);
+ LoggerI("mailBox Id: " << mail_id);
email_mailbox_t* mail_box = NULL;
if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_id, &mail_box)) {
- LogError("Couldn't retrieve message or it has been malformed.");
+ LoggerE("Couldn't retrieve message or it has been malformed.");
}
if(mail_box != NULL)
if ( mail_box )
{
if( EMAIL_ERROR_NONE != email_free_mailbox( &mail_box , 1) )
- LogDebug("fail to email_free_mailbox - err ");
+ LoggerD("fail to email_free_mailbox - err ");
}
}
else if (NOTI_MAILBOX_UPDATE == status)
{
- LogInfo("Emailbox received. account Id: " << account_id);
- LogInfo("name Id: " << name);
- LogInfo("mailBox Id: " << mail_id);
+ LoggerI("Emailbox received. account Id: " << account_id);
+ LoggerI("name Id: " << name);
+ LoggerI("mailBox Id: " << mail_id);
email_mailbox_t* mail_box = NULL;
if (EMAIL_ERROR_NONE != email_get_mailbox_by_mailbox_id(mail_id, &mail_box)) {
- LogError("Couldn't retrieve message or it has been malformed.");
+ LoggerE("Couldn't retrieve message or it has been malformed.");
}
if(mail_box != NULL)
if ( mail_box )
{
if( EMAIL_ERROR_NONE != email_free_mailbox( &mail_box , 1) )
- LogDebug("fail to email_free_mailbox - err ");
+ LoggerD("fail to email_free_mailbox - err ");
}
}
else if (NOTI_MAILBOX_DELETE == status)
{
- LogInfo("Emailbox received. account Id: " << account_id);
- LogInfo("name Id: " << name);
- LogInfo("mailBox Id: " << mail_id);
+ LoggerI("Emailbox received. account Id: " << account_id);
+ LoggerI("name Id: " << name);
+ LoggerI("mailBox Id: " << mail_id);
// make empty mailbox
m_mailboxes.mailbox_id = mail_id;
}
else
{
- LogError("Couldn't retrieve message or it has been malformed.");
+ LoggerE("Couldn't retrieve message or it has been malformed.");
}
}
else // DBUS_INTERFACE_EMAIL_RECEIVED
{
- LogDebug("Wrong DBus interface, skipping it.");
+ LoggerD("Wrong DBus interface, skipping it.");
}
}
}
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
msg_error_t err = MSG_SUCCESS;
if(storageChangeType == MSG_STORAGE_CHANGE_CONTACT)
{
- LogDebug("storageChangeType is MSG_STORAGE_CHANGE_CONTACT");
+ LoggerD("storageChangeType is MSG_STORAGE_CHANGE_CONTACT");
return;
}
{
Try {
int msgCount = pMsgIdList->nCount;
- LogDebug("msgCount = "<< msgCount);
+ LoggerD("msgCount = "<< msgCount);
for(int index = 0; index < msgCount; index++)
{
- LogDebug("storageChangeType = "<< storageChangeType);
+ LoggerD("storageChangeType = "<< storageChangeType);
if(storageChangeType == MSG_STORAGE_CHANGE_DELETE)
{
if (err != MSG_SUCCESS)
{
- LogDebug("Get Message Failed!");
- LogDebug("err" << err);
+ LoggerD("Get Message Failed!");
+ LoggerD("err" << err);
msg_release_struct(&msg);
msg_release_struct(&sendOpt);
msg = NULL;
}
int msgType = 0;
msg_get_int_value(msg, MSG_MESSAGE_TYPE_INT, &msgType);
- LogDebug("msgType : " << msgType);
+ LoggerD("msgType : " << msgType);
if((msgType > MSG_TYPE_INVALID) && ( msgType <= MSG_TYPE_SMS_REJECT))
{
if(msgType != MSG_TYPE_MMS_NOTI)
if(storageChangeType == MSG_STORAGE_CHANGE_INSERT)
{
- LogDebug("MSG_STORAGE_CHANGE_INSERT");
+ LoggerD("MSG_STORAGE_CHANGE_INSERT");
event->setMsg_Event_Type(EventMessageReceived::MSG_ADDED);
}
else if(storageChangeType == MSG_STORAGE_CHANGE_UPDATE)
{
- LogDebug("MSG_STORAGE_CHANGE_UPDATE");
+ LoggerD("MSG_STORAGE_CHANGE_UPDATE");
event->setMsg_Event_Type(EventMessageReceived::MSG_UPDATED);
}
}
else
{
- LogError("Ignore this sms, this is mms noti.");
+ LoggerE("Ignore this sms, this is mms noti.");
}
}
else if((msgType >= MSG_TYPE_MMS) && (msgType <= MSG_TYPE_MMS_NOTI))
}
else
{
- LogError("Ignore this mms, this is mms noti.");
+ LoggerE("Ignore this mms, this is mms noti.");
}
}
if(msg != NULL)
{
- LogError("release msg : " << msg);
+ LoggerE("release msg : " << msg);
msg_release_struct(&msg);
}
msg_release_struct(&sendOpt);
}
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("Couldn't convert message to sms.");
+ LoggerE("Couldn't convert message to sms.");
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("onMessageStorageChanged platform exception");
+ LoggerE("onMessageStorageChanged platform exception");
}
}
}
msg_message_t msg,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
Messaging* this_ = static_cast<Messaging*>(data);
if (this_) {
Try {
}
else
{
- LogError("Ignore this sms, this is mms noti.");
+ LoggerE("Ignore this sms, this is mms noti.");
}
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("Couldn't convert message to sms.");
+ LoggerE("Couldn't convert message to sms.");
}
}
}
msg_message_t msg,
void* data)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
Messaging* this_ = static_cast<Messaging*>(data);
if (this_) {
Try {
this_->m_onMessageReceived.emit(event);
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("Couldn't convert message to mms.");
+ LoggerE("Couldn't convert message to mms.");
}
}
}
} else if (MMS == msgType) {
msgTypePlatform = MSG_TYPE_MMS;
} else {
- LogError("no supported message type in this method");
+ LoggerE("no supported message type in this method");
Throw(WrtDeviceApis::Commons::PlatformException);
}
msgFolderId = MSG_DRAFT_ID;
break;
default:
- LogError("wrong folder type");
+ LoggerE("wrong folder type");
Throw(WrtDeviceApis::Commons::PlatformException);
break;
}
if (msg_get_folder_view_list(MsgGetCommonHandle(), msgFolderId,
&sort_rules,
&folderListView) != MSG_SUCCESS) {
- LogDebug(
+ LoggerD(
"msg_get_folder_view_list empty or failed, msgFolderId=" <<
(int) msgFolderId);
Throw(WrtDeviceApis::Commons::PlatformException);
}
// go thtough all message to check type of message
- LogDebug("msgCount=" << (int) folderListView.nCount);
+ LoggerD("msgCount=" << (int) folderListView.nCount);
for (int msg_cnt = 0; msg_cnt < folderListView.nCount; msg_cnt++) {
- LogDebug("msgMainType=" <<
+ LoggerD("msgMainType=" <<
(int) msg_get_message_type(folderListView.
msgInfo[
msg_cnt]) <<
}
msg_release_list_struct(&folderListView);
- LogDebug("readed=" << *read << ", unReaded=" << *unread);
+ LoggerD("readed=" << *read << ", unReaded=" << *unread);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
vector<IMessagePtr> Messaging::findSms(FolderType folder, const DeviceAPI::Tizen::FilterPtr& filter)
{
- LogDebug("<<<");
+ LoggerD("<<<");
vector<IMessagePtr> retVal;
msg_message_t msg = msg_new_message();
res = msg_get_folder_view_list(MsgGetCommonHandle(), platformFolder, &sort_rules, &folder_list_view);
if (MSG_SUCCESS != res) {
- LogError("msg_get_folder_view_list failed " << res);
+ LoggerE("msg_get_folder_view_list failed " << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
msg_release_list_struct(&folder_list_view);
}Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (folder_list_view.nCount) {
msg_release_list_struct(&folder_list_view);
}
throw;
}
- LogDebug(">>>");
+ LoggerD(">>>");
return retVal;
}
&folder_list_view);
if (MSG_SUCCESS != res) {
- LogError("msg_Get_folder_view_list failed" << res);
+ LoggerE("msg_Get_folder_view_list failed" << res);
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
if (folder_list_view.nCount) {
msg_release_list_struct(&folder_list_view);
}
createEmailFolder(userFolder);
break;
default:
- LogError("msg not supported");
+ LoggerE("msg not supported");
Throw(WrtDeviceApis::Commons::UnknownException);
}
}
{
/*
if (userFolder.length() > MAX_FOLDER_NAME_SIZE) {
- LogError("folder name to long");
+ LoggerE("folder name to long");
Throw(WrtDeviceApis::Commons::PlatformException);
}
folderInfo.folderType = MSG_FOLDER_TYPE_USER_DEF;
if (msg_add_folder(MsgGetCommonHandle(), &folderInfo) != MSG_SUCCESS) {
- LogError("msg_add_folder failed");
+ LoggerE("msg_add_folder failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
*/
void Messaging::createEmailFolder(const std::string& userFolder)
{
//TODO
- LogError("TODO");
+ LoggerE("TODO");
Throw(WrtDeviceApis::Commons::UnknownException);
}
deleteEmailFolder(userFolder);
break;
default:
- LogError("msg not supported");
+ LoggerE("msg not supported");
Throw(WrtDeviceApis::Commons::UnknownException);
}
}
int platformFolderId = convertFolderToPlatform(userFolder);
if (MSG_SUCCESS !=
msg_delete_folder(MsgGetCommonHandle(), platformFolderId)) {
- LogError("msg_get_folder_list failed");
+ LoggerE("msg_get_folder_list failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
void Messaging::deleteEmailFolder(const string& userFolder)
{
//TODO
- LogError("TODO");
+ LoggerE("TODO");
Throw(WrtDeviceApis::Commons::UnknownException);
}
case EMAIL:
return getFolderNamesEmail();
default:
- LogError("msg not supported");
+ LoggerE("msg not supported");
Throw(WrtDeviceApis::Commons::UnknownException);
}
}
{
if (msg_get_folder_list(MsgGetCommonHandle(),
&msgFolderList) != MSG_SUCCESS) {
- LogError("msg_get_folder_list failed");
+ LoggerE("msg_get_folder_list failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
- LogDebug("number of folder=" << msgFolderList.nCount);
+ LoggerD("number of folder=" << msgFolderList.nCount);
for (int i = 0; i < msgFolderList.nCount; i++) {
- LogDebug("folderName=" << msgFolderList.folderInfo[i].folderName);
- LogDebug("folderId=" << (int) msgFolderList.folderInfo[i].folderId);
- LogDebug(
+ LoggerD("folderName=" << msgFolderList.folderInfo[i].folderName);
+ LoggerD("folderId=" << (int) msgFolderList.folderInfo[i].folderId);
+ LoggerD(
"folderType=" <<
(int) msgFolderList.folderInfo[i].folderType);
retVal.push_back(msgFolderList.folderInfo[i].folderName);
{
if (!email_get_mailbox_list(account.getIntId(), -1, &mailboxes,
&mailboxesCount) || !mailboxes) {
- LogError("error during get mailboxes");
+ LoggerE("error during get mailboxes");
}
if(mailboxes == NULL)
{
- LogError("error during get mailboxes");
+ LoggerE("error during get mailboxes");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"Couldn't get mailboxes");
}
for (int i = 0; i < mailboxesCount; i++) {
retVal.push_back(mailboxes->mailbox_name);
- LogDebug("mailbox found, name=" << mailboxes->mailbox_name);
+ LoggerD("mailbox found, name=" << mailboxes->mailbox_name);
mailboxes++;
}
if(mailboxes != NULL)
{
if( EMAIL_ERROR_NONE != email_free_mailbox( &mailboxes , mailboxesCount) )
- LogDebug("fail to email_free_mailbox - err ");
+ LoggerD("fail to email_free_mailbox - err ");
}
}
EmailAccountInfo account = getCurrentEmailAccount();
if (account.getId().empty()) {
- LogWarning("No valid email accounts. Skipping");
+ LoggerW("No valid email accounts. Skipping");
return retVal;
}
DPL::ScopedFree<email_mail_list_item_t> autoFree(results);
(void)autoFree;
if (EMAIL_ERROR_MAIL_NOT_FOUND == err || results == NULL) {
- LogWarning("No emails found in mailbox: " << folder);
+ LoggerW("No emails found in mailbox: " << folder);
break;
} else if (EMAIL_ERROR_NONE != err) {
- LogError(
+ LoggerE(
"Unable to get mail list for mailbox: " << folder <<
", Error: " << err);
Throw(WrtDeviceApis::Commons::PlatformException);
EmailAccountInfo account = getCurrentEmailAccount();
if (account.getId().empty()) {
- LogWarning("No valid email accounts.");
+ LoggerW("No valid email accounts.");
return result;
}
name = EmailConverter::toMailboxName(folder);
}
catch (const WrtDeviceApis::Commons::PlatformException& ex) {
- LogWarning(ex.DumpToString());
+ LoggerW(ex.DumpToString());
return result;
}
&count);
DPL::ScopedFree<email_mail_list_item_t> freeGuard(messages);
if ((EMAIL_ERROR_MAIL_NOT_FOUND == error) || (NULL == messages)) {
- LogWarning("No emails found in mailbox: " << name);
+ LoggerW("No emails found in mailbox: " << name);
break;
} else if (EMAIL_ERROR_NONE != error) {
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
*/
int Messaging::getConversationId(const int& msgId, const MessageType& msgtype)
{
- LogDebug("Enter");
+ LoggerD("Enter");
switch(msgtype)
{
email_mail_list_item_t *mailList = NULL;
email_mail_data_t* result = NULL;
- LogDebug("Current Account " << m_currentEmailAccountId);
+ LoggerD("Current Account " << m_currentEmailAccountId);
try
{
// if (mailBox)
// free(mailBox);
email_free_mail_data(&result,1);
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
throw;
}
return MSG_ERR_INVALID_MSG_TYPE;
int threadId = 0;
err = msg_get_int_value(msg, MSG_MESSAGE_THREAD_ID_INT, &threadId);
- LogDebug(err);
+ LoggerD(err);
if( err < MSG_SUCCESS )
{
std::vector<IConversationPtr> Messaging::queryConversations(const DeviceAPI::Tizen::SortModePtr& sortMode,
const DeviceAPI::Tizen::FilterPtr& filter, long limit, long offset)
{
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<IConversationPtr> result;
std::string filterSql;
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
int conversationType = queryGenerator->getMessageType();
switch(conversationType){
case EMAIL:{
- LogDebug("type is EMAIL:[" << conversationType <<"]");
+ LoggerD("type is EMAIL:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_EMAIL);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
}
case SMS:{
- LogDebug("type is SMS:[" << conversationType <<"]");
+ LoggerD("type is SMS:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_SMS_MMS);
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql:[" << orderLimitSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql:[" << orderLimitSql <<"]");
result = querySmsMmsConversation(filterSql, orderLimitSql);
break;
}
case MMS:{
- LogDebug("type is MMS:[" << conversationType <<"]");
+ LoggerD("type is MMS:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_SMS_MMS);
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql:[" << orderLimitSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql:[" << orderLimitSql <<"]");
result = querySmsMmsConversation(filterSql, orderLimitSql);
break;
}
default:{
- LogError("[ERROR] >>> invlid type:[" << conversationType <<"]");
+ LoggerE("[ERROR] >>> invlid type:[" << conversationType <<"]");
return result;
}
} //switch
std::vector<IConversationPtr> Messaging::queryConversations(const DeviceAPI::Tizen::FilterPtr& filter,
const DeviceAPI::Tizen::SortModePtr& sortMode, int type, long limit, long offset)
{
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<IConversationPtr> result;
std::string filterSql;
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
int conversationType = queryGenerator->getMessageType();
if(conversationType != -1)
{
if(conversationType != type)
{
- LogDebug("filter conversationType and service msg type is diff");
+ LoggerD("filter conversationType and service msg type is diff");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid Fiilter Type");
}
}
switch(type){
case EMAIL:{
- LogDebug("type is EMAIL:[" << conversationType <<"]");
+ LoggerD("type is EMAIL:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_EMAIL);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
- LogDebug("filterSql:[" << filterSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
result = queryEmailConversation(filterSql);
break;
}
case SMS:{
- LogDebug("type is SMS:[" << conversationType <<"]");
+ LoggerD("type is SMS:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_SMS);
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
orderLimitSql = queryGenerator->getOrderLimit();
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql:[" << orderLimitSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql:[" << orderLimitSql <<"]");
result = querySmsMmsConversation(filterSql, orderLimitSql);
break;
}
case MMS:{
- LogDebug("type is MMS:[" << conversationType <<"]");
+ LoggerD("type is MMS:[" << conversationType <<"]");
queryGenerator->reset(MessageQueryGenerator::MODE_MMS);
IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<IFilterVisitor>(queryGenerator);
filter->travel(filterVisitor, 0);
filterSql = queryGenerator->getQuery();
orderLimitSql = queryGenerator->getOrderLimit();
- LogDebug("filterSql:[" << filterSql <<"]");
- LogDebug("orderLimitSql:[" << orderLimitSql <<"]");
+ LoggerD("filterSql:[" << filterSql <<"]");
+ LoggerD("orderLimitSql:[" << orderLimitSql <<"]");
result = querySmsMmsConversation(filterSql, orderLimitSql);
break;
}
default:{
- LogError("[ERROR] >>> invlid type:[" << conversationType <<"]");
+ LoggerE("[ERROR] >>> invlid type:[" << conversationType <<"]");
return result;
}
} //switch
/*
bool Messaging::deleteConversations(const DeviceAPI::Tizen::SortModePtr& sortMode, const DeviceAPI::Tizen::FilterPtr& filter)
{
- LogDebug("Enter");
+ LoggerD("Enter");
std::vector<IConversationPtr> conversationsToDelete = queryConversations(sortMode, filter);
return deleteConversations(conversationsToDelete);
*/
bool Messaging::deleteConversations(const std::vector<IConversationPtr>& conversations)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (conversations.size() == 0)
return false;
if (conversations[0]->getType() == EMAIL)
{
- LogDebug("Enter-Email");
+ LoggerD("Enter-Email");
int threadId = 0;
for (std::size_t i = 0; i < conversations.size(); ++i)
}
else
{
- LogDebug("Enter-Msg");
+ LoggerD("Enter-Msg");
msg_thread_id_t threadId = 0;
msg_handle_t handle = MsgGetCommonHandle();
std::vector<IMessageFolderPtr> Messaging::queryFolders(const DeviceAPI::Tizen::FilterPtr& filter)
{
- LogDebug("Enter");
+ LoggerD("Enter");
email_mailbox_t* mailboxes = NULL;
email_mailbox_t* mailboxes_org = NULL;
EmailAccountInfo account = getCurrentEmailAccount();
if (account.getId().empty()) {
- LogWarning("No valid email accounts. Skipping");
+ LoggerW("No valid email accounts. Skipping");
return result;
}
if(accountId == 0)
{
- LogWarning("No valid email accounts. accountId : 0");
+ LoggerW("No valid email accounts. accountId : 0");
return result;
}
if(email_get_mailbox_by_name(accountId, folderName.c_str(), &mailboxes) != 1)
{
- LogError("error during get mailboxes");
+ LoggerE("error during get mailboxes");
return result;
}
if (!email_get_mailbox_list(accountId, -1, &mailboxes, &mailboxesCount) || !mailboxes)
{
- LogError("error during get mailboxes");
+ LoggerE("error during get mailboxes");
return result;
}
if (mailboxesCount <= 0)
{
- LogDebug("Empty...");
+ LoggerD("Empty...");
}
else
{
- LogDebug("found mailboxs : " << mailboxesCount);
+ LoggerD("found mailboxs : " << mailboxesCount);
for (int i = 0; i < mailboxesCount; i++)
{
if(mailboxes != NULL)
{
error = email_free_mailbox(&mailboxes,mailboxesCount);
- LogError("email_free_mailbox : " << error);
+ LoggerE("email_free_mailbox : " << error);
}
}
- LogDebug("End");
+ LoggerD("End");
return result;
#include "MessageAsyncCallbackManager.h"
#include <dpl/singleton_safe_impl.h>
+#include <Logger.h>
IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::MessagingController)
GetMessagingServiceReceiver (ThreadEnum::NULL_THREAD),
MessagingServiceReceiver (ThreadEnum::NULL_THREAD)
{
- LogDebug("<<< ");
- LogDebug(">>>");
+ LoggerD("<<< ");
+ LoggerD(">>>");
}
MessagingController::~MessagingController() {
- LogDebug("<<<");
- LogDebug(">>>");
+ LoggerD("<<<");
+ LoggerD(">>>");
}
MessagingController& MessagingController::getInstance()
}
void MessagingController::OnAnswerReceived(const EventGetMessagingServicePtr &event) {
- LogDebug("<<<");
+ LoggerD("<<<");
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager > (event->getPrivateData());
MessageAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
JSObjectRef jsMessagingServiceObject[count]; //make
- LogDebug(" Service Count :" << count);
+ LoggerD(" Service Count :" << count);
for (index = 0; index < count; index++)
{
}
else
{
- LogDebug("Operation failed. Exception code: " << event->getExceptionCode());
+ LoggerD("Operation failed. Exception code: " << event->getExceptionCode());
JSContextRef context = callbackManager->getContext();
JSValueRef errorObject = NULL;
callbackManager->callOnError(errorObject);
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void MessagingController::OnAnswerReceived(const EventMessagingServicePtr &event)
{
- LogDebug(" <<< EventMessagingServicePtr >>> ");
+ LoggerD(" <<< EventMessagingServicePtr >>> ");
EventMessagingServicePrivateDataPtr privateData =
DPL::StaticPointerCast<EventMessagingServicePrivateData>(event->getPrivateData());
JSContextRef globalContext = callbackManager->getContext();
int MessagingServiceEventType = event->getEventType();
- LogDebug(" MessagingServiceEvent Type :" << MessagingServiceEventType);
+ LoggerD(" MessagingServiceEvent Type :" << MessagingServiceEventType);
ConverterMessageFactory::ConverterType converter =
ConverterMessageFactory::getConverter(globalContext);
if (MessagingServiceEventType == MESSAGING_SERVICE_EVENT_TYPE_LOAD_MESSAGE_BODY)
{
- LogDebug(" Message Load Body");
- LogDebug("Operation ID : " << event->opId);
+ LoggerD(" Message Load Body");
+ LoggerD("Operation ID : " << event->opId);
if ( event->m_messagingService)
event->m_messagingService->deleteOpId(event->opId);
if (event->getExceptionCode() == ExceptionCodes::None && event->m_message)
{
- LogDebug(" Message Type :" << event->m_message->getMessageType());
+ LoggerD(" Message Type :" << event->m_message->getMessageType());
JSValueRef msg = JSMessage::createJSObject(globalContext, event->m_message);
if(msg)
callbackManager->callOnSuccess(msg);
}
else if (MessagingServiceEventType == MESSAGING_SERVICE_EVENT_TYPE_LOAD_MESSAGE_ATTACHMENT)
{
- LogDebug(" Message load attachment");
- LogDebug("Operation ID : " << event->opId);
+ LoggerD(" Message load attachment");
+ LoggerD("Operation ID : " << event->opId);
if ( event->m_messagingService)
event->m_messagingService->deleteOpId(event->opId);
if (event->getExceptionCode() == ExceptionCodes::None && event->m_attachment)
{
- LogDebug(" Message Type :" << event->m_message->getMessageType());
+ LoggerD(" Message Type :" << event->m_message->getMessageType());
JSValueRef attachment = JSMessageAttachment::createJS(globalContext, event->m_attachment );
if ( attachment)
}
else if (MessagingServiceEventType == MESSAGING_SERVICE_EVENT_TYPE_SYNC)
{
- LogDebug(" Message Sync :");
- LogDebug("Operation ID : " << event->opId);
+ LoggerD(" Message Sync :");
+ LoggerD("Operation ID : " << event->opId);
if ( event->m_messagingService)
event->m_messagingService->deleteOpId(event->opId);
}
else if (MessagingServiceEventType == MESSAGING_SERVICE_EVENT_TYPE_SYNC_FOLDER)
{
- LogDebug(" Message Sync Folder");
- LogDebug("Operation ID : " << event->opId);
+ LoggerD(" Message Sync Folder");
+ LoggerD("Operation ID : " << event->opId);
if ( event->m_messagingService)
event->m_messagingService->deleteOpId(event->opId);
if (event->getExceptionCode() == ExceptionCodes::None)
//remove operation handle
if (event->m_messagingService)
{
- LogDebug("Operation ID : " << event->opId);
+ LoggerD("Operation ID : " << event->opId);
event->m_messagingService->deleteOpId(event->opId);
}
if (WrtDeviceApis::Commons::ExceptionCodes::None == event->getExceptionCode())
{
- LogDebug(" success size : " << event->m_successRecipients.size());
+ LoggerD(" success size : " << event->m_successRecipients.size());
std::vector<JSValueRef> successRecipentList;
int cnt = event->m_successRecipients.size();
- LogDebug( "success count : " << cnt);
+ LoggerD( "success count : " << cnt);
for(int index = 0; index < cnt; index++)
{
- LogDebug( "success recipent : " << event->m_successRecipients[index]);
+ LoggerD( "success recipent : " << event->m_successRecipients[index]);
successRecipentList.push_back(converter.toJSValueRef(event->m_successRecipients[index]));
}
}
void MessagingController::OnAnswerReceived(const EventSendMessagePtr& event)
{
- LogDebug("ENTER");
+ LoggerD("ENTER");
JSValueRef error = NULL;
EventSendMessagePrivateDataPtr privateData =
//remove operation handle
if (event->m_messagingService)
{
- LogDebug("Operation ID : " << event->opId);
+ LoggerD("Operation ID : " << event->opId);
event->m_messagingService->deleteOpId(event->opId);
}
if (WrtDeviceApis::Commons::ExceptionCodes::None == event->getExceptionCode()) {
- LogDebug(" success size : " << event->m_successRecipients.size());
+ LoggerD(" success size : " << event->m_successRecipients.size());
//JSObjectRef result = JSObjectMakeArray(context, event->m_successRecipients.size(), jsMessagingServiceObject, NULL);
std::vector<JSValueRef> successRecipentList;
int cnt = event->m_successRecipients.size();
- LogDebug( "success count : " << cnt);
+ LoggerD( "success count : " << cnt);
for(int index = 0; index < cnt; index++)
{
- LogDebug( "success recipent : " << event->m_successRecipients[index]);
+ LoggerD( "success recipent : " << event->m_successRecipients[index]);
successRecipentList.push_back(converter.toJSValueRef(event->m_successRecipients[index]));
}
#ifndef WRTPLUGINS_TIZEN_MESSAGING_CONTROLLER_H_
#define WRTPLUGINS_TIZEN_MESSAGING_CONTROLLER_H_
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "IMessagingServiceManager.h"
#include "IMessagingService.h"
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Assert(NULL != callbackManager);
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
JSContextRef context = callbackManager->getContext();
Assert(NULL != context);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogError("InvalidArgument error");
+ LoggerE("InvalidArgument error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT));
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Assert(NULL != callbackManager);
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
JSContextRef context = callbackManager->getContext();
Assert(NULL != context);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT));
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Assert(NULL != callbackManager);
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
JSContextRef context = callbackManager->getContext();
Assert(NULL != context);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Assert(NULL != callbackManager);
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
JSContextRef context = callbackManager->getContext();
Assert(NULL != context);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager =
DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Assert(NULL != callbackManager);
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
JSContextRef context = callbackManager->getContext();
Assert(NULL != context);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::UnknownException) {
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
void MessagingListener::OnAnswerReceived(const EventQueryConversationsPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
Catch(WrtDeviceApis::Commons::PlatformException)
{
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT));
}
Catch(WrtDeviceApis::Commons::UnknownException)
{
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
void MessagingListener::OnAnswerReceived(const EventDeleteConversationsPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
JSContextRef context = callbackManager->getContext();
}
Catch(WrtDeviceApis::Commons::PlatformException)
{
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::UnknownException)
{
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
void MessagingListener::OnAnswerReceived(const EventQueryFoldersPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
{
vector<IMessageFolderPtr> folderPtr = event->getFolders();
int size = folderPtr.size();
- LogDebug(size);
+ LoggerD(size);
ConverterMessageFactory::ConverterType converter = ConverterMessageFactory::getConverter(context);
callbackManager->callOnSuccess(converter->toJSValueRef(folderPtr));
Catch(WrtDeviceApis::Commons::PlatformException)
{
- LogError("platform error");
+ LoggerE("platform error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::ConversionException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- LogError("conversion error");
+ LoggerE("conversion error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::INVALID_VALUES_ERROR, JSMESSAGING_EXCEPTION_MSG_INVALID_ARGUMENT));
}
Catch(WrtDeviceApis::Commons::UnknownException)
{
- LogError("unknown error");
+ LoggerE("unknown error");
callbackManager->callOnError(JSTizenExceptionFactory::makeErrorObject(context,
JSTizenException::UNKNOWN_ERROR, JSMESSAGING_EXCEPTION_MSG_UNKNOWN));
}
void MessagingListener::onAnswerReceived(
const EventMessageReceivedPtr& event)
{
- LogDebug("<<<");
+ LoggerD("<<<");
if (WrtDeviceApis::Commons::ExceptionCodes::None != event->getExceptionCode())
{
- LogError("exception occured: " << event->getExceptionCode());
+ LoggerE("exception occured: " << event->getExceptionCode());
return;
}
if(filter != NULL && msg->getMessageType() != EMPTY_MESSAGE)
{
- LogDebug("Filter exist");
+ LoggerD("Filter exist");
StorageChangesMessageGeneratorPtr queryGenerator(new StorageChangesMessageGenerator(event->getMessage(), event->getConversation()));
DeviceAPI::Tizen::IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<DeviceAPI::Tizen::IFilterVisitor>(queryGenerator);
// IMessagePtr msg = event->getMessage();
if(queryGenerator->getCompareResult())
{
- LogDebug("Message call back");
+ LoggerD("Message call back");
msgs.push_back(msg);
jsMsg = converter->toJSValueRef(msgs, this);
}
else
{
- LogDebug("skip");
+ LoggerD("skip");
return;
}
}
else
{
- LogDebug("Filter not exist or empty message");
+ LoggerD("Filter not exist or empty message");
std::vector<IMessagePtr> msgs; // for msg
IMessagePtr msg = event->getMessage();
msgs.push_back(msg);
if(filter != NULL && msg->getMessageType() != EMPTY_MESSAGE)
{
- LogDebug("Filter exist");
+ LoggerD("Filter exist");
StorageChangesConversationGeneratorPtr queryGenerator(new StorageChangesConversationGenerator(event->getConversation()));
DeviceAPI::Tizen::IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<DeviceAPI::Tizen::IFilterVisitor>(queryGenerator);
IConversationPtr conversation = event->getConversation();
if(queryGenerator->getCompareResult())
{
- LogDebug("Message call back");
+ LoggerD("Message call back");
convPtrs.push_back(conversation);
jsMsg = converter->toJSValueRef(convPtrs);
}
else
{
- LogDebug("skip");
+ LoggerD("skip");
return;
}
}
else
{
- LogDebug("Filter not exist or empty conversation");
+ LoggerD("Filter not exist or empty conversation");
std::vector<IConversationPtr> convPtrs; // for conversation
IConversationPtr conversation = event->getConversation();
- LogDebug("Conversation call back");
+ LoggerD("Conversation call back");
convPtrs.push_back(conversation);
jsMsg = converter->toJSValueRef(convPtrs);
DeviceAPI::Tizen::FilterPtr filter = multiCallbacks->getFilter();
if(filter != NULL)
{
- LogDebug("Filter exist");
+ LoggerD("Filter exist");
StorageChangesFolderGeneratorPtr queryGenerator(new StorageChangesFolderGenerator(event->getMessageFolder()));
DeviceAPI::Tizen::IFilterVisitorPtr filterVisitor = DPL::StaticPointerCast<DeviceAPI::Tizen::IFilterVisitor>(queryGenerator);
IMessageFolderPtr messagefolder = event->getMessageFolder();
if(queryGenerator->getCompareResult())
{
- LogDebug("Message call back");
+ LoggerD("Message call back");
folderPtrs.push_back(messagefolder);
jsMsg = converter->toJSValueRef(folderPtrs);
}
else
{
- LogDebug("skip");
+ LoggerD("skip");
return;
}
}
else
{
- LogDebug("Filter not exist");
+ LoggerD("Filter not exist");
std::vector<IMessageFolderPtr> folderPtrs; // for messagefoldeer
IMessageFolderPtr messagefolder = event->getMessageFolder();
- LogDebug("MessageFolder call back");
+ LoggerD("MessageFolder call back");
folderPtrs.push_back(messagefolder);
jsMsg = converter->toJSValueRef(folderPtrs);
{
case EventMessageReceived::MSG_ADDED:
{
- multiCallbacks->getMessagesAdded()->callOnSuccess(jsMsg);
+ if(multiCallbacks->getMessagesAdded())
+ {
+ multiCallbacks->getMessagesAdded()->callOnSuccess(jsMsg);
+ }
}
break;
case EventMessageReceived::MSG_UPDATED:
{
- defaultCbm = multiCallbacks->getMessagesUpdated();
- defaultCbm->callOnSuccess(jsMsg);
+ if(multiCallbacks->getMessagesUpdated())
+ {
+ defaultCbm = multiCallbacks->getMessagesUpdated();
+ defaultCbm->callOnSuccess(jsMsg);
+ }
}
break;
case EventMessageReceived::MSG_DELETED:
{
- defaultCbm = multiCallbacks->getMessagesRemoved();
- defaultCbm->callOnSuccess(jsMsg);
+ if(multiCallbacks->getMessagesRemoved())
+ {
+ defaultCbm = multiCallbacks->getMessagesRemoved();
+ defaultCbm->callOnSuccess(jsMsg);
+ }
}
break;
default:
{
callbacks = &m_MessageCallbacks;
handle = static_cast<long>(m_emiterMsgId.back());
- LogWarning("Message Emitter handle : " << handle);
+ LoggerW("Message Emitter handle : " << handle);
}
break;
case CONVERSATIONS_MULTI_FUNCTION:
{
callbacks = &m_ConversationCallbacks;
handle = static_cast<long>(m_emiterConvId.back());
- LogWarning("Conversation Emitter handle : " << handle);
+ LoggerW("Conversation Emitter handle : " << handle);
}
break;
case FOLDERS_MULTI_FUNCTION:
{
callbacks = &m_FolderCallbacks;
handle = static_cast<long>(m_emiterFolderId.back());
- LogWarning("Folder Emitter handle : " << handle);
+ LoggerW("Folder Emitter handle : " << handle);
}
break;
default:
{
- LogWarning("Unexpected state");
+ LoggerW("Unexpected state");
}
break;
}
if(!checkMessagingEmitter(handle, type, index))
{
- LogWarning("Try to deregister by unmatched service");
- Throw(WrtDeviceApis::Commons::InvalidArgumentException);
+ LoggerW("Try to deregister by unmatched service or unknown id");
+ ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "Unknown id");
}
msgRemoved += m_MessageCallbacks.erase(handle);
// there are duplicate handles
if (msgRemoved+msgRemoved+folderRemoved > 1) {
- LogError("Duplicate callback handles!");
+ LoggerE("Duplicate callback handles!");
}
EmitterMessageReceived::IdType temp_handle;
temp_handle = static_cast<EmitterMessageReceived::IdType>(handle);
if (msgRemoved) {
- LogWarning("EmitterMessageReceived registered");
+ LoggerW("EmitterMessageReceived registered");
IMessaging::getInstance().removeOnMessageMsgReceived(temp_handle);
removeMessagingEmitter(temp_handle);
for(unsigned int i=0; i<m_emiterMsgId.size(); i++)
{
if(temp_handle == static_cast<long>(m_emiterMsgId[i]))
{
- LogWarning("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterMsgId[i]) );
+ LoggerW("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterMsgId[i]) );
m_emiterMsgId.erase(m_emiterMsgId.begin()+i);
}
}
}
else if (convRemoved) {
- LogWarning("EmitterConversationReceived registered");
+ LoggerW("EmitterConversationReceived registered");
IMessaging::getInstance().removeOnMessageConvReceived(temp_handle);
removeMessagingEmitter(temp_handle);
for(unsigned int i=0; i<m_emiterConvId.size(); i++)
{
if(temp_handle == static_cast<long>(m_emiterConvId[i]))
{
- LogWarning("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterConvId[i]) );
+ LoggerW("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterConvId[i]) );
m_emiterConvId.erase(m_emiterConvId.begin()+i);
}
}
}
else if (folderRemoved) {
- LogWarning("EmitterFolderReceived registered");
+ LoggerW("EmitterFolderReceived registered");
IMessaging::getInstance().removeOnMessageFolderReceived(temp_handle);
removeMessagingEmitter(temp_handle);
for(unsigned int i=0; i<m_emiterFolderId.size(); i++)
{
if(temp_handle == static_cast<long>(m_emiterFolderId[i]))
{
- LogWarning("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterFolderId[i]) );
+ LoggerW("handle : handle " << temp_handle<< " " << static_cast<long>(m_emiterFolderId[i]) );
m_emiterFolderId.erase(m_emiterFolderId.begin()+i);
}
}
}
}
Catch(WrtDeviceApis::Commons::PlatformException){
- LogDebug("registerMessageReceivedEmitter failed");
+ LoggerD("registerMessageReceivedEmitter failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
void MessagingListener::deregisterMessageReceivedEmitter()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_emiterMsgId.size() > 0) {
- LogWarning("EmitterMessageReceived registered");
+ LoggerW("EmitterMessageReceived registered");
EmitterMessageReceived::IdType tempId;
while(m_emiterMsgId.size() > 0)
{
}
if (m_emiterConvId.size() > 0) {
- LogWarning("EmitterConversationReceived registered");
+ LoggerW("EmitterConversationReceived registered");
EmitterConversationReceived::IdType tempId;
while(m_emiterConvId.size() > 0)
{
}
if (m_emiterFolderId.size() > 0) {
- LogWarning("EmitterFolderReceived registered");
+ LoggerW("EmitterFolderReceived registered");
EmitterFolderReceived::IdType tempId;
while(m_emiterFolderId.size() > 0)
{
{
removeMessagingEmitter(it->first);
}
- LogDebug("finish");
+ LoggerD("finish");
return;
}
int ret = FALSE;
MessagingEmitterRegistersIterator it = m_requests.find(handle);
- LogDebug("handle, type, index"<< handle << " " << type << " " << index);
- LogDebug("it->second.type, it->second.accountId"<< it->second.type << " " << it->second.accountId);
+ LoggerD("handle, type, index"<< handle << " " << type << " " << index);
+ LoggerD("it->second.type, it->second.accountId"<< it->second.type << " " << it->second.accountId);
if((it->second.type == type) && (it->second.accountId == index))
{
void MessagingListener::addMessagingEmitter(long handle, int type, long index)
{
- LogDebug("handle, type, index"<< handle << " " << type << " " << index);
+ LoggerD("handle, type, index"<< handle << " " << type << " " << index);
m_requests.insert(std::make_pair(handle, MessagingEmitterData(type, index)));
}
void MessagingListener::removeMessagingEmitter(long handle)
{
- LogDebug("handle"<< handle );
+ LoggerD("handle"<< handle );
m_requests.erase(handle);
}
#include <email-types.h>
#include <email-api.h>
+#include <Logger.h>
using namespace DPL;
using namespace std;
MessagingService::MessagingService() :
m_initialized(false)
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
MessagingService::~MessagingService() {
- LogDebug("Leave");
+ LoggerD("Leave");
m_opRequests.clear(); //clean Messaging Service Handles
}
//public function.
void MessagingService::initialize() {
- LogDebug("<<<");
+ LoggerD("<<<");
m_initialized = true;
- LogDebug(">>>");
+ LoggerD(">>>");
}
void MessagingService::setMessagingServiceType(int type)
int MessagingService::sync(const IMessagingServicePtr& messagingService, const int limit)
{
- LogDebug("<<<");
+ LoggerD("<<<");
return MailSync::getInstance().syncAccount( messagingService, limit );
}
void MessagingService::syncCancel(int handle)
{
- LogDebug("<<<");
+ LoggerD("<<<");
return MailSync::getInstance().syncAccountCancel(handle);
}
int MessagingService::syncFolder(const IMessagingServicePtr& messagingService, const int folder_id, const int limit)
{
- LogDebug("<<<");
+ LoggerD("<<<");
return MailSync::getInstance().syncFolder( messagingService, folder_id, limit);
}
void MessagingService::syncFolderCancel(int handle)
{
- LogDebug("<<<");
+ LoggerD("<<<");
return MailSync::getInstance().syncFolderCancel(handle);
}
index = type;
}
- LogDebug("m_opRequests size : " << cnt );
- LogDebug("index " << index);
+ LoggerD("m_opRequests size : " << cnt );
+ LoggerD("index " << index);
m_opRequests.insert(std::make_pair(index, MessagingServiceOpData(0,type)));
return index;
int MessagingService::getHandleFromOpId(int opIdx)
{
- LogDebug("operation index size : " << opIdx);
+ LoggerD("operation index size : " << opIdx);
int handle = -1;
handle = it->second.handle;
}
- LogDebug("index " << handle);
+ LoggerD("index " << handle);
return handle;
}
IMessagePtr MessagingService::getMessageFromOpId(int opIdx)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
OpRequestsIterator it = m_opRequests.find(opIdx);
IMessagePtr msg;
if ( m_opRequests.end() != it)
EventMessagingServicePtr MessagingService::getEventFromOpId(int opIdx)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
OpRequestsIterator it = m_opRequests.find(opIdx);
EventMessagingServicePtr event;
if ( m_opRequests.end() != it)
{
- LogDebug("Find Event");
+ LoggerD("Find Event");
event = it->second.event;
}
EventMessagingServicePtr MessagingService::getEventFromHandle(int handle)
{
- LogDebug("handle index : " << handle);
+ LoggerD("handle index : " << handle);
EventMessagingServicePtr event;
int cnt = m_opRequests.size(); //item count.
- LogDebug("cnt : " << cnt);
+ LoggerD("cnt : " << cnt);
if (cnt > 0)
{
OpRequestsIterator it;
for( it = m_opRequests.begin(); it != m_opRequests.end(); ++it)
{
- LogDebug("it->first : " << it->first);
- LogDebug("it->second.handle : " << it->second.handle);
+ LoggerD("it->first : " << it->first);
+ LoggerD("it->second.handle : " << it->second.handle);
if((unsigned int)handle == it->second.handle)
{
- LogDebug("get opId : " << it->first);
- LogDebug("event of handle : " << it->second.handle);
+ LoggerD("get opId : " << it->first);
+ LoggerD("event of handle : " << it->second.handle);
event = it->second.event;
}
}
void MessagingService::setHandleToOpId(int opIdx, int handle)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
OpRequestsIterator it = m_opRequests.find(opIdx);
if ( m_opRequests.end() != it)
{
- LogDebug(" find Message ");
+ LoggerD(" find Message ");
it->second.handle = handle;
}
void MessagingService::setMessageToOpId(int opIdx, IMessagePtr& message)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
OpRequestsIterator it = m_opRequests.find(opIdx);
if ( m_opRequests.end() != it)
{
- LogDebug("set Message ");
+ LoggerD("set Message ");
it->second.message = message;
}
}
void MessagingService::setEventToOpId(int opIdx, EventMessagingServicePtr & event)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
OpRequestsIterator it = m_opRequests.find(opIdx);
if ( m_opRequests.end() != it)
{
- LogDebug("set Message ");
+ LoggerD("set Message ");
if (event)
{
- LogDebug("vaild event ");
+ LoggerD("vaild event ");
it->second.event = event;
}
}
int MessagingService::getOpTypeFromOpId(int opIdx)
{
- LogDebug("operation index : " << opIdx);
+ LoggerD("operation index : " << opIdx);
int type = 0;
type = it->second.type;
}
- LogDebug("type " << type);
+ LoggerD("type " << type);
return type;
}
if ( m_opRequests.end() != it)
{
m_opRequests.erase(it); //delete
- LogDebug("delete Request : " << m_opRequests.size());
+ LoggerD("delete Request : " << m_opRequests.size());
}
return opIdx;
}
{
if ( eventType == MESSAGING_SERVICE_EVENT_TYPE_LOAD_MESSAGE_BODY )
{
- LogDebug("Cancel Download Body , handle = " << handle);
+ LoggerD("Cancel Download Body , handle = " << handle);
email->downloadBodyCancel(handle);
}
else if ( eventType == MESSAGING_SERVICE_EVENT_TYPE_LOAD_MESSAGE_ATTACHMENT)
{
- LogDebug("Cancel Download Attachment , handle = " << handle);
+ LoggerD("Cancel Download Attachment , handle = " << handle);
email->downloadAttachmentCancel(handle);
}
}
//for email service
#include <email-types.h>
#include <email-api.h>
+#include <Logger.h>
using namespace std;
using namespace DPL;
m_initialized(false),
messaging_service_handler(-1)
{
- LogDebug("Enter");
+ LoggerD("Enter");
}
MessagingServiceManager::~MessagingServiceManager() {
- LogDebug("Leave");
+ LoggerD("Leave");
}
std::vector<EmailAccountInfo> MessagingServiceManager::getEmailAccounts()
std::stringstream stream;
for (int i = 0; i < count; ++i) {
stream << "[" << accounts[i].account_name << "] " << accounts[i].incoming_server_user_name;
- LogDebug("account ID :" << accounts[i].account_id << "Name :" << accounts[i].incoming_server_user_name << "Addr :" << accounts[i].user_email_address );
+ LoggerD("account ID :" << accounts[i].account_id << "Name :" << accounts[i].incoming_server_user_name << "Addr :" << accounts[i].user_email_address );
EmailAccountInfo account(accounts[i].account_id, stream.str(), accounts[i].user_email_address );
result.push_back(account);
stream.str("");
//public function.
void MessagingServiceManager::getMessagingServiceManager(const EventGetMessagingServicePtr& event) {
- LogDebug("<<<");
+ LoggerD("<<<");
- LogDebug("event->getAccountID():" << event->getAccountID());
+ LoggerD("event->getAccountID():" << event->getAccountID());
if (m_initialized == false) {
initialize();
EventRequestReceiver<EventGetMessagingService>::PostRequest(event);
- LogDebug(">>>");
+ LoggerD(">>>");
}
//get the request which posted from the standard layer
void MessagingServiceManager::OnRequestReceived(const EventGetMessagingServicePtr& event)
{
- LogDebug("<<<");
+ LoggerD("<<<");
try
{
if (m_messagingServices.empty())
{
//ToDo: The Message Service Code will be inserted here.
- LogDebug("Message Service Type : " << event->getMessagingServiceType());
+ LoggerD("Message Service Type : " << event->getMessagingServiceType());
if ( event->getMessagingServiceType() == SMS)
{
MessagingService* messagingService = new MessagingService();
else if (event->getMessagingServiceType() == EMAIL)
{
std::vector<EmailAccountInfo> EmailAccounts = getEmailAccounts();
- LogDebug("get Account list, size:" << EmailAccounts.size());
+ LoggerD("get Account list, size:" << EmailAccounts.size());
int idx = 0;
for ( idx = 0 ; idx < (int)EmailAccounts.size(); idx++)
{
- LogDebug("Account ID:" << EmailAccounts[idx].getIntId() );
+ LoggerD("Account ID:" << EmailAccounts[idx].getIntId() );
MessagingService* messagingService = NULL;
messagingService = new MessagingService();
messagingService->setMessagingServiceType(EMAIL);
messagingService->setCurrentEmailAccount( EmailAccounts[idx] );
- LogDebug("Account ID:" << event->getAccountID());
+ LoggerD("Account ID:" << event->getAccountID());
if ( event->getAccountID() >= 0 )
{
if (event->getAccountID() == EmailAccounts[idx].getIntId())
}
catch (WrtDeviceApis::Commons::Exception &exc)
{
- LogError("Exception has occurred: " << std::hex << exc.getCode());
+ LoggerE("Exception has occurred: " << std::hex << exc.getCode());
event->setExceptionCode(exc.getCode());
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
// create platform's resources. For examples, it could be camera handle, location handle and so on.
void MessagingServiceManager::initialize() {
- LogDebug("<<<");
+ LoggerD("<<<");
if (!m_initialized) {
// retVal = create_messaging_service();
m_initialized = true;
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
#if 0
void MessagingServiceManager::getEmailAccountList( vector<EmailAccountInfo>& accounts )
{
- LogDebug("<<<");
+ LoggerD("<<<");
email_account_t* email_accounts = NULL;
int count = 0;
for (int i = 0; i < count; ++i) {
//make email account info.
- LogDebug("account id :" << email_accounts[i].account_id );
- LogDebug("account name :" << email_accounts[i].user_name );
- LogDebug("account addr :" << email_accounts[i].email_addr );
+ LoggerD("account id :" << email_accounts[i].account_id );
+ LoggerD("account name :" << email_accounts[i].user_name );
+ LoggerD("account addr :" << email_accounts[i].email_addr );
EmailAccountInfo account(email_accounts[i].account_id,
email_accounts[i].incoming_server_user_name,
email_accounts[i].user_email_address);
if (std::find(accounts.begin(), accounts.end(), account) == accounts.end()) {
- LogDebug( "push " << email_accounts[i].account_id << "account" );
+ LoggerD( "push " << email_accounts[i].account_id << "account" );
accounts.push_back(account);
}
}
throw;
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
#endif
#include "Mms.h"
#include <vector>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ReqReceiverMessage.h"
#include "Messaging.h"
#include "CallbackMgr.h"
#include "MsgServiceHandleMgr.h"
+#include <Logger.h>
extern "C" {
#include <msg.h>
// m_bodyFilePath(string(tmpnam(NULL)) + TEXT_FILE_EXTENSION),
m_messageData(NULL)
{
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
char buf[] = "XXXXXX";
mode_t mask = umask(S_IWGRP | S_IWOTH);
int i = mkstemp(buf);
- LogDebug("buf : " << buf << " i : " << i);
+ LoggerD("buf : " << buf << " i : " << i);
umask(mask);
m_bodyFilePath = buf;
m_bodyFilePath = TEXT_DIR_PREFIX+m_bodyFilePath+TEXT_FILE_EXTENSION;
- LogDebug("m_bodyFilePath : " << m_bodyFilePath);
+ LoggerD("m_bodyFilePath : " << m_bodyFilePath);
if (getIdRef().empty()) {
- LogDebug("create new message");
+ LoggerD("create new message");
createNewMessage();
} else {
- LogDebug("read existing message");
+ LoggerD("read existing message");
readExistingMessage();
}
}
// m_bodyFilePath(string(tmpnam(NULL)) + TEXT_FILE_EXTENSION),
m_messageData(msg_data)
{
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
char buf[] = "XXXXXX";
mode_t mask = umask(S_IWGRP | S_IWOTH);
int i = mkstemp(buf);
- LogDebug("buf : " << buf << " i : " << i);
+ LoggerD("buf : " << buf << " i : " << i);
umask(mask);
m_bodyFilePath = buf;
m_bodyFilePath = TEXT_DIR_PREFIX+m_bodyFilePath+TEXT_FILE_EXTENSION;
- LogDebug("m_bodyFilePath : " << m_bodyFilePath);
+ LoggerD("m_bodyFilePath : " << m_bodyFilePath);
readConversationId(m_messageData);
readRecipientList(m_messageData);
Mms::~Mms()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_messageData) {
// release platform message structure
//remove tmp file
//trying to remove file, return value is skipped
if (!m_bodyFilePath.empty()) {
- LogDebug("remove tmp file=" << m_bodyFilePath);
+ LoggerD("remove tmp file=" << m_bodyFilePath);
(void) ::remove(m_bodyFilePath.c_str());
}
}
setMessageStatus(MESSAGE_STATUS_CREATED);
msg_release_struct(&sendOpt);
- LogDebug("Message created successfully, Id: " << getIdRef());
+ LoggerD("Message created successfully, Id: " << getIdRef());
}
void Mms::readExistingMessage()
{
- LogDebug("entered");
+ LoggerD("entered");
if (getIdRef().empty() || (EMPTY_ID == getIdRef()))
{
// trying to get message from platform
if (MSG_SUCCESS != msg_get_message(MsgGetCommonHandle(), convertId(getIdRef()), m_messageData, sendOpt))
{
- LogError("get message error");
+ LoggerE("get message error");
Throw(WrtDeviceApis::Commons::PlatformException);
}
- LogDebug("message found with msgId=" << getIdRef());
+ LoggerD("message found with msgId=" << getIdRef());
// read all mms dat to abstraction layer
readConversationId(m_messageData);
msg_release_struct(&sendOpt);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("exception");
+ LoggerE("exception");
// nothing to do
msg_release_struct(&sendOpt);
}
int tempInt = 0;
msg_get_int_value(messageData, MSG_MESSAGE_DISPLAY_TIME_INT, &tempInt);
- LogError("readDateTime : " <<tempInt);
+ LoggerE("readDateTime : " <<tempInt);
tm* time = localtime((time_t*)&tempInt);
if (!time) {
- LogError("localtime failed");
+ LoggerE("localtime failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
setDateTime(*time);
int tempValue = 0;
msg_get_int_value(messageData, MSG_MESSAGE_FOLDER_ID_INT, &tempValue);
- LogDebug("readMessageStatus folder : " << tempValue);
+ LoggerD("readMessageStatus folder : " << tempValue);
switch (tempValue) {
case MSG_INBOX_ID:
setPriority(MessagePriority::HIGH);
break;
default:
- LogError("Wrong priority type");
+ LoggerE("Wrong priority type");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Wrong priority type");
}
}
{
int tempInt = 0;
msg_get_int_value(messageData, MSG_MESSAGE_THREAD_ID_INT, &tempInt);
- LogDebug("conversationID : " <<tempInt);
+ LoggerD("conversationID : " <<tempInt);
setConvId(tempInt);
}
{
std::string phoneNumber;
// int recipientCount = msg_get_address_count(messageData);
-// LogDebug("Recipient count " << recipientCount);
+// LoggerD("Recipient count " << recipientCount);
- msg_struct_list_s *addr_list;
- msg_get_list_handle(messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
+
+ msg_get_list_handle(messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
int tempInt = 0;
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- int recipientCount = addr_list->nCount;
- LogDebug("Recipient count " << recipientCount);
+ int recipientCount = msg_list_length(addr_list);
+ LoggerD("Recipient count " << recipientCount);
for (int i = 0; i < recipientCount; ++i)
{
// int type = msg_get_direction_info(messageData);
msg_get_int_value(messageData, MSG_MESSAGE_DIRECTION_INT, &tempInt);
int type = tempInt;
- LogDebug("Direction: " << type);
+ LoggerD("Direction: " << type);
if (MSG_DIRECTION_TYPE_MT == type)
{
- msg_struct_t addr_info = addr_list->msg_struct_info[i];
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
memset(strNumber, 0x00, sizeof(MAX_ADDRESS_VAL_LEN));
msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
phoneNumber = strNumber;
setSourceAddress(phoneNumber);
setFrom(phoneNumber);
}
- LogDebug("MT number: " << phoneNumber);
+ LoggerD("MT number: " << phoneNumber);
}
else if (MSG_DIRECTION_TYPE_MO == type)
{
- msg_struct_t addr_info = addr_list->msg_struct_info[i];
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
memset(strNumber, 0x00, sizeof(MAX_ADDRESS_VAL_LEN));
msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
msg_get_int_value(addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, &tempInt);
- LogDebug("MO number: " << strNumber);
- LogDebug("Type : " << tempInt);
+ LoggerD("MO number: " << strNumber);
+ LoggerD("Type : " << tempInt);
switch (tempInt)
{
case MSG_RECIPIENTS_TYPE_TO:
appendBccRecipients(strNumber);
break;
default:
- LogError("Wrong type of recipient");
+ LoggerE("Wrong type of recipient");
}
}
else
{
- LogError("Wrong type of recipient");
+ LoggerE("Wrong type of recipient");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Wrong type of recipient");
}
}
char strTemp[MAX_SUBJECT_LEN] = {0};
msg_get_str_value(messageData, MSG_MESSAGE_SUBJECT_STR, strTemp, MAX_SUBJECT_LEN);
// setSubject(msg_get_subject(messageData));
- LogError("readSubject : " << strTemp);
+ LoggerE("readSubject : " << strTemp);
setSubject(strTemp);
}
if (ret != MSG_SUCCESS)
{
- LogError("cannot get mms struct");
+ LoggerE("cannot get mms struct");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "cannot get mms struct");
}
setMmsType(MULTIPART_MIXED);
}
- LogDebug("page count: " << pageLen);
+ LoggerD("page count: " << pageLen);
for (int p = 0; p < pageLen; ++p)
{
- LogDebug("page " << p);
+ LoggerD("page " << p);
page = (msg_struct_t)msg_list_nth_data(page_list, p);
if (NULL == page) {
- LogError("returned page is null, continue");
+ LoggerE("returned page is null, continue");
continue;
}
for (int m = 0; m < mediaLen; ++m)
{
- LogDebug("media file " << m);
+ LoggerD("media file " << m);
media = (msg_struct_t)msg_list_nth_data(media_list, m);
if (NULL == media)
{
- LogError("returned media is null, continue");
+ LoggerE("returned media is null, continue");
continue;
}
if ((0 == p) && (MMS_SMIL_MEDIA_TEXT == tempInt))
{
//text value on first page goes to body attribute
- LogDebug("setting body from " << szFilePath);
+ LoggerD("setting body from " << szFilePath);
FILE* f = NULL;
f = fopen(szFilePath, "r");
if (!f)
{
- LogError("cannot read file with body" << szFilePath);
+ LoggerE("cannot read file with body" << szFilePath);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Cannot read file with body");
}
fseek(f, 0, SEEK_END);
setBody(data);
delete[] data;
} else {
- LogError("body is not set");
+ LoggerE("body is not set");
}
- LogDebug("message body: '" << getBody() << "'");
+ LoggerD("message body: '" << getBody() << "'");
fclose(f);
}
else
{
- LogDebug("adding attachment " << szFilePath);
+ LoggerD("adding attachment " << szFilePath);
IAttachmentPtr attachment = appendAttachment(szFilePath, false);
//attachment->setMessage(this); //set IMessagePtr
msg_get_str_value(media, MSG_MMS_MEDIA_FILENAME_STR, szFileName, sizeof(szFileName));
if ((szFileName[0] =! '\0' )&& (strnlen(szFileName, MSG_FILENAME_LEN_MAX) > 0))
{
- LogDebug("renaming to " << szFileName);
+ LoggerD("renaming to " << szFileName);
attachment->rename(szFileName);
}
else if (MMS_SMIL_MEDIA_TEXT == tempInt)
{
std::stringstream newName;
newName << "body_page_" << p + 1 << ".txt";
- LogDebug("renaming to " << newName.str());
+ LoggerD("renaming to " << newName.str());
attachment->rename(newName.str());
}
}
attachLen= msg_list_length(attach_list);
- LogDebug("attachment count: " << attachLen);
+ LoggerD("attachment count: " << attachLen);
for (int a = 0; a < attachLen; ++a)
{
attach = (msg_struct_t)msg_list_nth_data(attach_list, a);
if (NULL == attach)
{
- LogError("attachment is null, continue");
+ LoggerE("attachment is null, continue");
continue;
}
IAttachmentPtr att = appendAttachment(szFilePath, false);
if ((szFileName[0] =! '\0') &&
strnlen(szFileName, MSG_FILENAME_LEN_MAX) > 0) {
- LogDebug("renaming to " << szFileName);
+ LoggerD("renaming to " << szFileName);
att->rename(szFileName);
}
}
void Mms::update(bool draftsOnly)
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
return;
}
int priority = -1;
- LogInfo("MMS updating priority");
+ LoggerI("MMS updating priority");
//set priority in platform
switch (getPriority()) {
priority = MSG_MESSAGE_PRIORITY_HIGH;
break;
default:
- LogError("Wrong priority");
+ LoggerE("Wrong priority");
Throw(WrtDeviceApis::Commons::PlatformException);
}
- LogInfo("priority : " << priority);
+ LoggerI("priority : " << priority);
if (MSG_SUCCESS !=
msg_set_int_value(m_messageData, MSG_MESSAGE_PRIORITY_INT, priority)){
- LogError("Error during setting priority");
+ LoggerE("Error during setting priority");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
return;
}
- LogInfo("MMS updating platform recipients");
+ LoggerI("MMS updating platform recipients");
- // reset addresses in platform structure
-// msg_reset_address(m_messageData);
- msg_struct_list_s *addr_list = NULL;
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
int nToCnt = 0;
- nToCnt = addr_list->nCount;
-
- LogInfo("addr_list->nCount" << addr_list->nCount);
-
- if (nToCnt > 0)
- {
- for (int i = 0; i < nToCnt; i++) {
- msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, (char *)"", 0);
- msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_DISPLAYNAME_STR, (char *)"", 0);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_UNKNOWN);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_CONTACT_ID_INT, 0);
- }
- nToCnt = 0;
- addr_list->nCount = nToCnt;
- }
- LogInfo("addr_list->nCount" << addr_list->nCount);
+ msg_list_clear(m_messageData, MSG_MESSAGE_ADDR_LIST_HND);
vector<string> to = getToRecipients().getRecipients();
vector<string> cc = getCcRecipients().getRecipients();
// update addresses in platform structure
if (to.size())
{
- LogInfo("updating to");
+ LoggerI("updating to");
for (size_t i = 0; i < to.size(); i++)
{
+ msg_struct_t tmpAddr;
+
if (i >= MAX_TO_ADDRESS_CNT)
{
- LogError("max number of recipient exceeded");
+ LoggerE("max number of recipient exceeded");
break;
}
- LogDebug("adding to[" << i << "]=" << to[i]);
+ LoggerD("adding to[" << i << "]=" << to[i]);
+
+ msg_list_add_item(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, &tmpAddr);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+ msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
- if (msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
+ if (msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
MSG_RECIPIENTS_TYPE_TO) != MSG_SUCCESS)
{
- LogError("problem with adding to address");
+ LoggerE("problem with adding to address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding to address");
}
- if(msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
+ if(msg_set_str_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
const_cast<char*>(to[i].c_str()), to[i].size()) != MSG_SUCCESS)
{
- LogError("problem with adding to address");
+ LoggerE("problem with adding to address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding to address");
}
nToCnt ++;
}
- addr_list->nCount = nToCnt;
- LogError("nToCnt : " << nToCnt);
- LogError("addr_list->nCount: " <<addr_list->nCount);
-
+ LoggerE("nToCnt : " << nToCnt);
}
- LogInfo("addr_list->nCount" << addr_list->nCount);
if (cc.size())
{
- LogInfo("updating cc");
+ LoggerI("updating cc");
for (size_t i = 0; i < cc.size(); i++)
{
+ msg_struct_t tmpAddr;
+
if (nToCnt >= MAX_TO_ADDRESS_CNT)
{
- LogError("max number of recipient exceeded");
+ LoggerE("max number of recipient exceeded");
break;
}
- LogDebug("adding cc[" << i << "]=" << cc[i]);
+ LoggerD("adding cc[" << i << "]=" << cc[i]);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+ msg_list_add_item(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, &tmpAddr);
- if (msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
+ msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+
+ if (msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
MSG_RECIPIENTS_TYPE_CC) != MSG_SUCCESS)
{
- LogError("problem with adding cc address");
+ LoggerE("problem with adding cc address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding cc address");
}
- if(msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
+ if(msg_set_str_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
const_cast<char*>(cc[i].c_str()), cc[i].size()) != MSG_SUCCESS)
{
- LogError("problem with adding cc address");
+ LoggerE("problem with adding cc address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding cc address");
}
nToCnt ++;
}
- addr_list->nCount = nToCnt;
- LogError("nToCnt : " << nToCnt);
- LogError("addr_list->nCount: " <<addr_list->nCount);
+ LoggerE("nToCnt : " << nToCnt);
}
- LogInfo("addr_list->nCount" << addr_list->nCount);
if (bcc.size())
{
- LogInfo("updating bcc");
+ LoggerI("updating bcc");
for (size_t i = 0; i < bcc.size(); i++)
{
+ msg_struct_t tmpAddr;
+
if (nToCnt >= MAX_TO_ADDRESS_CNT)
{
- LogError("max number of recipient exceeded");
+ LoggerE("max number of recipient exceeded");
break;
}
- LogDebug("adding bcc[" << i << "]=" << bcc[i]);
+ LoggerD("adding bcc[" << i << "]=" << bcc[i]);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+ msg_list_add_item(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, &tmpAddr);
- if (msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
+ msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+
+ if (msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
MSG_RECIPIENTS_TYPE_BCC) != MSG_SUCCESS)
{
- LogError("problem with adding bcc address");
+ LoggerE("problem with adding bcc address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding bcc address");
}
- if(msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
+ if(msg_set_str_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
const_cast<char*>(bcc[i].c_str()), bcc[i].size()) != MSG_SUCCESS)
{
- LogError("problem with adding bcc address");
+ LoggerE("problem with adding bcc address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding bcc address");
}
nToCnt ++;
}
- addr_list->nCount = nToCnt;
- LogError("nToCnt : " << nToCnt);
- LogError("addr_list->nCount: " <<addr_list->nCount);
+ LoggerE("nToCnt : " << nToCnt);
}
- LogInfo("addr_list->nCount" << addr_list->nCount);
setToValidity(true);
setCcValidity(true);
setBccValidity(true);
if (isSubjectValid()) {
return;
}
- LogInfo("updating platform subject: " << getSubjectRef());
+ LoggerI("updating platform subject: " << getSubjectRef());
if (MSG_SUCCESS !=
// msg_set_subject(m_messageData, getSubjectRef().c_str())) {
msg_set_str_value(m_messageData, MSG_MESSAGE_SUBJECT_STR, const_cast<char*>(getSubjectRef().c_str()), MAX_SUBJECT_LEN)) {
- LogError("problem with setting subject");
+ LoggerE("problem with setting subject");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with setting subject");
}
setSubjectValidity(true);
// msg_struct_t old_mms_struct = NULL;// THIS
// int ret;// THIS
- LogInfo("updating platform body and attachment");
+ LoggerI("updating platform body and attachment");
Try
{
msg_struct_t smil_text[1];
if (getMessageType() != MMS) {
- LogError("Wrong msg type");
+ LoggerE("Wrong msg type");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Wrong msg type");
}
// mmsData = msg_mms_create_message();
// old_mms_struct = msg_create_struct(MSG_STRUCT_MMS);// THIS
// ret = msg_get_mms_struct(m_messageData, old_mms_struct);// THIS
-// LogError("ret " << ret);// THIS
+// LoggerE("ret " << ret);// THIS
// ret = msg_release_struct(&old_mms_struct);// THIS
-// LogError("ret " << ret);// THIS
+// LoggerE("ret " << ret);// THIS
if (!mms_struct) {
- LogError("create message body failed");
+ LoggerE("create message body failed");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "create message body failed");
}
FILE* f = NULL;
f = fopen(m_bodyFilePath.c_str(), "w");
if (!f) {
- LogError("cannot create file with body" << m_bodyFilePath);
+ LoggerE("cannot create file with body" << m_bodyFilePath);
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"cannot create file with body");
}
- LogDebug("body file: " << m_bodyFilePath);
+ LoggerD("body file: " << m_bodyFilePath);
fwrite(getBodyRef().c_str(), strlen(getBodyRef().c_str()), 1, f);
fclose(f);
- LogDebug("getBodyRef(): " << getBodyRef());
+ LoggerD("getBodyRef(): " << getBodyRef());
msg_set_int_value(mms_struct, MSG_MMS_ROOTLAYOUT_WIDTH_INT, ROOT_LAYOUT_WIDTH);
msg_set_int_value(mms_struct, MSG_MMS_ROOTLAYOUT_HEIGHT_INT, ROOT_LAYOUT_HEIGHT);
msg_set_bool_value(mms_struct, MSG_MMS_ROOTLAYOUT_WIDTH_PERCENT_BOOL, true);
msg_set_bool_value(mms_struct, MSG_MMS_ROOTLAYOUT_HEIGHT_PERCENT_BOOL, true);
- msg_mms_add_item(mms_struct, MSG_STRUCT_MMS_REGION, ®ion[0]);
+ msg_list_add_item(mms_struct, MSG_STRUCT_MMS_REGION, ®ion[0]);
msg_set_str_value(region[0], MSG_MMS_REGION_ID_STR, const_cast<char*>(TEXT_AREA), 4);
msg_set_int_value(region[0], MSG_MMS_REGION_LENGTH_LEFT_INT, 0);
msg_set_int_value(region[0], MSG_MMS_REGION_LENGTH_TOP_INT, 0);
msg_set_bool_value(region[0], MSG_MMS_REGION_LENGTH_WIDTH_PERCENT_BOOL, true);
msg_set_bool_value(region[0], MSG_MMS_REGION_LENGTH_HEIGHT_PERCENT_BOOL, true);
- msg_mms_add_item(mms_struct, MSG_STRUCT_MMS_PAGE, &page[0]);
+ msg_list_add_item(mms_struct, MSG_STRUCT_MMS_PAGE, &page[0]);
msg_set_int_value(page[0], MSG_MMS_PAGE_PAGE_DURATION_INT, 0);
- msg_mms_add_item(page[0], MSG_STRUCT_MMS_MEDIA, &media[0]);
+ msg_list_add_item(page[0], MSG_STRUCT_MMS_MEDIA, &media[0]);
msg_set_int_value(media[0], MSG_MMS_MEDIA_TYPE_INT, MMS_SMIL_MEDIA_TEXT);
msg_set_str_value(media[0], MSG_MMS_MEDIA_REGION_ID_STR, const_cast<char*>(TEXT_AREA), 4);
int error;
error = msg_set_str_value(media[0], MSG_MMS_MEDIA_FILEPATH_STR, const_cast<char*>(m_bodyFilePath.c_str()),MSG_FILEPATH_LEN_MAX);
- LogDebug("bodyFile Path= " << m_bodyFilePath);
- LogDebug("error= " << error);
+ LoggerD("bodyFile Path= " << m_bodyFilePath);
+ LoggerD("error= " << error);
char szFilePath[MSG_FILEPATH_LEN_MAX] = {0,};
memset(szFilePath, 0, sizeof(szFilePath));
msg_get_str_value(media[0], MSG_MMS_MEDIA_FILEPATH_STR, szFilePath, sizeof(szFilePath));
- LogDebug("bodyFile Path= " << m_bodyFilePath);
+ LoggerD("bodyFile Path= " << m_bodyFilePath);
msg_get_struct_handle(media[0], MSG_MMS_MEDIA_SMIL_TEXT_HND, &smil_text[0]);
msg_set_int_value(smil_text[0], MSG_MMS_SMIL_TEXT_COLOR_INT, BLACK_COLOR);
continue;
}
- LogDebug("Add attachment=" << att->getFullPath());
+ LoggerD("Add attachment=" << att->getFullPath());
//checking file
errnum = stat(att->getFullPath().c_str(), &buffer);
- LogDebug("errnum=" << errnum);
+ LoggerD("errnum=" << errnum);
if (errnum != 0) {
- LogError("Opening file: " << att->getFullPath().c_str());
+ LoggerE("Opening file: " << att->getFullPath().c_str());
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"cannot open attachment file");
}
//this function should return valid pointer
- msg_mms_add_item(mms_struct, MSG_STRUCT_MMS_ATTACH, &attachment[i]);
+ msg_list_add_item(mms_struct, MSG_STRUCT_MMS_ATTACH, &attachment[i]);
msg_set_str_value(attachment[i], MSG_MMS_ATTACH_FILEPATH_STR, const_cast<char*>(att->getFullPath().c_str()), MSG_FILEPATH_LEN_MAX);
- LogDebug("Attachment added");
+ LoggerD("Attachment added");
//reset errno
errnum = 0;
if (MSG_SUCCESS !=msg_set_mms_struct(m_messageData, mms_struct))
{
- LogError("set message body error");
+ LoggerE("set message body error");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "set message body error");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("Platform error");
+ LoggerE("Platform error");
msg_release_struct(&mms_struct);
throw;
}
return;
}
- LogInfo("updating platform read status: " << isRead());
+ LoggerI("updating platform read status: " << isRead());
// if (MSG_SUCCESS != msg_set_read_status(m_messageData, isRead())) {
if (MSG_SUCCESS != msg_set_bool_value(m_messageData, MSG_MESSAGE_READ_BOOL, isRead())) {
- LogError("problem with setting subject");
+ LoggerE("problem with setting subject");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with setting subject");
}
void Mms::updateIsRead()
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
Try
{
if (this->getIdRef().empty()) {
- LogError("existing msgId is zero, remove msg not done");
+ LoggerE("existing msgId is zero, remove msg not done");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"existing msgId is zero, remove msg not done");
}
if (MSG_SUCCESS !=
msg_update_read_status(MsgGetCommonHandle(), convertId(getIdRef()), isReadChangeStatus()))
{
- LogError("Failed to update isRead");
+ LoggerE("Failed to update isRead");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update isRead");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error occurs");
+ LoggerE("platform error occurs");
}
setisReadChangeStatusValidity(true);
void Mms::updateMessage()
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
msg_error_t err = MSG_SUCCESS;
msg_struct_t msg = NULL;
msg_struct_t sendOpt = NULL;
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (err != MSG_SUCCESS)
{
- LogError("Get Message Failed!");
+ LoggerE("Get Message Failed!");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update message");
}
if (this->getIdRef().empty()) {
- LogError("existing msgId is zero, update msg not done");
+ LoggerE("existing msgId is zero, update msg not done");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"existing msgId is zero, update msg not done");
}
if (MSG_SUCCESS != msg_update_message(MsgGetCommonHandle(), m_messageData, sendOpt))
{
- LogError("Failed to update message");
+ LoggerE("Failed to update message");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update message");
}
msg_release_struct(&msg);
Catch(WrtDeviceApis::Commons::PlatformException) {
msg_release_struct(&msg);
msg_release_struct(&sendOpt);
- LogError("platform error occurs");
+ LoggerE("platform error occurs");
}
}
void Mms::createSendMessage()
{
- LogDebug("convert m_id= " << convertId(getIdRef()));
+ LoggerD("convert m_id= " << convertId(getIdRef()));
//prepare for add sms to draft folder
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
//update all sms data
if (getCurrentFolder() == DRAFTBOX) {
- LogDebug("update all mms data");
+ LoggerD("update all mms data");
updateSubject();
updateBodyAndAttachments();
updateRecipientList();
setMessageStatus(MESSAGE_STATUS_DRAFT);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (m_messageData) {
//releasing platform message structure
// msg_release_message(&m_messageData);
void Mms::addMessageToDraft()
{
- LogDebug("convert m_id= " << convertId(getIdRef()));
+ LoggerD("convert m_id= " << convertId(getIdRef()));
msg_struct_t sendOpt = NULL;
//prepare for add sms to draft folder
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
// trying to add message
- LogDebug("add message");
+ LoggerD("add message");
int ret = msg_add_message(MsgGetCommonHandle(), m_messageData, sendOpt);
if (ret < MSG_SUCCESS) {
- LogError("msg_add_message failed, error code=" << ret);
+ LoggerE("msg_add_message failed, error code=" << ret);
Throw(WrtDeviceApis::Commons::PlatformException);
}
else
msgId = ret;
}
- LogDebug("Message ID : " << msgId);
+ LoggerD("Message ID : " << msgId);
if (msgId < 0)
{
- LogDebug("Message ID is invailded ");
+ LoggerD("Message ID is invailded ");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("add draft message error");
+ LoggerE("add draft message error");
msg_release_struct(&sendOpt);
throw;
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
throw;
}
*/
if (msg_move_msg_to_folder(MsgGetCommonHandle(), convertId(getId()),
platfromFolderId) != MSG_SUCCESS) {
- LogError("msg_move_msg_to_folder error");
+ LoggerE("msg_move_msg_to_folder error");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "msg_move_msg_to_folder error");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
throw;
}
*/
int error = msg_add_message(MsgGetCommonHandle(), msg, &option);
if (error != MSG_SUCCESS) {
- LogError("msg_add_message failed, error code=" << error);
+ LoggerE("msg_add_message failed, error code=" << error);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "msg_add_message failed");
}
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (msg) {
msg_release_message(&msg);
}
int error = msg_add_message(MsgGetCommonHandle(), msg, &option);
if (error != MSG_SUCCESS) {
- LogError("msg_add_message failed, error code=" << error);
+ LoggerE("msg_add_message failed, error code=" << error);
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "msg_add_message failed");
}
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (msg) {
msg_release_message(&msg);
}
void Mms::remove()
{
- LogDebug("delete m_id=" << getIdRef());
+ LoggerD("delete m_id=" << getIdRef());
Try
{
if (this->getIdRef().empty()) {
- LogError("existing msgId is zero, remove msg not done");
+ LoggerE("existing msgId is zero, remove msg not done");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"existing msgId is zero, remove msg not done");
}
if (MSG_SUCCESS !=
msg_delete_message(MsgGetCommonHandle(),
convertId(getIdRef()))) {
- LogError("Failed to delete Message");
+ LoggerE("Failed to delete Message");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to delete Message");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error occurs");
+ LoggerE("platform error occurs");
}
}
int Mms::send()
{
- LogDebug("sending message, id=" << getIdRef());
+ LoggerD("sending message, id=" << getIdRef());
Try
{
//prepare for sending sms/mms
update();
- LogDebug("Start Sending Message...");
+ LoggerD("Start Sending Message...");
- LogDebug("trying to send mms");
+ LoggerD("trying to send mms");
msg_error_t err = CallbackMgrSingleton::Instance().registerAndSend(msg_mms_send_message, m_messageData, this);
if (err != MSG_SUCCESS)
{
- LogError("Sending Message (submit request) failed!!! err=" << err);
+ LoggerE("Sending Message (submit request) failed!!! err=" << err);
setMessageStatus(MESSAGE_STATUS_FAILED);
goto ERROR;
}
setMessageStatus(MESSAGE_STATUS_SENDING);
- LogDebug("Sending Message request is submitted!");
+ LoggerD("Sending Message request is submitted!");
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("message is not send, manually run callback");
+ LoggerE("message is not send, manually run callback");
goto ERROR;
}
ERROR:
ReqReceiverMessage *requestReceiver = getRequestReceiver();
if (requestReceiver) {
- LogError("send Error");
+ LoggerE("send Error");
EventMessagingServicePtr event = getMessagingServiceEvent();
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService>::ManualAnswer(event);
void Mms::sendingCallback(msg_struct_t sent_status)
{
-// LogInfo("sendingCallback callback received. Req id = " <<
+// LoggerI("sendingCallback callback received. Req id = " <<
// sent_status->reqId << " Status = " << (int)sent_status->status);
// msg_struct_t request_data = NULL;
// msg_get_struct_handle(sent_status, MSG_STRUCT_REQUEST_INFO, (void **)request_data);
int status = MSG_NETWORK_SEND_FAIL;
msg_get_int_value(sent_status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &status);
- LogDebug("status : " << status);
+ LoggerD("status : " << status);
if (MSG_NETWORK_SEND_SUCCESS == status) {
- LogDebug("sending ok");
+ LoggerD("sending ok");
setSendingStatusOk();
setMessageStatus(MESSAGE_STATUS_SENT);
} else {
- LogError("sending failed: " << static_cast<unsigned int>(status));
+ LoggerE("sending failed: " << static_cast<unsigned int>(status));
setSendingStatusFailed();
setMessageStatus(MESSAGE_STATUS_FAILED);
}
void Mms::sendCancel(int handle)
{
- LogDebug("sending message, id=" << getIdRef());
+ LoggerD("sending message, id=" << getIdRef());
//#warning "TODO"
- LogDebug("handle =" << handle);
+ LoggerD("handle =" << handle);
}
void Mms::setSendingStatusOk()
{
//success callback should be executed here
ReqReceiverMessage *requestReceiver = getRequestReceiver();
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
+
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
int nToCnt;
if (requestReceiver) {
- LogInfo("calling JS success callback");
+ LoggerI("calling JS success callback");
EventMessagingServicePtr event = getMessagingServiceEvent();
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::None);
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
- nToCnt = addr_list->nCount;
+ nToCnt = msg_list_length(addr_list);
for ( int index=0; index < nToCnt; index++)
{
- msg_get_str_value(addr_list->msg_struct_info[0], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
event->m_successRecipients.push_back(strNumber);
}
{
//error callback should be executed here
EventOnSendingFailedEmitterPtr emitter = getEmitter();
- msg_struct_list_s *addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
+
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
int nToCnt;
EventMessagingServicePtr event = getMessagingServiceEvent();
if (requestReceiver)
{
- LogError("calling JS error callback");
+ LoggerE("calling JS error callback");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- nToCnt = addr_list->nCount;
- LogDebug("nToCnt : " << nToCnt);
+ msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+ nToCnt = msg_list_length(addr_list);
+
+ LoggerD("nToCnt : " << nToCnt);
for ( int index=0; index < nToCnt; index++)
{
- msg_get_str_value(addr_list->msg_struct_info[index], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, index);
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
event->m_failRecipients.push_back(strNumber);
}
#define MSGSERVICEHANDLEMGR_H
#include <dpl/singleton.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/thread.h>
#include <Commons/Exception.h>
+#include <Logger.h>
extern "C" {
#include <msg.h>
public:
MsgServiceHandleMgr() : m_msgHandle(NULL)
{
- LogInfo("enter");
+ LoggerI("enter");
// open one handle per all messaging
if (MSG_SUCCESS != msg_open_msg_handle(&m_msgHandle)) {
- LogError("Unable to open handle");
+ LoggerE("Unable to open handle");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
public:
~MsgServiceHandleMgr()
{
- LogInfo("enter");
+ LoggerI("enter");
if (!!m_msgHandle) {
msg_close_msg_handle(&m_msgHandle);
}
msg_handle_t getHandle() const
{
if (!m_msgHandle) {
- LogError("Messaging handle not initialized");
+ LoggerE("Messaging handle not initialized");
Throw(WrtDeviceApis::Commons::PlatformException);
}
return m_msgHandle;
#include <algorithm>
#include <sstream>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "Recipient.h"
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::Commons;
sort(l_toDelete.begin(), l_toDelete.end());
if (!includes(l_recipients.begin(), l_recipients.end(), l_toDelete.begin(),
l_toDelete.end())) {
- LogError("lack of recipient to delete from main variable");
+ LoggerE("lack of recipient to delete from main variable");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
//delete recipients
#include <email-types.h>
#include <email-api.h>
#include <dpl/singleton_safe_impl.h>
+#include <Logger.h>
IMPLEMENT_SAFE_SINGLETON(DeviceAPI::Messaging::ReqReceiverMessage)
EventQueryFoldersReqReceiver(ThreadEnum::MESSAGING_THREAD),
EventMessagingServiceReqReceiver(ThreadEnum::MESSAGING_THREAD)
{
- LogDebug("create receiver for messaging");
+ LoggerD("create receiver for messaging");
}
ReqReceiverMessage::~ReqReceiverMessage()
void ReqReceiverMessage::addDraftMessage(const EventAddDraftMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventAddDraftMessageReqReceiver::PostRequest(event);
}
/*
void ReqReceiverMessage::sendMessage(const EventSendMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventSendMessageReqReceiver::PostRequest(event);
}
*/
void ReqReceiverMessage::sendMessage(const EventMessagingServicePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventMessagingServiceReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::updateMessage(const EventUpdateMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventUpdateMessageReqReceiver::PostRequest(event);
}
/*
void ReqReceiverMessage::deleteMessage(const EventDeleteMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventDeleteMessageReqReceiver::PostRequest(event);
}
*/
void ReqReceiverMessage::deleteMessages(const EventDeleteMessagesPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventDeleteMessagesReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::updateMessages(const EventUpdateMessagesPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventUpdateMessagesReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::queryMessages(const EventQueryMessagesPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventQueryMessagesReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::getConversationId(const EventGetConversationIdPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventGetConversationIdReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::queryConversations(const EventQueryConversationsPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventQueryConversationsReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::deleteConversations(const EventDeleteConversationsPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventDeleteConversationsReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::queryFolders(const EventQueryFoldersPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventQueryFoldersReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::loadMessageBody(const EventMessagingServicePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventMessagingServiceReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::loadMessageAttachment(const EventMessagingServicePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventMessagingServiceReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::sync(const EventMessagingServicePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventMessagingServiceReqReceiver::PostRequest(event);
}
void ReqReceiverMessage::syncFolder(const EventMessagingServicePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
if (event && event->m_messagingService && event->m_messagingService->getAccountID() > 0)
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Couldn't get accounts");
}
- LogDebug("accounts[0].incoming_server_type = " << accounts[0].incoming_server_type);
- LogDebug("m_folder_name = " << event->m_folder_name);
+ LoggerD("accounts[0].incoming_server_type = " << accounts[0].incoming_server_type);
+ LoggerD("m_folder_name = " << event->m_folder_name);
if ( accounts[0].incoming_server_type == EMAIL_SERVER_TYPE_POP3 && event->m_folder_name != "INBOX" )
{
- LogDebug("Can't Sync Folder because POP3 spec.");
+ LoggerD("Can't Sync Folder because POP3 spec.");
ThrowMsg(WrtDeviceApis::Commons::UnsupportedException, "Operation Type is mismatched");
}
}
bool ReqReceiverMessage::validateFilter(const DeviceAPI::Tizen::FilterPtr& filter){
- LogDebug("<<<");
+ LoggerD("<<<");
bool retBool = false;
FilterValidatorPtr filterValidator = DPL::StaticPointerCast<FilterValidator>(validator);
retBool = filter->validate(filterValidator);
- LogDebug("retBool:" << retBool);
+ LoggerD("retBool:" << retBool);
if(retBool == false){
- MsgLogError(">>> Validate FAIL InvalidArgumentException");
+ MsgLoggerE(">>> Validate FAIL InvalidArgumentException");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}else{
- LogDebug("filter is NULL");
+ LoggerD("filter is NULL");
retBool = false;
}
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
void ReqReceiverMessage::OnRequestReceived(const EventAddDraftMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
IMessagePtr msg = event->msg;
if(event->getType() != msg->getMessageType())
{
- LogDebug("msg type and serviceType is not match");
- LogDebug("service type : "<< event->getType());
- LogDebug("msg type : "<< msg->getMessageType());
+ LoggerD("msg type and serviceType is not match");
+ LoggerD("service type : "<< event->getType());
+ LoggerD("msg type : "<< msg->getMessageType());
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
if (!event->checkCancelled())
if (accounts != NULL) {
email_free_account(&accounts, count);
}
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException){
- MsgLogError("InvalidArgumentException");
+ MsgLoggerE("InvalidArgumentException");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventUpdateMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
IMessagePtr msg = event->msg;
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
/*
void ReqReceiverMessage::OnRequestReceived(const EventDeleteMessagePtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
IMessagePtr msg = event->msg;
msg->remove();
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventDeleteMessagesPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
/*
}
*/
std::vector<IMessagePtr> msg = event->msgArray;
- LogDebug("msg.size()" << msg.size());
+ LoggerD("msg.size()" << msg.size());
int vecSize = msg.size();
for(int i=0; i < vecSize; i++){
int type = msg[i]->getMessageType();
std::string id = msg[i]->getId();
- MsgLogError("type :"<<type);
- MsgLogError("id :"<<id);
- MsgLogError("body" << msg[i]->getBody());
+ MsgLoggerE("type :"<<type);
+ MsgLoggerE("id :"<<id);
+ MsgLoggerE("body" << msg[i]->getBody());
msg[i]->remove();
}//for
}Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventUpdateMessagesPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
std::vector<IMessagePtr> msg = event->msgArray;
- LogDebug("msg.size()" << msg.size());
+ LoggerD("msg.size()" << msg.size());
int vecSize = msg.size();
for(int i=0; i < vecSize; i++)
{
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventQueryMessagesPtr& event)
{
- LogDebug("<<<");
+ LoggerD("<<<");
Try {
DeviceAPI::Tizen::FilterPtr filter = event->getFilter();
bool isValidFilter = validateFilter(filter);
if(isValidFilter == false){
- MsgLogError("[ERROR]this filter is invalid");
+ MsgLoggerE("[ERROR]this filter is invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
// using filter
- LogDebug("event->getType() = " << event->getType());
+ LoggerD("event->getType() = " << event->getType());
if(event->getType() > UNKNOWN)
{
tmp = IMessaging::getInstance().findMessages(event->getFilter(), event->getSortMode(), event->getLimit(), event->getOffset(), event->getType());
event->msgs = msgs;
}Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}Catch(WrtDeviceApis::Commons::InvalidArgumentException){
- MsgLogError("InvalidArgumentException");
+ MsgLoggerE("InvalidArgumentException");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
Catch (exception) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventGetConversationIdPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try {
IMessagePtr msg = event->getConversationMsgPtr();
}
int conversationId = IMessaging::getInstance().getConversationId(msgId, msgType);
- LogDebug("Cond Id:" << conversationId);
+ LoggerD("Cond Id:" << conversationId);
event->setConversationId(conversationId);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventQueryConversationsPtr& event)
{
- LogDebug("<<<");
+ LoggerD("<<<");
Try
{
FilterValidatorPtr filterValidator = DPL::StaticPointerCast<FilterValidator>(validator);
bool isValidFilter = filter->validate(filterValidator);
if(isValidFilter == false){
- MsgLogError("[ERROR]Filter is Invalid");
+ MsgLoggerE("[ERROR]Filter is Invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
- LogDebug("event->getType() = "<<event->getType());
+ LoggerD("event->getType() = "<<event->getType());
if(event->getType() > UNKNOWN)
{
tmp = IMessaging::getInstance().queryConversations(event->getFilter(), event->getSortMode(), event->getType(), event->getLimit(), event->getOffset());
}
else
{
-// LogDebug("enter");
+// LoggerD("enter");
// tmp = IMessaging::getInstance().queryConversations(event->getSortMode(), event->getFilter(), event->getLimit(), event->getOffset());
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException)
{
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- MsgLogError("InvalidArgumentException");
+ MsgLoggerE("InvalidArgumentException");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventMessagingServicePtr& event)
{
- LogDebug("enter : EventMessagingServicePtr");
+ LoggerD("enter : EventMessagingServicePtr");
Try {
- LogDebug("event type :" << event->getEventType() );
+ LoggerD("event type :" << event->getEventType() );
int MessagingServiceEventType = event->getEventType();
if (MessagingServiceEventType == MESSAGING_SERVICE_EVENT_TYPE_LOAD_MESSAGE_BODY)
msg->setMessagingServiceEvent(event);
int type = msg->getMessageType();
- LogDebug("message type :" << type);
+ LoggerD("message type :" << type);
if ( msg->getMessageType() == EMAIL )
{
IEmailPtr email = MessageFactory::convertToEmail(msg);
event->switchToManualAnswer(); //switch to manual answer;
int handle = email->downloadBody();
- LogDebug("Load Message Body handle : " << handle);
+ LoggerD("Load Message Body handle : " << handle);
if (event->opId && event->m_messagingService)
{
event->m_messagingService->setHandleToOpId(event->opId, handle);
}
}
else {
- LogDebug(" invaild message. ");
+ LoggerD(" invaild message. ");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
}
else
{
- LogDebug(" Cancel ");
+ LoggerD(" Cancel ");
event->setCancelAllowed(true);
}
}
msg->setMessagingServiceEvent(event);
int type = msg->getMessageType();
- LogDebug("message type :" << type);
+ LoggerD("message type :" << type);
if ( msg->getMessageType() == EMAIL )
{
IEmailPtr email = MessageFactory::convertToEmail(msg);
event->switchToManualAnswer(); //switch to manual answer;
int handle = email->downloadAttachment(event->m_attachment);
- LogDebug("Load Message Attachment handle : " << handle);
+ LoggerD("Load Message Attachment handle : " << handle);
if (event->opId && event->m_messagingService)
{
event->m_messagingService->setHandleToOpId(event->opId, handle);
}
else
{
- LogDebug(" invaild message. ");
+ LoggerD(" invaild message. ");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
}
}
else
{
- LogDebug(" cancel. ");
+ LoggerD(" cancel. ");
event->setCancelAllowed(true);
}
{
if (!event->checkCancelled()) {
int type = event->m_messagingService->getType();
- LogDebug("messaging service type :" << type);
+ LoggerD("messaging service type :" << type);
event->m_messagingService->setRequestReceiver(this);
event->m_messagingService->setMessagingServiceEvent(event); //
if (type == EMAIL)
{
event->switchToManualAnswer(); //switch to manual answer;
- LogDebug("privateData->getAccountId() :" << event->m_messagingService->getAccountID());
+ LoggerD("privateData->getAccountId() :" << event->m_messagingService->getAccountID());
if ( event->m_messagingService->getAccountID() > 0)
{
int handle = event->m_messagingService->sync( event->m_messagingService, event->m_sync_limit );
- LogDebug("Sync handle : " << handle);
+ LoggerD("Sync handle : " << handle);
if (event->opId && event->m_messagingService)
{
event->m_messagingService->setHandleToOpId(event->opId, handle);
}
else
{
- LogDebug(" cancel. ");
+ LoggerD(" cancel. ");
event->setCancelAllowed(true);
}
}
{
if (!event->checkCancelled()) {
int type = event->m_messagingService->getType();
- LogDebug("messaging service type :" << type);
+ LoggerD("messaging service type :" << type);
event->m_messagingService->setRequestReceiver(this);
event->m_messagingService->setMessagingServiceEvent(event);
if (type == EMAIL)
{
event->switchToManualAnswer(); //switch to manual answer;
- LogDebug("privateData->getAccountId() :" << event->m_messagingService->getAccountID());
+ LoggerD("privateData->getAccountId() :" << event->m_messagingService->getAccountID());
if ( event->m_messagingService->getAccountID() > 0)
{
int handle = event->m_messagingService->syncFolder( event->m_messagingService, event->m_sync_folder_id, event->m_sync_limit);
- LogDebug("Sync Folder handle : " << handle);
+ LoggerD("Sync Folder handle : " << handle);
if (event->opId && event->m_messagingService)
{
event->m_messagingService->setHandleToOpId(event->opId, handle);
}
else
{
- LogDebug(" cancel. ");
+ LoggerD(" cancel. ");
event->setCancelAllowed(true);
}
}
}
msg->createSendMessage();
- LogDebug("Message Status = " << msg->getMessageStatus());
- LogDebug("Message ID = " << msg->getId());
+ LoggerD("Message Status = " << msg->getMessageStatus());
+ LoggerD("Message ID = " << msg->getId());
}
event->switchToManualAnswer();
int handle = msg->send();
- LogDebug("handle : " << handle);
+ LoggerD("handle : " << handle);
if (event->opId && event->m_messagingService)
{
event->m_messagingService->setHandleToOpId(event->opId, handle);
}
else
{
- LogDebug(" Cancel ");
+ LoggerD(" Cancel ");
event->setCancelAllowed(true);
}
}
Catch (WrtDeviceApis::Commons::PlatformException) {
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
Catch (WrtDeviceApis::Commons::ConversionException) {
- MsgLogError("conversion exception");
+ MsgLoggerE("conversion exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::ConversionException);
}
void ReqReceiverMessage::OnRequestReceived(const EventDeleteConversationsPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{/*
if (event->isFilterUsing())
{
- LogDebug("filter use");
+ LoggerD("filter use");
//check filter validation
FilterPtr filter = event->getFilter();
}
else*/
{
- LogDebug("no filter");
+ LoggerD("no filter");
if (IMessaging::getInstance().deleteConversations(event->getConversations()) == false)
{
}
Catch(WrtDeviceApis::Commons::PlatformException)
{
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- MsgLogError("InvalidArgumentException");
+ MsgLoggerE("InvalidArgumentException");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
}
void ReqReceiverMessage::OnRequestReceived(const EventQueryFoldersPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
Try
{
bool isValidFilter = filter->validate(filterValidator);
if(isValidFilter == false){
- MsgLogError("[ERROR]Filter is Invalid");
+ MsgLoggerE("[ERROR]Filter is Invalid");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException)
{
- MsgLogError("platform exception");
+ MsgLoggerE("platform exception");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException)
{
- MsgLogError("InvalidArgumentException");
+ MsgLoggerE("InvalidArgumentException");
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::InvalidArgumentException);
}
#ifndef TIZEN_MESSAGING_SCOPEDMAIL_H_
#define TIZEN_MESSAGING_SCOPEDMAIL_H_
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <email-types.h>
#include <email-api-mail.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
static Type NullValue()
{
- LogDebug("NullValue");
+ LoggerD("NullValue");
return NULL;
}
static void Destroy(Type mail)
{
- LogDebug("Destroy");
+ LoggerD("Destroy");
if (NullValue() != mail) {
- LogDebug("email_free_mail_data");
+ LoggerD("email_free_mail_data");
int error = email_free_mail_data(&mail, 1);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mail: " << error);
+ LoggerE("Failed to destroy mail: " << error);
}
}
}
#ifndef TIZEN_MESSAGING_SCOPEDMAILATTACHMENT_H_
#define TIZEN_MESSAGING_SCOPEDMAILATTACHMENT_H_
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <email-types.h>
#include <email-api-mail.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
static Type NullValue()
{
- LogDebug("NullValue");
+ LoggerD("NullValue");
return NULL;
}
static void Destroy(Type attachment)
{
- LogDebug("Destroy");
+ LoggerD("Destroy");
if (NullValue() != attachment) {
- LogDebug("email_free_attachment_info");
+ LoggerD("email_free_attachment_info");
int error = email_free_attachment_info(&attachment);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mail Attachment: " << error);
+ LoggerE("Failed to destroy mail Attachment: " << error);
}
}
}
#ifndef TIZEN_MESSAGING_SCOPEDMAILBOX_H_
#define TIZEN_MESSAGING_SCOPEDMAILBOX_H_
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <email-types.h>
#include <email-api-mail.h>
#include <email-api-mailbox.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Messaging {
static Type NullValue()
{
- LogDebug("NullValue");
+ LoggerD("NullValue");
return NULL;
}
static void Destroy(Type mailbox)
{
- LogDebug("Destroy");
+ LoggerD("Destroy");
if (NullValue() != mailbox) {
- LogDebug("email_free_mailbox");
+ LoggerD("email_free_mailbox");
int error = email_free_mailbox(&mailbox, 1);
if (EMAIL_ERROR_NONE != error) {
- LogError("Failed to destroy mailbox: " << error);
+ LoggerE("Failed to destroy mailbox: " << error);
}
}
}
//
#include "Sms.h"
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "ReqReceiverMessage.h"
#include "Messaging.h"
#include "CallbackMgr.h"
#include "MsgServiceHandleMgr.h"
+#include <Logger.h>
extern "C" {
#include <msg_storage.h>
IMessage(SMS, id),
m_messageData(NULL)
{
- LogDebug("enter");
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("enter");
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
if (getIdRef().empty()) {
createNewMessage();
IMessage(SMS, id),
m_messageData(NULL)
{
- LogDebug("enter");
- LogDebug("m_id=" << getIdRef());
- LogDebug("m_msgType=" << getMessageType());
+ LoggerD("enter");
+ LoggerD("m_id=" << getIdRef());
+ LoggerD("m_msgType=" << getMessageType());
- LogDebug("created msg_data : " << msg_data);
+ LoggerD("created msg_data : " << msg_data);
m_messageData = createNewCopyOfPLatformMsgWithAddressList(msg_data);
- LogDebug("created m_messageData : " << m_messageData);
+ LoggerD("created m_messageData : " << m_messageData);
readConversationId(m_messageData);
readRecipientList(m_messageData);
Sms::~Sms()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_messageData) {
// release platform message structure
- LogDebug("release m_messageData : " << m_messageData);
+ LoggerD("release m_messageData : " << m_messageData);
msg_release_struct(&m_messageData);
}
}
void Sms::update(bool draftsOnly)
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
throw;
}
*/
// trying to add message
int error = msg_add_message(MsgGetCommonHandle(), msg, &option);
if (error != MSG_SUCCESS) {
- LogError("msg_add_message failed, error code=" << error);
+ LoggerE("msg_add_message failed, error code=" << error);
Throw(WrtDeviceApis::Commons::PlatformException);
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (msg) {
//releasing platform message structure
msg_release_message(&msg);
int Sms::send()
{
- LogDebug("sending message, id=" << getIdRef());
+ LoggerD("sending message, id=" << getIdRef());
Try{
if(m_messageData == NULL)
{
}
Catch(WrtDeviceApis::Commons::PlatformException)
{
- LogDebug("getHandle failed");
+ LoggerD("getHandle failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
// split the message
SendRequest req;
- msg_struct_list_s *addr_list = NULL;
- msg_struct_list_s *new_addr_list = NULL;
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
+
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
int nToCnt;
int tempInt;
int tempIdInt;
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
msg_get_int_value(m_messageData, MSG_MESSAGE_ID_INT, &tempIdInt);
- nToCnt = addr_list->nCount;
- LogDebug("nToCnt : " << nToCnt);
+ nToCnt = msg_list_length(addr_list);
+ LoggerD("nToCnt : " << nToCnt);
for (int i = 0; i < nToCnt; ++i)
{
+ msg_struct_t tmpAddr;
msg_struct_t new_msg = createNewCopyOfPLatformMsg(m_messageData);
msg_set_int_value(new_msg, MSG_MESSAGE_ID_INT, tempIdInt);
- msg_get_list_handle(new_msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&new_addr_list);
-
- msg_get_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, &tempInt);
- LogDebug("RECIPIENT_TYPE : " << tempInt);
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
+ msg_get_int_value(addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, &tempInt);
+ LoggerD("RECIPIENT_TYPE : " << tempInt);
if(MSG_RECIPIENTS_TYPE_TO != tempInt)
{
- LogDebug("skip");
+ LoggerD("skip");
continue;
}
+ msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+
+ msg_list_add_item(new_msg, MSG_MESSAGE_ADDR_LIST_HND, &tmpAddr);
- msg_get_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
- msg_set_str_value(new_addr_list->msg_struct_info[0], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
- msg_set_int_value(new_addr_list->msg_struct_info[0], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_TO);
- new_addr_list->nCount = 1;
+ msg_set_str_value(tmpAddr, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
+ msg_set_int_value(tmpAddr, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_TO);
setMessageStatus(MESSAGE_STATUS_SENDING);
// schedule sending
PostEvent(0);
- LogDebug("sending method finished");
+ LoggerD("sending method finished");
return 0; //sms handle is -1;
}
void Sms::sendingCallback(msg_struct_t sent_status)
{
-// LogInfo(
+// LoggerI(
// "sendingCallback callback received. Req id = " <<
// sent_status->reqId << " Status = " << (int)sent_status->status <<
// ", Recipient=" << getRecipient());
void Sms::OnEventReceived(const int&)
{
- LogDebug("enter");
+ LoggerD("enter");
// send another one
sendSubMessage();
}
void Sms::sendSubMessage()
{
- LogDebug("enter");
+ LoggerD("enter");
DPL::Mutex::ScopedLock lock(&m_mutex);
msg_sms_send_message,
currentQueue().front(),
this);
- LogInfo("Sending Message (submit request) result:" << err);
+ LoggerI("Sending Message (submit request) result:" << err);
if (err != MSG_SUCCESS) {
- LogError("Sending Message (submit request) failed!!! err=" << err);
+ LoggerE("Sending Message (submit request) failed!!! err=" << err);
msg_release_struct(¤tQueue().front());
currentQueue().pop();
m_sendRequests.front().failed = true;
void Sms::setSendingStatusOk(const string &recipient)
{
- LogDebug("enter, success number is : " << recipient);
+ LoggerD("enter, success number is : " << recipient);
//success callback should be executed here
ReqReceiverMessage *requestReceiver = getRequestReceiver();
if (requestReceiver) {
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::None);
event->m_successRecipients.push_back(recipient);
- msg_struct_list_s *addr_list = NULL;
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_list_handle_t addr_list = NULL;
- if ( event->m_successRecipients.size() + event->m_failRecipients.size() == (unsigned int)addr_list->nCount)
+ msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+
+ if ( event->m_successRecipients.size() + event->m_failRecipients.size() == (unsigned int)msg_list_length(addr_list))
{
requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService >::ManualAnswer(event);
}
EventSendMessagePtr event = getSendMessageEvent();
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::None);
event->m_successRecipients.push_back(recipient);
- //LogDebug("total address size : " << msg_get_address_count(m_messageData) << " Status size : " << event->m_successRecipients.size() + event->m_failRecipients.size());
+ //LoggerD("total address size : " << msg_get_address_count(m_messageData) << " Status size : " << event->m_successRecipients.size() + event->m_failRecipients.size());
if ( event->m_successRecipients.size() + event->m_failRecipients.size() == (unsigned int)msg_get_address_count(m_messageData))
{
requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventSendMessage >::ManualAnswer(event);
void Sms::setSendingStatusFailed(const string &recipient)
{
- LogDebug("enter, fail number is : " << recipient);
+ LoggerD("enter, fail number is : " << recipient);
//error callback should be executed here
EventOnSendingFailedEmitterPtr emitter = getEmitter();
if (emitter) {
} else {
ReqReceiverMessage *requestReceiver = getRequestReceiver();
if (requestReceiver) {
- LogError("calling JS error callback");
+ LoggerE("calling JS error callback");
EventMessagingServicePtr event = getMessagingServiceEvent();
event->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::UnknownException);
event->m_successRecipients.push_back(recipient);
- msg_struct_list_s *addr_list = NULL;
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- if ( event->m_successRecipients.size() + event->m_failRecipients.size() == (unsigned int)addr_list->nCount)
+ msg_list_handle_t addr_list = NULL;
+
+ msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+
+ if ( event->m_successRecipients.size() + event->m_failRecipients.size() == (unsigned int)msg_list_length(addr_list))
{
requestReceiver->WrtDeviceApis::Commons::EventRequestReceiver< EventMessagingService >::ManualAnswer(event);
}
// delete message from platform
if (msg_delete_message(MsgGetCommonHandle(),
convertId(getId())) != MSG_SUCCESS) {
- LogError("delete message failed");
+ LoggerE("delete message failed");
Throw(WrtDeviceApis::Commons::PlatformException);
} else {
- LogDebug("message deleted succesfully");
+ LoggerD("message deleted succesfully");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
throw;
}
}
void Sms::createNewMessage()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_messageData) {
// release platform message if it was created previously
msg_release_struct(&m_messageData);
m_messageData = NULL;
}
// create new platform message
- LogDebug("create messeage instance");
+ LoggerD("create messeage instance");
m_messageData = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- LogDebug("created message : " << m_messageData);
+ LoggerD("created message : " << m_messageData);
Try
{
msg_set_int_value(m_messageData, MSG_MESSAGE_DISPLAY_TIME_INT, (int)mktime(&dateT));
setMessageStatus(MESSAGE_STATUS_CREATED);
- LogDebug("Message created successfully, msgId=" << getId());
+ LoggerD("Message created successfully, msgId=" << getId());
}
Catch(WrtDeviceApis::Commons::PlatformException) {
msg_release_struct(&m_messageData);
m_messageData = NULL;
- LogError("Problem with message creation, cleaning");
+ LoggerE("Problem with message creation, cleaning");
}
}
sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
msg_message_id_t l_id = convertId(getIdRef());
- LogDebug("reading message id=" << l_id);
+ LoggerD("reading message id=" << l_id);
// trying to get message from platform
if (MSG_SUCCESS == msg_get_message(MsgGetCommonHandle(), l_id, m_messageData, sendOpt))
{
- LogDebug("message found with msgId=" << getIdRef());
+ LoggerD("message found with msgId=" << getIdRef());
// read all mms dat to abstraction layer
readConversationId(m_messageData);
readMessageStatus(m_messageData);
} else {
- LogError("message not found with msgId=" << getIdRef());
+ LoggerE("message not found with msgId=" << getIdRef());
setId("");
Throw(WrtDeviceApis::Commons::PlatformException);
}
msg_release_struct(&sendOpt);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("exception");
+ LoggerE("exception");
// nothing to do
msg_release_struct(&sendOpt);
}
if (isBodyValid()) {
return;
}
- LogInfo("updating platfoprm body");
+ LoggerI("updating platfoprm body");
// change body value in platform structure
if ( getBodyRef().length() > 0)
if (msg_set_str_value(m_messageData, MSG_MESSAGE_SMS_DATA_STR,
const_cast<char*>(getBodyRef().c_str()), getBodyRef().length()) != MSG_SUCCESS)
{
- LogError("problem with update Body");
+ LoggerE("problem with update Body");
Throw(WrtDeviceApis::Commons::PlatformException);
}
// set flag as true - platform synchronized with abstraction
return;
}
- LogInfo("SMS updating platform recipients");
-
- msg_struct_list_s *addr_list = NULL;
- msg_get_list_handle(m_messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- int nToCnt = addr_list->nCount;
+ LoggerI("SMS updating platform recipients");
- LogInfo("nToCnt size " << nToCnt);
-
- if (nToCnt > 0)
- {
- for (int i = 0; i < nToCnt; i++) {
- msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, (char *)"", 0);
- msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_DISPLAYNAME_STR, (char *)"", 0);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_UNKNOWN);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_CONTACT_ID_INT, 0);
- }
- nToCnt = 0;
- addr_list->nCount = nToCnt;
- }
+ msg_list_clear(m_messageData, MSG_MESSAGE_ADDR_LIST_HND);
vector<string> to = getToRecipients().getRecipients();
// update addresses in platform structure
if (to.size())
{
- LogInfo("updating to");
+ LoggerI("updating to");
for (size_t i = 0; i < to.size(); i++)
{
string tmpAddr = to[i];
{
if (i >= MAX_TO_ADDRESS_CNT)
{
- LogError("max number of recipient exceeded");
+ LoggerE("max number of recipient exceeded");
break;
}
- LogDebug("adding to[" << i << "]=" << to[i]);
+ LoggerD("adding to[" << i << "]=" << to[i]);
- msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+ msg_struct_t newAddr = NULL;
+ msg_list_add_item(m_messageData, MSG_MESSAGE_ADDR_LIST_HND, &newAddr);
- if (msg_set_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
+ msg_set_int_value(newAddr, MSG_ADDRESS_INFO_ADDRESS_TYPE_INT, MSG_ADDRESS_TYPE_PLMN);
+
+ if (msg_set_int_value(newAddr, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT,
MSG_RECIPIENTS_TYPE_TO) != MSG_SUCCESS)
{
- LogError("problem with adding to address");
+ LoggerE("problem with adding to address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding to address");
}
- if(msg_set_str_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
+ if(msg_set_str_value(newAddr, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR,
const_cast<char*>(to[i].c_str()), to[i].size()) != MSG_SUCCESS)
{
- LogError("problem with adding to address");
+ LoggerE("problem with adding to address");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with adding to address");
}
- addr_list->nCount ++;
- LogDebug("addr_list->nCount =" << addr_list->nCount);
+// addr_list->nCount ++;
+// LoggerD("addr_list->nCount =" << addr_list->nCount);
}
else
{
- LogError("wrong phone number format");
+ LoggerE("wrong phone number format");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "wrong phone number format");
}
}
// do not update if not changed
return;
}
- LogInfo("updating platform from");
+ LoggerI("updating platform from");
//TODO
// do not update if not changed
return;
}
- LogInfo("updating platform source address");
+ LoggerI("updating platform source address");
//TODO
void Sms::updateReadStatus()
{
- LogInfo("updating platform read status: " << isRead());
+ LoggerI("updating platform read status: " << isRead());
if (isReadStatusValid()) {
// do not update if not changed
return;
}
if (MSG_SUCCESS != msg_set_bool_value(m_messageData, MSG_MESSAGE_READ_BOOL, isRead())) {
- LogError("problem with setting subject");
+ LoggerE("problem with setting subject");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Problem with setting subject");
}
setReadStatusValidity(true);
void Sms::updateIsRead()
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
Try
{
if (this->getIdRef().empty()) {
- LogError("existing msgId is zero, remove msg not done");
+ LoggerE("existing msgId is zero, remove msg not done");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"existing msgId is zero, remove msg not done");
}
if (MSG_SUCCESS !=
msg_update_read_status(MsgGetCommonHandle(), convertId(getIdRef()), isReadChangeStatus()))
{
- LogError("Failed to update isRead");
+ LoggerE("Failed to update isRead");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update isRead");
}
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("platform error occurs");
+ LoggerE("platform error occurs");
}
setisReadChangeStatusValidity(true);
void Sms::updateMessage()
{
- LogDebug("updating m_id=" << getIdRef());
+ LoggerD("updating m_id=" << getIdRef());
msg_error_t err = MSG_SUCCESS;
msg_struct_t msg = NULL;
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
if (err != MSG_SUCCESS)
{
- LogError("Get Message Failed!");
+ LoggerE("Get Message Failed!");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update message");
}
if (this->getIdRef().empty()) {
- LogError("existing msgId is zero, update msg not done");
+ LoggerE("existing msgId is zero, update msg not done");
ThrowMsg(WrtDeviceApis::Commons::PlatformException,
"existing msgId is zero, update msg not done");
}
if (MSG_SUCCESS != msg_update_message(MsgGetCommonHandle(), m_messageData, sendOpt))
{
- LogError("Failed to update message");
+ LoggerE("Failed to update message");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Failed to update message");
}
msg_release_struct(&msg);
Catch(WrtDeviceApis::Commons::PlatformException) {
msg_release_struct(&msg);
msg_release_struct(&sendOpt);
- LogError("platform error occurs");
+ LoggerE("platform error occurs");
}
}
void Sms::createSendMessage()
{
- LogDebug("convert m_id= " << convertId(getIdRef()));
+ LoggerD("convert m_id= " << convertId(getIdRef()));
//prepare for add sms to draft folder
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
//update all sms data
if (getCurrentFolder() == DRAFTBOX) {
- LogDebug("update all sms data");
+ LoggerD("update all sms data");
updateBody();
updateFrom();
updateTo();
setMessageStatus(MESSAGE_STATUS_DRAFT);
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (m_messageData) {
//releasing platform message structure
msg_release_struct(&m_messageData);
void Sms::addMessageToDraft()
{
- LogDebug("convert m_id= " << convertId(getIdRef()));
+ LoggerD("convert m_id= " << convertId(getIdRef()));
msg_struct_t sendOpt = NULL;
//prepare for add sms to draft folder
if (!m_messageData) {
//error if platform message not exists
- LogError("message can not be updated");
+ LoggerE("message can not be updated");
Throw(WrtDeviceApis::Commons::PlatformException);
}
//update all sms data
if (getCurrentFolder() == DRAFTBOX) {
- LogDebug("update all sms data");
+ LoggerD("update all sms data");
updateBody();
updateFrom();
updateTo();
// trying to add message
int ret = msg_add_message(MsgGetCommonHandle(), m_messageData, sendOpt);
if (ret < MSG_SUCCESS) {
- LogError("msg_add_message failed, error code=" << ret);
+ LoggerE("msg_add_message failed, error code=" << ret);
Throw(WrtDeviceApis::Commons::PlatformException);
}
else
msgId = ret;
}
- LogDebug("Message ID : " << msgId);
+ LoggerD("Message ID : " << msgId);
if (msgId < 0)
{
- LogDebug("Message ID is invailded ");
+ LoggerD("Message ID is invailded ");
Throw(WrtDeviceApis::Commons::PlatformException);
}
setId(convertId(msgId));
setFolderType(DRAFTBOX);
setMessageStatus(MESSAGE_STATUS_DRAFT);
- LogDebug("Message Status " << getMessageStatus());
+ LoggerD("Message Status " << getMessageStatus());
#if 0
if ( folder_list_view.nCount )
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogError("remove message error");
+ LoggerE("remove message error");
if (m_messageData) {
//releasing platform message structure
msg_release_struct(&m_messageData);
{
int tempInt = 0;
msg_get_int_value(messageData, MSG_MESSAGE_THREAD_ID_INT, &tempInt);
- LogDebug("conversationID : " <<tempInt);
+ LoggerD("conversationID : " <<tempInt);
setConvId(tempInt);
}
{
std::string phoneNumber;
// int recipientCount = msg_get_address_count(messageData);
-// LogDebug("Recipient count " << recipientCount);
+// LoggerD("Recipient count " << recipientCount);
+
+ msg_list_handle_t addr_list = NULL;
+ msg_struct_t addr_info = NULL;
- msg_struct_list_s *addr_list;
- msg_get_list_handle(messageData, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
+ msg_get_list_handle(messageData, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
int tempInt = 0;
char strNumber[MAX_ADDRESS_VAL_LEN] = {0,};
- int recipientCount = addr_list->nCount;
- LogDebug("Recipient count " << recipientCount);
+ int recipientCount = msg_list_length(addr_list);
+ LoggerD("Recipient count " << recipientCount);
for (int i = 0; i < recipientCount; ++i)
if (MSG_DIRECTION_TYPE_MT == type)
{
- msg_struct_t addr_info = addr_list->msg_struct_info[i];
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
phoneNumber = strNumber;
setSourceAddress(phoneNumber);
setFrom(phoneNumber);
}
- LogDebug("MT number: " << phoneNumber);
+ LoggerD("MT number: " << phoneNumber);
}
else if (MSG_DIRECTION_TYPE_MO == type)
{
- msg_struct_t addr_info = addr_list->msg_struct_info[i];
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, MAX_ADDRESS_VAL_LEN);
- LogDebug("MO number: " << strNumber);
+ LoggerD("MO number: " << strNumber);
appendToRecipients(strNumber);
}
else
{
- LogError("Wrong type of recipient");
+ LoggerE("Wrong type of recipient");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Wrong type of recipient");
}
}
//set abstraction body value
int tempInt;
msg_get_int_value(messageData, MSG_MESSAGE_DATA_SIZE_INT, &tempInt);
- LogError("body Size : " <<tempInt);
+ LoggerE("body Size : " <<tempInt);
char msgText[tempInt+1];
memset(msgText, 0, tempInt+1);
msg_get_str_value(messageData, MSG_MESSAGE_SMS_DATA_STR, msgText, tempInt);
// setBody(msg_sms_get_message_body(messageData));
- LogError("body : " <<msgText);
+ LoggerE("body : " <<msgText);
setBody(msgText);
}
{
int tempInt = 0;
msg_get_int_value(messageData, MSG_MESSAGE_FOLDER_ID_INT, &tempInt);
- LogError("Folder : " <<tempInt);
+ LoggerE("Folder : " <<tempInt);
switch (tempInt) {
case MSG_INBOX_ID:
setFolderType(DRAFTBOX);
break;
default:
- LogError("Wrong folder id");
+ LoggerE("Wrong folder id");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "Unsupported folder id.");
}
}
{
int tempValue = 0;
msg_get_int_value(messageData, MSG_MESSAGE_FOLDER_ID_INT, &tempValue);
- LogDebug("readMessageStatus folder : " << tempValue);
+ LoggerD("readMessageStatus folder : " << tempValue);
switch (tempValue) {
case MSG_INBOX_ID:
int tempInt = 0;
msg_get_int_value(messageData, MSG_MESSAGE_DISPLAY_TIME_INT, &tempInt);
- LogError("readDateTime : " <<tempInt);
+ LoggerE("readDateTime : " <<tempInt);
tm* time = localtime((time_t*)&tempInt);
if (!time) {
- LogError("localtime failed");
+ LoggerE("localtime failed");
Throw(WrtDeviceApis::Commons::PlatformException);
}
setDateTime(*time);
// get read status
bool tempBool = 0;
msg_get_bool_value(messageData, MSG_MESSAGE_READ_BOOL, &tempBool);
- LogError("readReadStatus : " <<tempBool);
+ LoggerE("readReadStatus : " <<tempBool);
setReadStatus(tempBool);
}
int tempInt;
msg_get_int_value(messageData, MSG_MESSAGE_DATA_SIZE_INT, &tempInt);
// setSize(msg_get_message_body_size(messageData));
- LogError("readSize : " <<tempInt);
+ LoggerE("readSize : " <<tempInt);
setSize(tempInt);
}
msg_struct_t Sms::createNewCopyOfPLatformMsgWithAddressList(const msg_struct_t src) const
{
- int tempInt;
+ int tempInt, nCount;
bool tempBool;
- msg_struct_list_s *addr_list;
- msg_struct_list_s *new_addr_list;
+ msg_list_handle_t addr_list;
+ msg_list_handle_t new_addr_list;
msg_struct_t msg = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
msg_set_int_value(msg, MSG_MESSAGE_SRC_PORT_INT, tempInt);
// copy addr list
- msg_get_list_handle(src, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&new_addr_list);
+ msg_get_list_handle(src, MSG_MESSAGE_ADDR_LIST_HND, (void **)&addr_list);
+ msg_get_list_handle(msg, MSG_MESSAGE_ADDR_LIST_HND, (void **)&new_addr_list);
- new_addr_list->nCount = addr_list->nCount;
+ nCount = msg_list_length(addr_list);
- for(int i=0; i<addr_list->nCount; i++)
+ for(int i=0; i<nCount; i++)
{
msg_struct_t addr_info = NULL;
msg_struct_t new_addr_info = NULL;
char addr_value[MAX_ADDRESS_VAL_LEN] = {0,};
//get original address
- addr_info = addr_list->msg_struct_info[i];
+ addr_info = (msg_struct_t)msg_list_nth_data(addr_list, i);
msg_get_str_value(addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, addr_value, MAX_ADDRESS_VAL_LEN);
msg_get_int_value(addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, &tempInt);
//copy original address
- new_addr_info = new_addr_list->msg_struct_info[i];
+ msg_list_add_item(msg, MSG_MESSAGE_ADDR_LIST_HND, &new_addr_info);
msg_set_str_value(new_addr_info, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, addr_value, MAX_ADDRESS_VAL_LEN);
msg_set_int_value(new_addr_info, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, tempInt);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include "Commons/Exception.h"
#include "SourceAddress.h"
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::Commons;
void SourceAddress::setSourceAddress(const Recipients& value)
{
if (value.getRecipientSize() != 1) {
- LogError("wrong source address value");
+ LoggerE("wrong source address value");
Throw(WrtDeviceApis::Commons::InvalidArgumentException);
}
m_sourceAddress = value.getRecipient(0);
#include "StorageChangesConversationFilterValidator.h"
#include "StorageChangesConversationFilterValidatorFactory.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
bool retVal = false;
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TIMESTAMP)!=0){
- LogError(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
+ LoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
return false;
}
bool retBool = false;
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
#include "StorageChangesConversationGenerator.h"
#include "StorageChangesConversationFilterValidatorFactory.h"
#include "ConversationFilterValidatorFactory.h"
-
#include "IMessagingTypes.h"
-
#include <email-types.h>
-
-#include <dpl/log/log.h>
#include <algorithm>
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
void StorageChangesConversationGenerator::visitPreComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
m_operand.push_back(leftblank);
- LogDebug("Left_blank");
- LogDebug(">>>");
+ LoggerD("Left_blank");
+ LoggerD(">>>");
}
void StorageChangesConversationGenerator::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(type == UNION_FILTER ){
- LogDebug("UNION_FILTER");
+ LoggerD("UNION_FILTER");
m_operand.push_back(operandUnion);
}else if(type == INTERSECTION_FILTER){
- LogDebug("INTERSECTION_FILTER");
+ LoggerD("INTERSECTION_FILTER");
m_operand.push_back(operandIntersection);
}else{
- LogError("[ERROR] invalid Filter type:" << type);
+ LoggerE("[ERROR] invalid Filter type:" << type);
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void StorageChangesConversationGenerator::visitPostComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
bool data1, data2;
do
{
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("m_result size =" << m_result.size());
data1 = m_result.back();
m_result.pop_back();
data2 = m_result.back();
m_result.pop_back();
- LogDebug("m_result size =" << m_result.size());
- LogDebug("m_operand.back() =" << m_operand.back());
- LogDebug("m_operand size =" << m_operand.size());
+ LoggerD("m_result size =" << m_result.size());
+ LoggerD("m_operand.back() =" << m_operand.back());
+ LoggerD("m_operand size =" << m_operand.size());
if(m_operand.back() == operandUnion)
{
- LogDebug("Union");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 || data2 = " << (data1 || data2));
+ LoggerD("Union");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 || data2 = " << (data1 || data2));
m_operand.pop_back();
m_result.push_back(data1 || data2);
- LogDebug("result" << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result" << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
else if(m_operand.back() == operandIntersection)
{
- LogDebug("Intersection");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 && data2 = " << (data1 && data2));
+ LoggerD("Intersection");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 && data2 = " << (data1 && data2));
m_operand.pop_back();
m_result.push_back(data1 && data2);
- LogDebug("result " << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result " << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
}while(m_operand.back() != leftblank);
m_operand.pop_back();
- LogDebug("elase leftblank from m_operand");
- LogDebug("m_operand size =" << m_operand.size());
- LogDebug(">>>");
+ LoggerD("elase leftblank from m_operand");
+ LoggerD("m_operand size =" << m_operand.size());
+ LoggerD(">>>");
}
struct tm StorageChangesConversationGenerator::convertToTimeFormat(const std::string& timeString){
- LogDebug("<<< timeString:[" << timeString << "]");
+ LoggerD("<<< timeString:[" << timeString << "]");
struct tm tm_Time;
memset(&tm_Time, 0, sizeof(tm_Time));
int yearLength = 4;
tm_Time.tm_year = atoi(timeString.substr(0, yearLength).c_str())-1900;
nextStart = nextStart + yearLength;
- LogDebug("<<< tm_Time.tm_year:[" << tm_Time.tm_year << "]");
+ LoggerD("<<< tm_Time.tm_year:[" << tm_Time.tm_year << "]");
int monthLength = 2;
tm_Time.tm_mon = atoi(timeString.substr(nextStart, monthLength).c_str());
nextStart = nextStart + monthLength;
- LogDebug("<<< initTime.tm_mon:[" << tm_Time.tm_mon << "]");
+ LoggerD("<<< initTime.tm_mon:[" << tm_Time.tm_mon << "]");
int dateLength = 2;
tm_Time.tm_mday = atoi(timeString.substr(nextStart, dateLength).c_str());
nextStart = nextStart + dateLength;
- LogDebug("<<< initTime.tm_mday:[" << tm_Time.tm_mday << "]");
+ LoggerD("<<< initTime.tm_mday:[" << tm_Time.tm_mday << "]");
int hourLength = 2;
tm_Time.tm_hour = atoi(timeString.substr(nextStart, hourLength).c_str());
nextStart = nextStart + hourLength;
- LogDebug("<<< initTime.tm_hour:[" << tm_Time.tm_hour << "]");
+ LoggerD("<<< initTime.tm_hour:[" << tm_Time.tm_hour << "]");
int minuteLength = 2;
tm_Time.tm_min = atoi(timeString.substr(nextStart, minuteLength).c_str());
nextStart = nextStart + minuteLength;
- LogDebug("<<< initTime.tm_min:[" << tm_Time.tm_min << "]");
+ LoggerD("<<< initTime.tm_min:[" << tm_Time.tm_min << "]");
int secondLength = 2;
tm_Time.tm_sec = atoi(timeString.substr(nextStart, secondLength).c_str());
- LogDebug("<<< initTime.tm_sec:[" << tm_Time.tm_sec << "]");
+ LoggerD("<<< initTime.tm_sec:[" << tm_Time.tm_sec << "]");
return tm_Time;
}
bool StorageChangesConversationGenerator::getMatchExactlyClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value)
{
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
- LogDebug("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
+ LoggerD("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
if(attrName.compare(valueString) == 0)
{
- LogDebug("<<< getMatchExactlyClause SAME >>>");
+ LoggerD("<<< getMatchExactlyClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchExactlyClause DIFF >>>");
+ LoggerD("<<< getMatchExactlyClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.compare(tempString2) == 0)
{
- LogDebug("<<< getMatchFullstringClause SAME >>>");
+ LoggerD("<<< getMatchFullstringClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchFullstringClause DIFF >>>");
+ LoggerD("<<< getMatchFullstringClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName.find(valueString) : " << tempString1.find(tempString2));
+ LoggerD("<<< attrName.find(valueString) : " << tempString1.find(tempString2));
if(tempString1.find(tempString2) != std::string::npos)
{
- LogDebug("<<< getMatchContainsClause CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause CONTAINS >>>");
return TRUE;
}else{
- LogDebug("<<< getMatchContainsClause NOT CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause NOT CONTAINS >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
if(tempString1.compare(0,tempString2.size(), tempString2) == 0)
{
- LogDebug("<<< getMatchStartwithClause START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause START WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchStartwithClause NOT START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause NOT START WITH >>>");
return FALSE;
}
}
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString) : " << attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString));
+ LoggerD("<<< attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString) : " << attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString));
if(tempString1.size() < tempString2.size())
if(tempString1.compare(tempString1.size()-tempString2.size(),tempString2.size(), tempString2) == 0 )
{
- LogDebug("<<< getMatchEndwithClause END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause END WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchEndwithClause NOT END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause NOT END WITH >>>");
return FALSE;
}
}
bool StorageChangesConversationGenerator::getMatchExistClause(std::string& attrName)
{
- LogDebug("<<< attrName : " << attrName);
+ LoggerD("<<< attrName : " << attrName);
if(attrName.size()> 0)
return TRUE;
else
void StorageChangesConversationGenerator::visitAttribute(std::string& attrName,
MatchFlag& matchFlag, AnyPtr& matchValue, int depth){
- LogDebug("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
+ LoggerD("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
if(matchFlag != DeviceAPI::Tizen::MATCH_EXISTS){
if(matchValue == NULL) {
return;
}
}
- LogDebug("matchValue:" << matchValue->toString());
+ LoggerD("matchValue:" << matchValue->toString());
visitAttributeEach(attrName, matchFlag, matchValue, depth);
- LogDebug(">>>");
+ LoggerD(">>>");
}
void StorageChangesConversationGenerator::visitAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
std::string valueString;
// Check msg_type and filter_type
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_id == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< id is same");
+ LoggerD("<<< id is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< id is different");
+ LoggerD("<<< id is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TYPE)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string convertType = value->toString();
int nType = convertMessageType(convertType);
if((int)m_type == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< type is same");
+ LoggerD("<<< type is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< type is different");
+ LoggerD("<<< type is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_MESSAGE_COUNT)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_messageCount == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< messageCount is same");
+ LoggerD("<<< messageCount is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< messageCount is different");
+ LoggerD("<<< messageCount is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_UNREAD_MESSAGES)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_unreadMessages == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< unreadMessages is same");
+ LoggerD("<<< unreadMessages is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< unreadMessages is different");
+ LoggerD("<<< unreadMessages is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_IS_READ)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string lowerString;
lowerString.assign(value->toString());
StrLowChange(lowerString);
if((int)m_read != nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< read is same");
+ LoggerD("<<< read is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< read is different");
+ LoggerD("<<< read is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_LAST_MESSAGE_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_lastMessageId == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< lastMessageId is same");
+ LoggerD("<<< lastMessageId is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< lastMessageId is different");
+ LoggerD("<<< lastMessageId is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_PREVIEW)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_body:[" << m_preview << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_body:[" << m_preview << "]");
valueString = m_preview;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< preview is same");
+ LoggerD("<<< preview is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< preview is different");
+ LoggerD("<<< preview is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_FROM)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_from:[" << m_from << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_from:[" << m_from << "]");
valueString = m_from;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< from is same");
+ LoggerD("<<< from is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< from is different");
+ LoggerD("<<< from is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_SUBJECT)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_subject:[" << m_subject << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_subject:[" << m_subject << "]");
valueString = m_subject;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< subject is same");
+ LoggerD("<<< subject is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< subject is different");
+ LoggerD("<<< subject is different");
}
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_TO)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_to.size :[" << m_to.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_to.size :[" << m_to.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_to.size(); i++)
valueString = m_to[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< to compare result is :" << result);
+ LoggerD("<<< to compare result is :" << result);
m_result.push_back(result);
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_CC)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_cc.size :[" << m_cc.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_cc.size :[" << m_cc.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_cc.size(); i++)
valueString = m_cc[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< cc compare result is : " << result);
+ LoggerD("<<< cc compare result is : " << result);
m_result.push_back(result);
return;
}
if(attrName.compare(StorageChangesConversationFilterValidatorFactory::ATTRIBUTE_BCC)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_cc.size :[" << m_bcc.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_cc.size :[" << m_bcc.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_bcc.size(); i++)
valueString = m_bcc[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< bcc compare result is : " << result);
+ LoggerD("<<< bcc compare result is : " << result);
m_result.push_back(result);
return;
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
int StorageChangesConversationGenerator::convertMessageType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("messaging.email") ==0){
retMessageType = EMAIL;
}else{
- LogError("invalid type:[" << stringType << "]");
+ LoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
}else if(booleanString.compare("false") == 0){
retString = "0";
}else{
- LogError("invalid booleanString:[" << booleanString << "]");
+ LoggerE("invalid booleanString:[" << booleanString << "]");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "invalid booleanString :[" + booleanString + "]");
}
return retString;
if (!initialValue->isNullOrUndefined()) {
if( initialValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
startTime = *initialValue->getDateTm();
- LogDebug("<<<valueStr[" << initialValueStr <<"]");
+ LoggerD("<<<valueStr[" << initialValueStr <<"]");
}
else {
- LogError("initialValue->getType()");
+ LoggerE("initialValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid initialValue Type");
}
}
if (!endValue->isNullOrUndefined()) {
if( endValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<endValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<endValue->getType()[PrimitiveType_Time]");
endTime= *endValue->getDateTm();
- LogDebug("<<<valueStr[" << endValueStr <<"]");
+ LoggerD("<<<valueStr[" << endValueStr <<"]");
} else {
- LogError("endValue->getType()");
+ LoggerE("endValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid endValue Type");
}
}
// retValue = convertToTimeFormat(endValueStr);
end_time = mktime(&endTime);
- LogDebug("<<< mktime(initialValue):[" << init_time << "]");
- LogDebug("<<< mktime(m_dateTime):[" << mid_time << "]");
- LogDebug("<<< mktime(endValue):[" << end_time << "]");
- LogDebug("<<< mid_time - init_time:[" << mid_time - init_time << "]");
- LogDebug("<<< end_time - mid_time:[" << end_time - mid_time << "]");
+ LoggerD("<<< mktime(initialValue):[" << init_time << "]");
+ LoggerD("<<< mktime(m_dateTime):[" << mid_time << "]");
+ LoggerD("<<< mktime(endValue):[" << end_time << "]");
+ LoggerD("<<< mid_time - init_time:[" << mid_time - init_time << "]");
+ LoggerD("<<< end_time - mid_time:[" << end_time - mid_time << "]");
if(((mid_time - init_time) >= 0 ) && ((end_time - mid_time) >= 0 ))
{
- LogDebug("<<< timestamp is in range");
+ LoggerD("<<< timestamp is in range");
m_result.push_back(TRUE);
}
else
{
- LogDebug("<<< timestamp is out of range");
+ LoggerD("<<< timestamp is out of range");
m_result.push_back(FALSE);
}
}
std::vector<std::string>::iterator iter;
bool result = FALSE;
if(matchFlag == DeviceAPI::Tizen::MATCH_EXACTLY){
- LogDebug("STRING_MATCH_EXACTLY");
+ LoggerD("STRING_MATCH_EXACTLY");
result = result || getMatchExactlyClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_FULLSTRING){
- LogDebug("STRING_MATCH_FULLSTRING");
+ LoggerD("STRING_MATCH_FULLSTRING");
result = result || getMatchFullstringClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_CONTAINS){
- LogDebug("STRING_MATCH_CONTAINS");
+ LoggerD("STRING_MATCH_CONTAINS");
result = result || getMatchContainsClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_STARTSWITH){
- LogDebug("STRING_MATCH_STARTSWITH");
+ LoggerD("STRING_MATCH_STARTSWITH");
result = result || getMatchStartwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_ENDSWITH){
- LogDebug("STRING_MATCH_ENDSWITH");
+ LoggerD("STRING_MATCH_ENDSWITH");
result = result || getMatchEndwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_EXISTS){
- LogDebug("STRING_MATCH_EXIST");
+ LoggerD("STRING_MATCH_EXIST");
result = result || getMatchExistClause(valueString);
}else{
- LogDebug("[ERROR]invalid match flag : iter:" << *iter);
+ LoggerD("[ERROR]invalid match flag : iter:" << *iter);
}
return result;
}
bool StorageChangesConversationGenerator::getCompareResult()
{
bool result;
- LogDebug("m_result.size() " << m_result.size());
+ LoggerD("m_result.size() " << m_result.size());
result = m_result.back();
m_result.pop_back();
- LogDebug("result = " << result);
+ LoggerD("result = " << result);
return result;
}
#include "StorageChangesFolderFilterValidator.h"
#include "StorageChangesFolderFilterValidatorFactory.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
bool StorageChangesFolderFilterValidator::validateAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth){
bool retVal = false;
- LogError(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
+ LoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
return retVal;
}
return false;
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
#include "StorageChangesFolderGenerator.h"
#include "StorageChangesFolderFilterValidatorFactory.h"
-
#include "IMessagingTypes.h"
-
#include <email-types.h>
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
m_type = (unsigned short)folder->getType();
m_synchronizable = folder->getSynchronizable();
- LogDebug("m_type:" << m_type );
+ LoggerD("m_type:" << m_type );
}
void StorageChangesFolderGenerator::visitPreComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
m_operand.push_back(leftblank);
- LogDebug("Left_blank");
- LogDebug(">>>");
+ LoggerD("Left_blank");
+ LoggerD(">>>");
}
void StorageChangesFolderGenerator::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(type == UNION_FILTER ){
- LogDebug("UNION_FILTER");
+ LoggerD("UNION_FILTER");
m_operand.push_back(operandUnion);
}else if(type == INTERSECTION_FILTER){
- LogDebug("INTERSECTION_FILTER");
+ LoggerD("INTERSECTION_FILTER");
m_operand.push_back(operandIntersection);
}else{
- LogError("[ERROR] invalid Filter type:" << type);
+ LoggerE("[ERROR] invalid Filter type:" << type);
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void StorageChangesFolderGenerator::visitPostComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
bool data1, data2;
do
{
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("m_result size =" << m_result.size());
data1 = m_result.back();
m_result.pop_back();
data2 = m_result.back();
m_result.pop_back();
- LogDebug("m_result size =" << m_result.size());
- LogDebug("m_operand.back() =" << m_operand.back());
- LogDebug("m_operand size =" << m_operand.size());
+ LoggerD("m_result size =" << m_result.size());
+ LoggerD("m_operand.back() =" << m_operand.back());
+ LoggerD("m_operand size =" << m_operand.size());
if(m_operand.back() == operandUnion)
{
- LogDebug("Union");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 || data2 = " << (data1 || data2));
+ LoggerD("Union");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 || data2 = " << (data1 || data2));
m_operand.pop_back();
m_result.push_back(data1 || data2);
- LogDebug("result" << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result" << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
else if(m_operand.back() == operandIntersection)
{
- LogDebug("Intersection");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 && data2 = " << (data1 && data2));
+ LoggerD("Intersection");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 && data2 = " << (data1 && data2));
m_operand.pop_back();
m_result.push_back(data1 && data2);
- LogDebug("result " << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result " << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
}while(m_operand.back() != leftblank);
m_operand.pop_back();
- LogDebug("elase leftblank from m_operand");
- LogDebug("m_operand size =" << m_operand.size());
- LogDebug(">>>");
+ LoggerD("elase leftblank from m_operand");
+ LoggerD("m_operand size =" << m_operand.size());
+ LoggerD(">>>");
}
bool StorageChangesFolderGenerator::getMatchExactlyClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value)
{
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
- LogDebug("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
+ LoggerD("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
if(attrName.compare(valueString) == 0)
{
- LogDebug("<<< getMatchExactlyClause SAME >>>");
+ LoggerD("<<< getMatchExactlyClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchExactlyClause DIFF >>>");
+ LoggerD("<<< getMatchExactlyClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.compare(tempString2) == 0)
{
- LogDebug("<<< getMatchFullstringClause SAME >>>");
+ LoggerD("<<< getMatchFullstringClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchFullstringClause DIFF >>>");
+ LoggerD("<<< getMatchFullstringClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.find(tempString2) != std::string::npos)
{
- LogDebug("<<< getMatchContainsClause CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause CONTAINS >>>");
return TRUE;
}else{
- LogDebug("<<< getMatchContainsClause NOT CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause NOT CONTAINS >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.size() < tempString2.size())
return FALSE;
if(tempString1.compare(0,tempString2.size(), tempString2) == 0)
{
- LogDebug("<<< getMatchStartwithClause START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause START WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchStartwithClause NOT START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause NOT START WITH >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.size() < tempString2.size())
return FALSE;
if(tempString1.compare(tempString1.size()-tempString2.size(),tempString2.size(), tempString2) == 0 )
{
- LogDebug("<<< getMatchEndwithClause END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause END WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchEndwithClause NOT END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause NOT END WITH >>>");
return FALSE;
}
}
bool StorageChangesFolderGenerator::getMatchExistClause(std::string& attrName)
{
- LogDebug("<<< attrName : " << attrName);
+ LoggerD("<<< attrName : " << attrName);
if(attrName.size()> 0)
return TRUE;
else
void StorageChangesFolderGenerator::visitAttribute(std::string& attrName,
DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& matchValue, int depth){
- LogDebug("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
+ LoggerD("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
if(matchFlag != DeviceAPI::Tizen::MATCH_EXISTS){
if(matchValue == NULL) {
}
}
- LogDebug("matchValue:" << matchValue->toString());
+ LoggerD("matchValue:" << matchValue->toString());
visitAttributeEach(attrName, matchFlag, matchValue, depth);
}
void StorageChangesFolderGenerator::visitAttributeEach(std::string& attrName, DeviceAPI::Tizen::MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
std::string valueString;
// Check Folder_type and filter_type
if(attrName.compare( StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_ACCOUNT_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_accountid == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< accountid is same");
+ LoggerD("<<< accountid is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< accountid is different");
+ LoggerD("<<< accountid is different");
}
return;
}
if(attrName.compare(StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_CONTENT_TYPE)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string convertType = value->toString();
int nType = convertMessageType(convertType);
if((int)m_contestType == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< contestType is same");
+ LoggerD("<<< contestType is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< contestType is different");
+ LoggerD("<<< contestType is different");
}
return;
}
if(attrName.compare(StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_TYPE )==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string convertType = value->toString();
int nType = convertFolderType(convertType);
if((int)m_type == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< type is same");
+ LoggerD("<<< type is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< type is different");
+ LoggerD("<<< type is different");
}
return;
}
if(attrName.compare(StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_SYNCHRONIZABLE)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string lowerString;
lowerString.assign(value->toString());
StrLowChange(lowerString);
if((int)m_synchronizable != nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< synchronizable is same");
+ LoggerD("<<< synchronizable is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< synchronizable is different");
+ LoggerD("<<< synchronizable is different");
}
return;
}
if(attrName.compare(StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_NAME)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_name:[" << m_name << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_name:[" << m_name << "]");
valueString = m_name;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< name is same");
+ LoggerD("<<< name is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< name is different");
+ LoggerD("<<< name is different");
}
return;
}
if(attrName.compare(StorageChangesFolderFilterValidatorFactory::ATTRIBUTE_PATH)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_path:[" << m_path << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_path:[" << m_path << "]");
valueString = m_path;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< path is same");
+ LoggerD("<<< path is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< path is different");
+ LoggerD("<<< path is different");
}
return;
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
int StorageChangesFolderGenerator::convertMessageType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("messaging.email") ==0){
retMessageType = EMAIL;
}else{
- LogError("invalid type:[" << stringType << "]");
+ LoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
int StorageChangesFolderGenerator::convertFolderType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("SENTBOX") ==0){
retMessageType = SENTBOX;
}else{
- LogError("invalid type:[" << stringType << "]");
+ LoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
void StorageChangesFolderGenerator::visitAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth) {
- LogDebug("<<< NOT SUPPROTED");
- LogDebug(">>>");
+ LoggerD("<<< NOT SUPPROTED");
+ LoggerD(">>>");
m_result.push_back(FALSE);
}
std::vector<std::string>::iterator iter;
bool result = FALSE;
if(matchFlag == DeviceAPI::Tizen::MATCH_EXACTLY){
- LogDebug("STRING_MATCH_EXACTLY");
+ LoggerD("STRING_MATCH_EXACTLY");
result = result || getMatchExactlyClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_FULLSTRING){
- LogDebug("STRING_MATCH_FULLSTRING");
+ LoggerD("STRING_MATCH_FULLSTRING");
result = result || getMatchFullstringClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_CONTAINS){
- LogDebug("STRING_MATCH_CONTAINS");
+ LoggerD("STRING_MATCH_CONTAINS");
result = result || getMatchContainsClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_STARTSWITH){
- LogDebug("STRING_MATCH_STARTSWITH");
+ LoggerD("STRING_MATCH_STARTSWITH");
result = result || getMatchStartwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_ENDSWITH){
- LogDebug("STRING_MATCH_ENDSWITH");
+ LoggerD("STRING_MATCH_ENDSWITH");
result = result || getMatchEndwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_EXISTS){
- LogDebug("STRING_MATCH_EXIST");
+ LoggerD("STRING_MATCH_EXIST");
result = result || getMatchExistClause(valueString);
}else{
- LogDebug("[ERROR]invalid match flag : iter:" << *iter);
+ LoggerD("[ERROR]invalid match flag : iter:" << *iter);
}
return result;
}
bool StorageChangesFolderGenerator::getCompareResult()
{
bool result;
- LogDebug("m_result.size() " << m_result.size());
+ LoggerD("m_result.size() " << m_result.size());
result = m_result.back();
m_result.pop_back();
- LogDebug("result = " << result);
+ LoggerD("result = " << result);
return result;
}
#include "StorageChangesMessageFilterValidator.h"
#include "StorageChangesMessageFilterValidatorFactory.h"
-
-#include <dpl/log/log.h>
+#include <Logger.h>
using namespace DeviceAPI::Tizen;
bool StorageChangesMessageFilterValidator::validateAttributeRange(std::string& attrName, DeviceAPI::Tizen::AnyPtr& initialValue, DeviceAPI::Tizen::AnyPtr& endValue, int depth){
bool retVal = false;
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_TIMESTAMP)!=0){
- LogError(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
+ LoggerE(">>> [ERROR] Not Supported attribute :[" << attrName << "]");
return false;
}
bool retBool = false;
retBool = FilterValidator::validateAttribute(attrName, matchFlag, matchValue, depth);
- LogDebug(">>> retBool:" << retBool);
+ LoggerD(">>> retBool:" << retBool);
return retBool;
}
}
#include <email-types.h>
-#include <dpl/log/log.h>
#include <algorithm>
+#include <Logger.h>
using namespace std;
using namespace DeviceAPI::Tizen;
if(m_type == SMS)
{
- LogDebug("size :" << Recipents->getRecipientSize());
+ LoggerD("size :" << Recipents->getRecipientSize());
if(Recipents->getRecipientSize()>0)
{
m_to = Recipents->getRecipientsRef();
- LogDebug("m_to :" << m_to[0]);
+ LoggerD("m_to :" << m_to[0]);
}
}
else if(m_type == MMS)
{
- LogDebug("to size :" << Recipents->getRecipientSize());
+ LoggerD("to size :" << Recipents->getRecipientSize());
IMmsPtr mms = DPL::DynamicPointerCast<IMms >(msg);
if(Recipents->getRecipientSize() > 0)
{
m_to = Recipents->getRecipientsRef();
- LogDebug("m_to :" << m_to[0]);
+ LoggerD("m_to :" << m_to[0]);
}
Recipents = mms->getCcRecipientsPtr();
- LogDebug("cc size :" << Recipents->getRecipientSize());
+ LoggerD("cc size :" << Recipents->getRecipientSize());
if(Recipents->getRecipientSize() > 0)
{
}
Recipents = mms->getBccRecipientsPtr();
- LogDebug("bcc size :" << Recipents->getRecipientSize());
+ LoggerD("bcc size :" << Recipents->getRecipientSize());
if(Recipents->getRecipientSize() > 0)
{
}
else if(m_type == EMAIL)
{
- LogDebug("to size :" << Recipents->getRecipientSize());
+ LoggerD("to size :" << Recipents->getRecipientSize());
IEmailPtr email = DPL::DynamicPointerCast<IEmail >(msg);
if(Recipents->getRecipientSize() > 0)
{
m_to = Recipents->getRecipientsRef();
- LogDebug("m_to :" << m_to[0]);
+ LoggerD("m_to :" << m_to[0]);
}
Recipents = email->getCcRecipientsPtr();
- LogDebug("cc size :" << Recipents->getRecipientSize());
+ LoggerD("cc size :" << Recipents->getRecipientSize());
if(Recipents->getRecipientSize() > 0)
{
}
Recipents = email->getBccRecipientsPtr();
- LogDebug("bcc size :" << Recipents->getRecipientSize());
+ LoggerD("bcc size :" << Recipents->getRecipientSize());
if(Recipents->getRecipientSize() > 0)
{
m_messageStatus = msg->getMessageStatus();
- LogDebug("m_type:" << m_type );
- LogDebug("m_folder:" << m_folder );
- LogDebug("m_dateTime year:" << m_dateTime.tm_year + 1900 );
- LogDebug("m_dateTime mon:" << m_dateTime.tm_mon );
- LogDebug("m_dateTime day:" << m_dateTime.tm_mday );
- LogDebug("m_dateTime hour:" << m_dateTime.tm_hour );
- LogDebug("m_dateTime min:" << m_dateTime.tm_min );
- LogDebug("m_dateTime sec:" << m_dateTime.tm_sec );
- LogDebug("m_from:" << m_from );
- LogDebug("m_body:" << m_body );
- LogDebug("m_isRead:" << m_isRead );
- LogDebug("m_priority:" << m_priority );
- LogDebug("m_subject:" << m_subject );
+ LoggerD("m_type:" << m_type );
+ LoggerD("m_folder:" << m_folder );
+ LoggerD("m_dateTime year:" << m_dateTime.tm_year + 1900 );
+ LoggerD("m_dateTime mon:" << m_dateTime.tm_mon );
+ LoggerD("m_dateTime day:" << m_dateTime.tm_mday );
+ LoggerD("m_dateTime hour:" << m_dateTime.tm_hour );
+ LoggerD("m_dateTime min:" << m_dateTime.tm_min );
+ LoggerD("m_dateTime sec:" << m_dateTime.tm_sec );
+ LoggerD("m_from:" << m_from );
+ LoggerD("m_body:" << m_body );
+ LoggerD("m_isRead:" << m_isRead );
+ LoggerD("m_priority:" << m_priority );
+ LoggerD("m_subject:" << m_subject );
}
}
void StorageChangesMessageGenerator::visitPreComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
m_operand.push_back(leftblank);
- LogDebug("Left_blank");
- LogDebug(">>>");
+ LoggerD("Left_blank");
+ LoggerD(">>>");
}
void StorageChangesMessageGenerator::visitInComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
if(type == UNION_FILTER ){
- LogDebug("UNION_FILTER");
+ LoggerD("UNION_FILTER");
m_operand.push_back(operandUnion);
}else if(type == INTERSECTION_FILTER){
- LogDebug("INTERSECTION_FILTER");
+ LoggerD("INTERSECTION_FILTER");
m_operand.push_back(operandIntersection);
}else{
- LogError("[ERROR] invalid Filter type:" << type);
+ LoggerE("[ERROR] invalid Filter type:" << type);
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
void StorageChangesMessageGenerator::visitPostComposite(DeviceAPI::Tizen::FilterType& type, int depth){
- LogDebug("<<<");
+ LoggerD("<<<");
bool data1, data2;
do
{
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("m_result size =" << m_result.size());
data1 = m_result.back();
m_result.pop_back();
data2 = m_result.back();
m_result.pop_back();
- LogDebug("m_result size =" << m_result.size());
- LogDebug("m_operand.back() =" << m_operand.back());
- LogDebug("m_operand size =" << m_operand.size());
+ LoggerD("m_result size =" << m_result.size());
+ LoggerD("m_operand.back() =" << m_operand.back());
+ LoggerD("m_operand size =" << m_operand.size());
if(m_operand.back() == operandUnion)
{
- LogDebug("Union");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 || data2 = " << (data1 || data2));
+ LoggerD("Union");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 || data2 = " << (data1 || data2));
m_operand.pop_back();
m_result.push_back(data1 || data2);
- LogDebug("result" << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result" << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
else if(m_operand.back() == operandIntersection)
{
- LogDebug("Intersection");
- LogDebug("data1 = " << data1);
- LogDebug("data2 = " << data2);
- LogDebug("data1 && data2 = " << (data1 && data2));
+ LoggerD("Intersection");
+ LoggerD("data1 = " << data1);
+ LoggerD("data2 = " << data2);
+ LoggerD("data1 && data2 = " << (data1 && data2));
m_operand.pop_back();
m_result.push_back(data1 && data2);
- LogDebug("result" << m_result.back());
- LogDebug("m_result size =" << m_result.size());
+ LoggerD("result" << m_result.back());
+ LoggerD("m_result size =" << m_result.size());
}
}while(m_operand.back() != leftblank);
m_operand.pop_back();
- LogDebug("elase leftblank from m_operand");
- LogDebug("m_operand size =" << m_operand.size());
- LogDebug(">>>");
+ LoggerD("elase leftblank from m_operand");
+ LoggerD("m_operand size =" << m_operand.size());
+ LoggerD(">>>");
}
struct tm StorageChangesMessageGenerator::convertToTimeFormat(const std::string& timeString){
- LogDebug("<<< timeString:[" << timeString << "]");
+ LoggerD("<<< timeString:[" << timeString << "]");
struct tm tm_Time;
memset(&tm_Time, 0, sizeof(tm_Time));
int yearLength = 4;
tm_Time.tm_year = atoi(timeString.substr(0, yearLength).c_str())-1900;
nextStart = nextStart + yearLength;
- LogDebug("<<< tm_Time.tm_year:[" << tm_Time.tm_year << "]");
+ LoggerD("<<< tm_Time.tm_year:[" << tm_Time.tm_year << "]");
int monthLength = 2;
tm_Time.tm_mon = atoi(timeString.substr(nextStart, monthLength).c_str());
nextStart = nextStart + monthLength;
- LogDebug("<<< initTime.tm_mon:[" << tm_Time.tm_mon << "]");
+ LoggerD("<<< initTime.tm_mon:[" << tm_Time.tm_mon << "]");
int dateLength = 2;
tm_Time.tm_mday = atoi(timeString.substr(nextStart, dateLength).c_str());
nextStart = nextStart + dateLength;
- LogDebug("<<< initTime.tm_mday:[" << tm_Time.tm_mday << "]");
+ LoggerD("<<< initTime.tm_mday:[" << tm_Time.tm_mday << "]");
int hourLength = 2;
tm_Time.tm_hour = atoi(timeString.substr(nextStart, hourLength).c_str());
nextStart = nextStart + hourLength;
- LogDebug("<<< initTime.tm_hour:[" << tm_Time.tm_hour << "]");
+ LoggerD("<<< initTime.tm_hour:[" << tm_Time.tm_hour << "]");
int minuteLength = 2;
tm_Time.tm_min = atoi(timeString.substr(nextStart, minuteLength).c_str());
nextStart = nextStart + minuteLength;
- LogDebug("<<< initTime.tm_min:[" << tm_Time.tm_min << "]");
+ LoggerD("<<< initTime.tm_min:[" << tm_Time.tm_min << "]");
int secondLength = 2;
tm_Time.tm_sec = atoi(timeString.substr(nextStart, secondLength).c_str());
- LogDebug("<<< initTime.tm_sec:[" << tm_Time.tm_sec << "]");
+ LoggerD("<<< initTime.tm_sec:[" << tm_Time.tm_sec << "]");
return tm_Time;
}
bool StorageChangesMessageGenerator::getMatchExactlyClause(std::string& attrName, DeviceAPI::Tizen::AnyPtr& value)
{
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
- LogDebug("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
+ LoggerD("<<< attrName.compare(valueString) : " << attrName.compare(valueString));
if(attrName.compare(valueString) == 0)
{
- LogDebug("<<< getMatchExactlyClause SAME >>>");
+ LoggerD("<<< getMatchExactlyClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchExactlyClause DIFF >>>");
+ LoggerD("<<< getMatchExactlyClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.compare(tempString2) == 0)
{
- LogDebug("<<< getMatchFullstringClause SAME >>>");
+ LoggerD("<<< getMatchFullstringClause SAME >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchFullstringClause DIFF >>>");
+ LoggerD("<<< getMatchFullstringClause DIFF >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.find(tempString2) != std::string::npos)
{
- LogDebug("<<< getMatchContainsClause CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause CONTAINS >>>");
return TRUE;
}else{
- LogDebug("<<< getMatchContainsClause NOT CONTAINS >>>");
+ LoggerD("<<< getMatchContainsClause NOT CONTAINS >>>");
return FALSE;
}
}
std::string tempString2;
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName : " << tempString1);
- LogDebug("<<< valueString : " << tempString2);
+ LoggerD("<<< attrName : " << tempString1);
+ LoggerD("<<< valueString : " << tempString2);
if(tempString1.size() < tempString2.size())
if(tempString1.compare(0,tempString2.size(), tempString2) == 0)
{
- LogDebug("<<< getMatchStartwithClause START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause START WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchStartwithClause NOT START WITH >>>");
+ LoggerD("<<< getMatchStartwithClause NOT START WITH >>>");
return FALSE;
}
}
std::string valueString = value->toString();
- LogDebug("<<< attrName : " << attrName);
- LogDebug("<<< valueString : " << valueString);
+ LoggerD("<<< attrName : " << attrName);
+ LoggerD("<<< valueString : " << valueString);
tempString1.assign(attrName);
tempString2.assign(valueString);
StrLowChange(tempString1);
StrLowChange(tempString2);
- LogDebug("<<< attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString) : " << attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString));
+ LoggerD("<<< attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString) : " << attrName.compare(attrName.size()-valueString.size(),valueString.size(), valueString));
if(tempString1.size() < tempString2.size())
if(tempString1.compare(tempString1.size()-tempString2.size(),tempString2.size(), tempString2) == 0 )
{
- LogDebug("<<< getMatchEndwithClause END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause END WITH >>>");
return TRUE;
}
else{
- LogDebug("<<< getMatchEndwithClause NOT END WITH >>>");
+ LoggerD("<<< getMatchEndwithClause NOT END WITH >>>");
return FALSE;
}
}
init_time = mktime(&initialValue);
mid_time = mktime(&m_dateTime);
end_time = mktime(&endValue);
- LogDebug("<<< mktime(initialValue):[" << init_time << "]");
- LogDebug("<<< mktime(m_dateTime):[" << mid_time << "]");
- LogDebug("<<< mktime(endValue):[" << end_time << "]");
- LogDebug("<<< mid_time - init_time:[" << mid_time - init_time << "]");
- LogDebug("<<< end_time - mid_time:[" << end_time - mid_time << "]");
+ LoggerD("<<< mktime(initialValue):[" << init_time << "]");
+ LoggerD("<<< mktime(m_dateTime):[" << mid_time << "]");
+ LoggerD("<<< mktime(endValue):[" << end_time << "]");
+ LoggerD("<<< mid_time - init_time:[" << mid_time - init_time << "]");
+ LoggerD("<<< end_time - mid_time:[" << end_time - mid_time << "]");
if(((mid_time - init_time) >= 0 ) && ((end_time - mid_time) >= 0 ))
return TRUE;
bool StorageChangesMessageGenerator::getMatchExistClause(std::string& attrName)
{
- LogDebug("<<< attrName : " << attrName);
+ LoggerD("<<< attrName : " << attrName);
if(attrName.size()> 0)
return TRUE;
else
void StorageChangesMessageGenerator::visitAttribute(std::string& attrName,
MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& matchValue, int depth){
- LogDebug("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
+ LoggerD("<<< attrName:[" << attrName << "], matchFlag:[" << matchFlag << "]");
if(matchFlag != DeviceAPI::Tizen::MATCH_EXISTS){
if(matchValue == NULL) {
return;
}
}
- LogDebug("matchValue:" << matchValue->toString());
+ LoggerD("matchValue:" << matchValue->toString());
visitAttributeEach(attrName, matchFlag, matchValue, depth);
- LogDebug(">>>");
+ LoggerD(">>>");
}
void StorageChangesMessageGenerator::visitAttributeEach(std::string& attrName, MatchFlag& matchFlag, DeviceAPI::Tizen::AnyPtr& value, int depth){
- LogDebug("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
+ LoggerD("<<< attrName:[" << attrName << "], value:[" << value->toString() << "]");
std::string valueString;
// Check msg_type and filter_type
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SERVICE_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if(m_serviceId == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< Type is same");
+ LoggerD("<<< Type is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< Type is different");
+ LoggerD("<<< Type is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CONVERSATION_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if(m_conversationId == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< conversationID is same");
+ LoggerD("<<< conversationID is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< conversationID is different");
+ LoggerD("<<< conversationID is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_TYPE)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
m_currentType = value->toString();
m_messageType = convertMessageType(m_currentType);
if((int)m_type == m_messageType)
{
m_result.push_back(TRUE);
- LogDebug("<<< Type is same");
+ LoggerD("<<< Type is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< Type is different");
+ LoggerD("<<< Type is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FOLDER_ID)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if((int)m_folder == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< folder is same");
+ LoggerD("<<< folder is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< folder is different");
+ LoggerD("<<< folder is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_IS_READ)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string lowerString;
lowerString.assign(value->toString());
StrLowChange(lowerString);
if((int)m_isRead != nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< isRead is same");
+ LoggerD("<<< isRead is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< isRead is different");
+ LoggerD("<<< isRead is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_HAS_ATTACHMENT)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
std::string lowerString;
lowerString.assign(value->toString());
StrLowChange(lowerString);
if((int)m_hasAttachment != nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< isRead is same");
+ LoggerD("<<< isRead is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< isRead is different");
+ LoggerD("<<< isRead is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_MESSAGE_STATUS)==0){
- LogDebug("<<< value:[" << value->toString() << "]");
+ LoggerD("<<< value:[" << value->toString() << "]");
std::string convertStatus = value->toString();
int nStatus = convertMessageStatus(convertStatus);
if((int)m_messageStatus == nStatus)
{
m_result.push_back(TRUE);
- LogDebug("<<< folder is same");
+ LoggerD("<<< folder is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< folder is different");
+ LoggerD("<<< folder is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_PRIORITY)==0){
- LogDebug("<<< value:[" << value->toString() << "]");
+ LoggerD("<<< value:[" << value->toString() << "]");
std::string lowerString;
lowerString.assign(value->toString());
StrLowChange(lowerString);
if((int)m_priority == MessagePriority::Priority::HIGH)
{
m_result.push_back(TRUE);
- LogDebug("<<< priority is HIGH");
+ LoggerD("<<< priority is HIGH");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< priority is LOW OR NORMAL");
+ LoggerD("<<< priority is LOW OR NORMAL");
}
}
else if(lowerString.compare("false") == 0)
if((int)m_priority == MessagePriority::Priority::NORMAL)
{
m_result.push_back(FALSE);
- LogDebug("<<< priority is HIGH");
+ LoggerD("<<< priority is HIGH");
}
else
{
m_result.push_back(TRUE);
- LogDebug("<<< priority is LOW OR NORMAL");
+ LoggerD("<<< priority is LOW OR NORMAL");
}
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_BODY)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_body:[" << m_body << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_body:[" << m_body << "]");
valueString = m_body;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< body is same");
+ LoggerD("<<< body is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< body is different");
+ LoggerD("<<< body is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_SUBJECT)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_subject:[" << m_subject << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_subject:[" << m_subject << "]");
valueString = m_subject;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< subject is same");
+ LoggerD("<<< subject is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< subject is different");
+ LoggerD("<<< subject is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_FROM)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_from:[" << m_from << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_from:[" << m_from << "]");
valueString = m_from;
if(getMatchFlagResult(value, valueString, matchFlag))
{
m_result.push_back(TRUE);
- LogDebug("<<< from is same");
+ LoggerD("<<< from is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< from is different");
+ LoggerD("<<< from is different");
}
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_TO)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_to.size :[" << m_to.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_to.size :[" << m_to.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_to.size(); i++)
valueString = m_to[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< to compare result is :" << result);
+ LoggerD("<<< to compare result is :" << result);
m_result.push_back(result);
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_CC)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_cc.size :[" << m_cc.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_cc.size :[" << m_cc.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_cc.size(); i++)
valueString = m_cc[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< cc compare result is : " << result);
+ LoggerD("<<< cc compare result is : " << result);
m_result.push_back(result);
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_BCC)==0){
- LogDebug("<<< value:[" << value << "]");
- LogDebug("<<< value->toString():[" << value->toString() << "]");
- LogDebug("<<< m_cc.size :[" << m_bcc.size() << "]");
+ LoggerD("<<< value:[" << value << "]");
+ LoggerD("<<< value->toString():[" << value->toString() << "]");
+ LoggerD("<<< m_cc.size :[" << m_bcc.size() << "]");
bool result = FALSE;
for(unsigned int i=0; i < m_bcc.size(); i++)
valueString = m_bcc[i];
result = result || getMatchFlagResult(value, valueString, matchFlag);
}
- LogDebug("<<< bcc compare result is : " << result);
+ LoggerD("<<< bcc compare result is : " << result);
m_result.push_back(result);
return;
}
if(attrName.compare(StorageChangesMessageFilterValidatorFactory::ATTRIBUTE_IS_RESPONSE_TO)==0){
- LogDebug("<<< value:[" << value << "]");
+ LoggerD("<<< value:[" << value << "]");
int nType = atoi(value->toString().c_str());
if(m_isResponseTo == nType)
{
m_result.push_back(TRUE);
- LogDebug("<<< conversationID is same");
+ LoggerD("<<< conversationID is same");
}
else
{
m_result.push_back(FALSE);
- LogDebug("<<< conversationID is different");
+ LoggerD("<<< conversationID is different");
}
return;
}
- LogDebug(">>>");
+ LoggerD(">>>");
}
int StorageChangesMessageGenerator::convertMessageType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("messaging.email") ==0){
retMessageType = EMAIL;
}else{
- LogError("invalid type:[" << stringType << "]");
+ LoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
int StorageChangesMessageGenerator::convertFolderType(std::string& stringType){
- LogDebug("<<< stringType:[" << stringType << "]");
+ LoggerD("<<< stringType:[" << stringType << "]");
int retMessageType = -1;
}else if(stringType.compare("SENTBOX") ==0){
retMessageType = SENTBOX;
}else{
- LogError("invalid type:[" << stringType << "]");
+ LoggerE("invalid type:[" << stringType << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageType);
+ LoggerD(">>> retMessageType:" << retMessageType);
return retMessageType;
}
int StorageChangesMessageGenerator::convertMessageStatus(std::string& stringStatus){
- LogDebug("<<< stringType:[" << stringStatus << "]");
+ LoggerD("<<< stringType:[" << stringStatus << "]");
int retMessageStatus = -1;
}else if(stringStatus.compare("DRAFT") ==0){
retMessageStatus = MESSAGE_STATUS_DRAFT;
}else{
- LogError("invalid type:[" << stringStatus << "]");
+ LoggerE("invalid type:[" << stringStatus << "]");
return -1;
}
- LogDebug(">>> retMessageType:" << retMessageStatus);
+ LoggerD(">>> retMessageType:" << retMessageStatus);
return retMessageStatus;
}
if (!initialValue->isNullOrUndefined()) {
if( initialValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
startTime = *initialValue->getDateTm();
}
else {
- LogError("initialValue->getType()");
+ LoggerE("initialValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid initialValue Type");
}
}
if (!endValue->isNullOrUndefined()) {
if( endValue->isType(DeviceAPI::Tizen::PrimitiveType_Time) ) {
- LogDebug("<<<initialValue->getType()[PrimitiveType_Time]");
+ LoggerD("<<<initialValue->getType()[PrimitiveType_Time]");
endTime = *endValue->getDateTm();
- LogDebug("<<<valueStr[" << endValueStr <<"]");
+ LoggerD("<<<valueStr[" << endValueStr <<"]");
} else {
- LogError("endValue->getType()");
+ LoggerE("endValue->getType()");
ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException, "invalid endValue Type");
}
}
result = getBetweenRangeClause(startTime, endTime);
if(result == TRUE)
{
- LogDebug("<<< timestamp is in range");
+ LoggerD("<<< timestamp is in range");
m_result.push_back(TRUE);
}else{
- LogDebug("<<< timestamp is out of range");
+ LoggerD("<<< timestamp is out of range");
m_result.push_back(FALSE);
}
}
std::vector<std::string>::iterator iter;
bool result = FALSE;
if(matchFlag == DeviceAPI::Tizen::MATCH_EXACTLY){
- LogDebug("STRING_MATCH_EXACTLY");
+ LoggerD("STRING_MATCH_EXACTLY");
result = result || getMatchExactlyClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_FULLSTRING){
- LogDebug("STRING_MATCH_FULLSTRING");
+ LoggerD("STRING_MATCH_FULLSTRING");
result = result || getMatchFullstringClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_CONTAINS){
- LogDebug("STRING_MATCH_CONTAINS");
+ LoggerD("STRING_MATCH_CONTAINS");
result = result || getMatchContainsClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_STARTSWITH){
- LogDebug("STRING_MATCH_STARTSWITH");
+ LoggerD("STRING_MATCH_STARTSWITH");
result = result || getMatchStartwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_ENDSWITH){
- LogDebug("STRING_MATCH_ENDSWITH");
+ LoggerD("STRING_MATCH_ENDSWITH");
result = result || getMatchEndwithClause(valueString, value);
}else if(matchFlag == DeviceAPI::Tizen::MATCH_EXISTS){
- LogDebug("STRING_MATCH_EXIST");
+ LoggerD("STRING_MATCH_EXIST");
result = result || getMatchExistClause(valueString);
}else{
- LogDebug("[ERROR]invalid match flag : iter:" << *iter);
+ LoggerD("[ERROR]invalid match flag : iter:" << *iter);
}
return result;
}
bool StorageChangesMessageGenerator::getCompareResult()
{
bool result;
- LogDebug("m_result.size() " << m_result.size());
+ LoggerD("m_result.size() " << m_result.size());
result = m_result.back();
m_result.pop_back();
- LogDebug("result = " << result);
+ LoggerD("result = " << result);
return result;
}
#include <dpl/assert.h>
#include <Commons/Exception.h>
#include "SyncNetworkStatus.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace {
const char* DBUS_INTERFACE_NETWORK_STATUS = "User.Email.NetworkStatus";
SyncNetworkStatus::SyncNetworkStatus(const DBus::MessagePtr& message)
{
- LogDebug("enter : " << message->getInterface());
+ LoggerD("enter : " << message->getInterface());
Assert(message->getInterface() == DBUS_INTERFACE_NETWORK_STATUS);
initialize(message);
}
switch (i) {
case 0: m_status = it->getInt();
- LogDebug("status :" << m_status);
+ LoggerD("status :" << m_status);
break;
case 1: m_mailId = it->getInt();
- LogDebug("mail ID :" << m_mailId);
+ LoggerD("mail ID :" << m_mailId);
break;
case 2: m_source = it->getString();
- LogDebug("source :" << m_source);
+ LoggerD("source :" << m_source);
break;
case 3: m_handle = it->getInt();
- LogDebug("handle :" << m_handle);
+ LoggerD("handle :" << m_handle);
break;
case 4: m_errorCode = it->getInt();
- LogDebug("error Code :" << m_errorCode);
+ LoggerD("error Code :" << m_errorCode);
break;
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include "ToRecipient.h"
+#include <Logger.h>
using namespace std;
void ToRecipient::appendToRecipients(const Recipients& value)
{
- LogDebug("enter, recipientCount=" << value.getRecipientSize());
+ LoggerD("enter, recipientCount=" << value.getRecipientSize());
*m_toRecipients += value;
}
* @version 0.1
* @brief
*/
-#include <dpl/log/log.h>
#include "Commons/Exception.h"
#include "IMessage.h"
#include "VirtualMessage.h"
+#include <Logger.h>
using namespace std;
#ifndef LOG_H_
#define LOG_H_
-#define MsgLogError(ARG) LogError("\u001B[0;31m" << ARG << "\u001B[0;39m")
-#define MsgLogWanning(ARG) LogError("\u001B[1;33m" << ARG << "\u001B[0;39m")
+#define MsgLoggerE(ARG) LoggerE("\u001B[0;31m" << ARG << "\u001B[0;39m")
+#define MsgLogWanning(ARG) LoggerE("\u001B[1;33m" << ARG << "\u001B[0;39m")
#endif /* LOG_H_ */
#include "MessageStorageReader.h"
#include "MsgSqliteWrapper.h"
-
-#include <dpl/log/log.h>
+#include <malloc.h>
+#include <Logger.h>
#define MAX_THREAD_ADDR_LEN 40
#define MAX_THREAD_NAME_LEN 195
MSG_CLASS_TYPE_T classType; /**< Message class type. See enum _MSG_CLASS_TYPE_E */
msg_storage_id_t storageId; /**< Indicates where the message is saved. see enum _MSG_FOLDER_TYPE_E*/
msg_struct_list_s *addr_list;
+ GList *addressList;
char replyAddress[MAX_PHONE_NUMBER_LEN+1]; /**< Indicates the reply address. */
char subject[MAX_SUBJECT_LEN+1]; /**< Indicates the message subject. */
time_t displayTime; /**< Indicates the display time related to the specific operation. */
+ time_t scheduledTime; /**< Indicates the time to send scheduled message. */
msg_network_status_t networkStatus; /**< Indicates the network status of the message. */
msg_encode_type_t encodeType; /**< Indicates the string encoding type. */
bool bRead; /**< Indicates whether the message is read or not. */
MSG_STATUS_REPORT_SMS, /**< SMS-STATUS-REPORT */
MSG_SYNCML_CP, /**< SyncML Message CP */
MSG_LBS_SMS, /**< LBS Message */
+ MSG_SOS_SMS, /**< SOS Message */
MSG_REJECT_SMS, /**< Reject Message */
MSG_CONCAT_SIM_SMS, /**< Concatenated Message in SIM */
msg_error_t MessageStorageReader::MsgStoDisconnectDB(){
if (dbHandle.disconnect() != MSG_SUCCESS){
- LogError(">>>[ERROR] DB Disconnect Fail");
+ LoggerE(">>>[ERROR] DB Disconnect Fail");
return MSG_ERR_DB_DISCONNECT;
}
- LogDebug(">>>");
+ LoggerD(">>>");
return MSG_SUCCESS;
}
// MsgStoSearchMessage(const MSG_SEARCH_CONDITION_S *pSearchCon, int offset, int limit, msg_struct_list_s *pMsgList)
int MessageStorageReader::queryMessage(const std::string& whereClause, const std::string& orderLimit, /*out*/msg_struct_list_s *pMsgList){
- LogDebug("<<< whereClause:[" << whereClause << "]");
+ LoggerD("<<< whereClause:[" << whereClause << "]");
// Clear Out Parameter
pMsgList->nCount = 0;
if(orderLimit.length() == 0)
{
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}
else
{
tmpWhereClause.append(orderLimit);
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
oStream << tmpWhereClause;
stringSqlQuery = oStream.str();
- LogDebug("stringSqlQuery:[" << stringSqlQuery << "]");
+ LoggerD("stringSqlQuery:[" << stringSqlQuery << "]");
msg_error_t err = dbHandle.getTable(stringSqlQuery.c_str(), &rowCnt);
if (err == MSG_ERR_DB_NORECORD) {
- LogDebug("MSG_ERR_DB_NORECORD");
+ LoggerD("MSG_ERR_DB_NORECORD");
dbHandle.freeTable();
return MSG_SUCCESS;
} else if (err != MSG_SUCCESS) {
- LogDebug("Get table fail. "<< stringSqlQuery);
+ LoggerD("Get table fail. "<< stringSqlQuery);
dbHandle.freeTable();
pMsgList->nCount = rowCnt;
- LogDebug("pMsgList->nCount ="<< pMsgList->nCount);
+ LoggerD("pMsgList->nCount ="<< pMsgList->nCount);
pMsgList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t) * rowCnt];
pTmp->bBackup = dbHandle.getColumnToInt(index++);
pTmp->priority = dbHandle.getColumnToInt(index++);
pTmp->direction= dbHandle.getColumnToInt(index++);
- index++; // This field is reserved.
+ pTmp->addressList = NULL;
+
+ pTmp->scheduledTime = (time_t)dbHandle.getColumnToInt(index++);
dbHandle.getColumnToString(index++, MAX_SUBJECT_LEN, pTmp->subject);
pTmp->pData = NULL;
index++;
} else {
- LogDebug("pTmp->dataSize = "<< pTmp->dataSize);
+ LoggerD("pTmp->dataSize = "<< pTmp->dataSize);
pTmp->pData = (void *)new char[pTmp->dataSize + 2];
memset(pTmp->pData, 0x00, pTmp->dataSize + 2);
pTmp->addr_list = addr_list;
+ // For GList *addressList
+ msg_struct_s *addrStruct = NULL;
+ MSG_ADDRESS_INFO_S *addrInfo = NULL;
+
+ addrStruct = new msg_struct_s;
+ memset(addrStruct, 0x00, sizeof(msg_struct_s));
+
+ addrStruct->type = MSG_STRUCT_ADDRESS_INFO;
+ addrStruct->data = new MSG_ADDRESS_INFO_S;
+ memset(addrStruct->data, 0x00, sizeof(MSG_ADDRESS_INFO_S));
+
+ addrInfo = (MSG_ADDRESS_INFO_S *)addrStruct->data;
+
+ addrInfo->addressType = address->addressType;
+ addrInfo->recipientType = address->recipientType;
+ addrInfo->contactId = address->contactId;
+ strncpy(addrInfo->addressVal, address->addressVal, MAX_ADDRESS_VAL_LEN);
+ strncpy(addrInfo->displayName, address->displayName, MAX_DISPLAY_NAME_LEN);
+ addrInfo->displayName[MAX_DISPLAY_NAME_LEN] = '\0';
+
+ pTmp->addressList = g_list_append(pTmp->addressList, addrStruct);
+
pTmp->attachCount = dbHandle.getColumnToInt(index++);
dbHandle.getColumnToString(index++, MSG_FILEPATH_LEN_MAX, pTmp->thumbPath);
}
dbHandle.freeTable();
- LogDebug(">>>");
+ LoggerD(">>>");
return MSG_SUCCESS;
}
std::string stringSqlQuery;
std::string tmpWhereClause;
- LogDebug("<<< whereClause:[" << whereClause << "]");
+ LoggerD("<<< whereClause:[" << whereClause << "]");
if(whereClause.length()==0){
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
tmpWhereClause.append("WHERE (B.SMS_CNT > 0 OR B.MMS_CNT > 0) AND A.CONV_ID = B.CONV_ID ");
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}else{
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
tmpWhereClause.append(whereClause);
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}
if(orderLimit.length() == 0)
{
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}
else
{
tmpWhereClause.append(orderLimit);
- LogDebug("<<< tmpWhereClause:[" << tmpWhereClause << "]");
+ LoggerD("<<< tmpWhereClause:[" << tmpWhereClause << "]");
}
oStream << "SELECT B.CONV_ID, B.UNREAD_CNT, B.SMS_CNT, B.MMS_CNT, \
oStream << tmpWhereClause;
stringSqlQuery = oStream.str();
- LogDebug("stringSqlQuery:[" << stringSqlQuery << "]");
+ LoggerD("stringSqlQuery:[" << stringSqlQuery << "]");
msg_error_t err = dbHandle.getTable(stringSqlQuery.c_str(), &rowCnt);
dbHandle.freeTable();
return MSG_SUCCESS;
} else if (err != MSG_SUCCESS) {
- LogDebug("stringSqlQuery:[" << stringSqlQuery << "]");
+ LoggerD("stringSqlQuery:[" << stringSqlQuery << "]");
dbHandle.freeTable();
return err;
}
if (rowCnt < 1) {
- LogDebug("rowCnt is %d"<< rowCnt);
+ LoggerD("rowCnt is %d"<< rowCnt);
dbHandle.freeTable();
return err;
}
pThreadViewList->nCount = rowCnt;
- LogDebug("pThreadViewList->nCount [" << pThreadViewList->nCount << "]");
+ LoggerD("pThreadViewList->nCount [" << pThreadViewList->nCount << "]");
pThreadViewList->msg_struct_info = (msg_struct_t *)new char[sizeof(msg_struct_t)*rowCnt];
//int msg_release_list_struct(msg_struct_list_s *msg_struct_list)
int MessageStorageReader::msg_release_list_struct_private(msg_struct_list_s *msg_struct_list)
{
- LogDebug("enter");
+ LoggerD("enter");
msg_error_t err = MSG_SUCCESS;
if (msg_struct_list == NULL)
msg_struct_list->msg_struct_info = NULL;
// for private only start
-// msg_struct_list->nCount = 0;
-// malloc_trim(0);
-// MsgReleaseMemoryDB();
+ msg_struct_list->nCount = 0;
+ malloc_trim(0);
+ MsgReleaseMemoryDB();
// for private only end
- LogDebug("end");
+ LoggerD("end");
return err;
}
int MessageStorageReader::release_msg_struct_private(msg_struct_t *msg_struct_handle)
{
- LogDebug("enter");
+ LoggerD("enter");
msg_error_t err = MSG_SUCCESS;
err = MSG_ERR_INVALID_PARAMETER;
break;
}
- LogDebug("end");
+ LoggerD("end");
return err;
}
int MessageStorageReader::msg_message_release_private(msg_struct_s **msg_struct)
{
- LogDebug("enter");
+ LoggerD("enter");
MSG_MESSAGE_HIDDEN_S_M *msg = (MSG_MESSAGE_HIDDEN_S_M *)(*msg_struct)->data;
// for private only start
// Free GList *addressList
-// if (msg->addressList) {
-// g_list_free_full(msg->addressList, __msg_message_release_address_struct_private);
-// msg->addressList = NULL;
-// }
+ if (msg->addressList) {
+ g_list_free_full(msg->addressList, __msg_message_release_address_struct_private);
+ msg->addressList = NULL;
+ }
// for private only end
delete msg;
delete (msg_struct_s *)*msg_struct;
*msg_struct = NULL;
- LogDebug("end");
+ LoggerD("end");
return MSG_SUCCESS;
}
void MessageStorageReader::__msg_message_release_address_struct_private(gpointer data)
{
- LogDebug("enter");
+ LoggerD("enter");
if (data == NULL)
return;
addr_struct->data = NULL;
delete addr_struct;
- LogDebug("end");
+ LoggerD("end");
}
#include <string.h>
#include <stdlib.h>
-#include <dpl/log/log.h>
//#include "MsgDebug.h"
#include "MsgSqliteWrapper.h"
+#include <Logger.h>
extern "C"
{
if (ret == SQLITE_OK)
{
- LogDebug("DB Connect Success : [" << handle << "]");
+ LoggerD("DB Connect Success : [" << handle << "]");
return MSG_SUCCESS;
}
else
{
- LogDebug("DB Connect Fail [" << ret << "]");
+ LoggerD("DB Connect Fail [" << ret << "]");
return MSG_ERR_DB_CONNECT;
}
}
else
{
- LogDebug("DB Connect exist : [" << handle << "]");
+ LoggerD("DB Connect exist : [" << handle << "]");
}
return MSG_SUCCESS;
if (ret == SQLITE_OK)
{
handle = NULL;
- LogDebug("DB Disconnect Success");
+ LoggerD("DB Disconnect Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("DB Disconnect Fail [" << ret << "]");
+ LoggerD("DB Disconnect Fail [" << ret << "]");
return MSG_ERR_DB_DISCONNECT;
}
}
}
nResult = getColumnToInt(1);
- LogDebug("Result [" << nResult << "]");
+ LoggerD("Result [" << nResult << "]");
freeTable();
if (ret == SQLITE_OK)
{
- LogDebug("Execute Query Success");
+ LoggerD("Execute Query Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Execute Query Fail [" << ret << "]");
+ LoggerD("Execute Query Fail [" << ret << "]");
return MSG_ERR_DB_EXEC;
}
{
if (*pRowCnt == 0) // when the no record return 'MSG_ERR_DB_NORECORD'
{
- LogDebug("No Query Result");
+ LoggerD("No Query Result");
return MSG_ERR_DB_NORECORD;
}
- LogDebug("Get Table Success");
+ LoggerD("Get Table Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Get Table Fail [" << ret << "]");
+ LoggerD("Get Table Fail [" << ret << "]");
return MSG_ERR_DB_GETTABLE;
}
if ((ret = sqlite3_prepare_v2(handle, pQuery, strlen(pQuery), &stmt, NULL)) == SQLITE_OK)
{
- LogDebug("Prepare Query Success");
+ LoggerD("Prepare Query Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Prepare Query Fail [" << ret << "]");
+ LoggerD("Prepare Query Fail [" << ret << "]");
return MSG_ERR_DB_PREPARE;
}
if (ret == SQLITE_ROW)
{
- LogDebug("MsgStepQuery() SQLITE_ROW");
+ LoggerD("MsgStepQuery() SQLITE_ROW");
return MSG_ERR_DB_ROW;
}
else if (ret == SQLITE_DONE)
{
- LogDebug("MsgStepQuery() SQLITE_DONE");
+ LoggerD("MsgStepQuery() SQLITE_DONE");
return MSG_ERR_DB_DONE;
}
else
{
- LogDebug("MsgStepQuery() Fail [" << ret << "]");
+ LoggerD("MsgStepQuery() Fail [" << ret << "]");
return MSG_ERR_DB_STEP;
}
if (ret == SQLITE_OK)
{
- LogDebug("Begin Transaction Success");
+ LoggerD("Begin Transaction Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Begin Transaction Fail [" << ret << "]");
+ LoggerD("Begin Transaction Fail [" << ret << "]");
return MSG_ERR_DB_EXEC;
}
if (ret == SQLITE_OK)
{
- LogDebug("End Transaction Success");
+ LoggerD("End Transaction Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("End Transaction Fail [" << ret << "]");
+ LoggerD("End Transaction Fail [" << ret << "]");
return MSG_ERR_DB_EXEC;
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return nTemp;
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return '\0';
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return;
}
if (pTableName == NULL || pRowId == NULL)
return MSG_ERR_INVALID_PARAMETER;
- LogDebug("Table Name [" << pTableName << "]");
+ LoggerD("Table Name [" << pTableName << "]");
memset(strQuery, 0x00, sizeof(strQuery));
snprintf(strQuery, sizeof(strQuery), "select max(rowid) from %s", pTableName);
}
else
{
- LogDebug("MsgGetRowId failed");
+ LoggerD("MsgGetRowId failed");
*pRowId = 0;
freeTable();
return MSG_ERR_DB_GETTABLE;
freeTable();
- LogDebug("Row ID [" << *pRowId << "]");
+ LoggerD("Row ID [" << *pRowId << "]");
return MSG_SUCCESS;
}
if (ret == SQLITE_OK)
{
- LogDebug("DB Connect Success");
+ LoggerD("DB Connect Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("DB Connect Fail [" << ret "]");
+ LoggerD("DB Connect Fail [" << ret "]");
return MSG_ERR_DB_CONNECT;
}
}
if (ret == SQLITE_OK)
{
gDBHandle = NULL;
- LogDebug("DB Disconnect Success");
+ LoggerD("DB Disconnect Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("DB Disconnect Fail [" << ret << "]");
+ LoggerD("DB Disconnect Fail [" << ret << "]");
return MSG_ERR_DB_DISCONNECT;
}
}
}
nResult = MsgGetColumnToInt(1);
- LogDebug("Result [" << nResult << "]");
+ LoggerD("Result [" << nResult << "]");
MsgFreeTable();
if (ret == SQLITE_OK)
{
- LogDebug("Execute Query Success");
+ LoggerD("Execute Query Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Execute Query Fail [" << ret << "]");
+ LoggerD("Execute Query Fail [" << ret << "]");
return MSG_ERR_DB_EXEC;
}
{
if (*pRowCnt == 0) // when the no record return 'MSG_ERR_DB_NORECORD'
{
- LogDebug("No Query Result");
+ LoggerD("No Query Result");
return MSG_ERR_DB_NORECORD;
}
- LogDebug("Get Table Success");
+ LoggerD("Get Table Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Get Table Fail [" << ret << "]");
+ LoggerD("Get Table Fail [" << ret << "]");
return MSG_ERR_DB_GETTABLE;
}
if ((ret = sqlite3_prepare_v2(gDBHandle, pQuery, strlen(pQuery), &gStmt, NULL)) == SQLITE_OK)
{
- LogDebug("Prepare Query Success");
+ LoggerD("Prepare Query Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Prepare Query Fail [" << ret "]");
+ LoggerD("Prepare Query Fail [" << ret "]");
return MSG_ERR_DB_PREPARE;
}
if (ret == SQLITE_ROW)
{
- LogDebug("MsgStepQuery() SQLITE_ROW");
+ LoggerD("MsgStepQuery() SQLITE_ROW");
return MSG_ERR_DB_ROW;
}
else if (ret == SQLITE_DONE)
{
- LogDebug("MsgStepQuery() SQLITE_DONE");
+ LoggerD("MsgStepQuery() SQLITE_DONE");
return MSG_ERR_DB_DONE;
}
else
{
- LogDebug("MsgStepQuery() Fail [" << ret << "]");
+ LoggerD("MsgStepQuery() Fail [" << ret << "]");
return MSG_ERR_DB_STEP;
}
if (ret == SQLITE_OK)
{
- LogDebug("Begin Transaction Success");
+ LoggerD("Begin Transaction Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("Begin Transaction Fail [" << ret "]");
+ LoggerD("Begin Transaction Fail [" << ret "]");
return MSG_ERR_DB_EXEC;
}
if (ret == SQLITE_OK)
{
- LogDebug("End Transaction Success");
+ LoggerD("End Transaction Success");
return MSG_SUCCESS;
}
else
{
- LogDebug("End Transaction Fail [" << ret << "]");
+ LoggerD("End Transaction Fail [" << ret << "]");
return MSG_ERR_DB_EXEC;
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return nTemp;
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return NULL;
}
if (pTemp == NULL)
{
- LogDebug("NULL");
+ LoggerD("NULL");
return;
}
if (pTableName == NULL || pRowId == NULL)
return MSG_ERR_INVALID_PARAMETER;
- LogDebug("Table Name [" << pTableName << "]");
+ LoggerD("Table Name [" << pTableName << "]");
memset(strQuery, 0x00, sizeof(strQuery));
snprintf(strQuery, sizeof(strQuery), "select max(rowid) from %s", pTableName);
}
else
{
- LogDebug("MsgGetRowId failed");
+ LoggerD("MsgGetRowId failed");
*pRowId = 0;
MsgFreeTable();
return MSG_ERR_DB_GETTABLE;
MsgFreeTable();
- LogDebug("Row ID [" << *pRowId << "]");
+ LoggerD("Row ID [" << *pRowId << "]");
return MSG_SUCCESS;
}
freeSize = sqlite3_release_memory(-1);
- LogDebug("freed memory size (bytes) : [" << freeSize << "]");
+ LoggerD("freed memory size (bytes) : [" << freeSize << "]");
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include "JSMessagingServiceManager.h"
#include "MessageListenerManager.h"
#include <GlobalContextManager.h>
+#include <Logger.h>
#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
using namespace WrtDeviceApis::Commons;
void on_widget_start_callback(int widgetId) {
- LogDebug("[Tizen\\MessagingServiceManager] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\MessagingServiceManager] on_widget_start_callback ("<<widgetId<<")");
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch(Commons::Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId) {
- LogDebug("[Tizen\\MessagingServiceManager] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\MessagingServiceManager] on_widget_stop_callback ("<<widgetId<<")");
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch(Commons::Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_load_callback (" << context << ")");
DeviceAPI::Common::GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
DeviceAPI::Common::GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
DeviceAPI::Messaging::MessageAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
// 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);
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <JSTizenExceptionFactory.h>
#include "NFCFactory.h"
#include "plugin_config.h"
#include "NFCDefaultAdapter.h"
+#include <Logger.h>
using namespace std;
using namespace DPL;
void JSNFCManager::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
NFCManagerPrivObject* priv = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(object));
if (!priv) {
Try {
priv = new NFCManagerPrivObject(context);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
} 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());
}
}
}
void JSNFCManager::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
NFCManagerPrivObject *priv = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(object));
if (priv) {
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting NFC Manager object");
+ LoggerD("Deleting NFC Manager object");
delete priv;
}
}
JSValueRef JSNFCManager::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
Converter convert(context);
return convert.toJSValueRef(NFC_TNF_UNCHANGED);
}
} 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 JSNFCManager::getDefaultAdapter (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_COMMON_FUNCS);
NFCManagerPrivObject* privateObject = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
ThrowMsg(UnsupportedException, "private object is null");
}
return JSNFCAdapter::createJSObject(GlobalContextManager::getInstance()->getGlobalContext(context));
} Catch (UnsupportedException) {
- LogError("UnsupportedException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnsupportedException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, "Not Supported");
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
+ LoggerE("InvalidArgumentException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} 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 JSNFCManager::setExclusiveMode (JSContextRef context, JSObjectRef object,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_COMMON_FUNCS);
ArgumentValidator validator(context, argumentCount, arguments);
// mode
bool mode = validator.toBool(0);
- LogDebug("mode : " << mode);
+ LoggerD("mode : " << mode);
NFCManagerPrivObject* privateObject = static_cast<NFCManagerPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
ThrowMsg(UnsupportedException, "private object is null");
}
NFCDefaultAdapterSingleton::Instance().setExclusiveMode(mode);
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: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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");
}
* limitations under the License.
*/
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "EventTagAction.h"
#include "NFCAsyncCallbackManager.h"
#include "plugin_config.h"
-
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSClassRef JSNFCTag::m_jsClassRef = JSClassCreate(JSNFCTag::getClassInfo());
JSObjectRef JSNFCTag::createJSObject(JSContextRef context, void *tagHandle) {
- LogDebug("entered");
+ LoggerD("entered");
INFCTagPtr nfcTag = NFCFactory::getInstance().createNFCTagObject(tagHandle);
void JSNFCTag::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
NFCTagPrivObject *priv = static_cast<NFCTagPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting NFCTag object");
+ LoggerD("Deleting NFCTag object");
delete priv;
}
JSValueRef JSNFCTag::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NFCTagPrivObject* privateObject = static_cast<NFCTagPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
INFCTagPtr nfcTag(privateObject->getObject());
NFCConverter convert(context);
- LogDebug("propertyName : " << convert.toString(propertyName));
+ LoggerD("propertyName : " << convert.toString(propertyName));
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTAG_TYPE)) {
return convert.toJSValueRef(convert.toNfcTagTypeString(nfcTag->getTagType()));
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTAG_ISSUPPORTEDNDEF)) {
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTAG_NDEFSIZE)) {
return convert.toJSValueRefLong(nfcTag->getNdefSize());
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTAG_PROPERTIES)) {
- LogDebug("get Properties");
+ LoggerD("get Properties");
return convert.toJSValueRef(nfcTag->getProperties());
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NFCTAG_ISCONNECTED)) {
return convert.toJSValueRef(nfcTag->isConnected());
}
} 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 (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_TAG_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTagPrivObject* privateObject = static_cast<NFCTagPrivObject*>(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("readNDEF : ConversionException");
+ LoggerE("readNDEF : ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (UnsupportedException) {
- LogError("UnsupportedException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnsupportedException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, "Not Support NDEF");
} Catch (InvalidArgumentException) {
- LogError("readNDEF InvalidArgumentException");
+ LoggerE("readNDEF 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"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_TAG_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTagPrivObject* privateObject = static_cast<NFCTagPrivObject*>(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("writeNDEF : ConversionException");
+ LoggerE("writeNDEF : ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (UnsupportedException) {
- LogError("UnsupportedException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnsupportedException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR, "Not Support NDEF");
} Catch (InvalidArgumentException) {
- LogError("writeNDEF InvalidArgumentException");
+ LoggerE("writeNDEF 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"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = NFC_CHECK_ACCESS(NFC_FUNCTION_API_TAG_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
NFCTagPrivObject* privateObject = static_cast<NFCTagPrivObject*>(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("transceive : ConversionException");
+ LoggerE("transceive : ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("transceive InvalidArgumentException");
+ LoggerE("transceive 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"));
// 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"));
// limitations under the License.
//
-
#include "JSNdefMessage.h"
#include "JSNdefRecord.h"
#include "JSNdefRecordText.h"
#include "JSNdefRecordMedia.h"
#include "NFCConverter.h"
#include <GlobalContextManager.h>
-#include <dpl/log/log.h>
#include <ArgumentValidator.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "NFCFactory.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSClassRef JSNdefMessage::m_jsClassRef = JSClassCreate(JSNdefMessage::getClassInfo());
JSObjectRef JSNdefMessage::createJSObject(JSContextRef context, void *messageHandle) {
- LogDebug("entered");
+ LoggerD("entered");
INdefMessagePtr ndefMessage = NFCFactory::getInstance().createNDEFMessageObject(messageHandle);
return createJSObject(context, ndefMessage);
}
JSObjectRef JSNdefMessage::createJSObject(JSContextRef context) {
- LogDebug("entered");
+ LoggerD("entered");
INdefMessagePtr ndefMessage = NFCFactory::getInstance().createNDEFMessageObject();
return createJSObject(context, ndefMessage);
}
JSObjectRef JSNdefMessage::createJSObject(JSContextRef context, INdefMessagePtr message) {
- LogDebug("entered");
+ LoggerD("entered");
NFCConverter convert(context);
JSValueRef records = convert.toJSNdefRecordArray(message);
}
JSObjectRef JSNdefMessage::createJSObject(JSContextRef context, std::vector<void *> ndefRcords) {
- LogDebug("entered");
+ LoggerD("entered");
INdefMessagePtr ndefMessage = NFCFactory::getInstance().createNDEFMessageObject(ndefRcords);
return createJSObject(context, ndefMessage);
}
JSObjectRef JSNdefMessage::createJSObject(JSContextRef context, std::vector<unsigned char> rawdata) {
- LogDebug("entered");
+ LoggerD("entered");
INdefMessagePtr ndefMessage = NFCFactory::getInstance().createNDEFMessageObject(rawdata);
return createJSObject(context, ndefMessage);
}
void JSNdefMessage::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
}
void JSNdefMessage::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
NdefMessagePrivObject *priv = static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
if (priv) {
INdefMessagePtr ndefMessage(priv->getObject());
- LogDebug("getRecordesPtr:"<<ndefMessage->getRecordesPtr());
+ LoggerD("getRecordesPtr:"<<ndefMessage->getRecordesPtr());
JSValueUnprotect(priv->getContext(), (JSValueRef)(ndefMessage->getRecordesPtr()));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting NdefMessage object");
+ LoggerD("Deleting NdefMessage object");
delete priv;
}
}
JSObjectRef JSNdefMessage::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try {
ArgumentValidator validator(ctx, argumentCount, arguments);
for (std::size_t i = 0; i < JSGetArrayLength(ctx, objArg); ++i) {
JSValueRef element = JSGetArrayElement(ctx, objArg, i);
bool bNdefRecord = convert.isNdefRecord(element);
- LogDebug("isNdefRecord : " << bNdefRecord);
+ LoggerD("isNdefRecord : " << bNdefRecord);
if (bNdefRecord)
isRecordArray = true;
else
*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 JSNdefMessage::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NdefMessagePrivObject* privateObject = static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
INdefMessagePtr ndefMessage(privateObject->getObject());
NFCConverter convert(context);
- LogDebug("propertyName : " << convert.toString(propertyName));
+ LoggerD("propertyName : " << convert.toString(propertyName));
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFMESSAGE_RECORDCOUNT)) {
std::vector<void *> records = convert.toVectorOfRecordHandles(static_cast<JSValueRef>(ndefMessage->getRecordesPtr()));
return convert.toJSValueRefLong(records.size());
return static_cast<JSValueRef>(ndefMessage->getRecordesPtr());
}
} 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);
}
bool JSNdefMessage::setProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFMESSAGE_RECORDS)) {
NdefMessagePrivObject* privateObject = static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
if (JSValueIsNull(context, value) || JSValueIsUndefined(context, value) || !JSIsArrayValue(context, value)) {
- LogError("value is invald.");
+ LoggerE("value is invald.");
ThrowMsg(ConversionException, "value is invald.");
}
INdefMessagePtr ndefMessage(privateObject->getObject());
return true;
}
} 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 (InvalidArgumentException) {
- LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
+ LoggerE("InvalidArgumentException: " << _rethrown_exception.GetMessage());
} Catch (PlatformException) {
- LogError("PlatformException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException: " << _rethrown_exception.GetMessage());
} 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());
}
return false;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
Try {
NdefMessagePrivObject* privateObject = static_cast<NdefMessagePrivObject*>(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");
}
INdefMessagePtr newMessage = NFCFactory::getInstance().createNDEFMessageObject(records);
return convert.toJSValueRef(newMessage->toByte());
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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");
#include <memory>
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenExceptionFactory.h>
#include "JSNdefRecord.h"
#include "plugin_config.h"
#include "NFCConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
JSClassRef JSNdefRecord::m_jsClassRef = JSClassCreate(JSNdefRecord::getClassInfo());
JSObjectRef JSNdefRecord::createJSObject(JSContextRef context, const NdefRecordData &ndefRecordData) {
- LogDebug("Entered");
+ LoggerD("Entered");
return createJSObject(context, ndefRecordData.properties, ndefRecordData.payload);
}
}
void JSNdefRecord::initialize(JSContextRef context, JSObjectRef object) {
- LogDebug("entered");
+ LoggerD("entered");
}
void JSNdefRecord::finalize(JSObjectRef object) {
- LogDebug("Entered");
+ LoggerD("Entered");
NdefRecordPrivObject* priv = static_cast<NdefRecordPrivObject*>(JSObjectGetPrivate(object));
if (priv) {
INdefRecordPtr ndefRecord = priv->getObject();
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting ndefrecord object");
+ LoggerD("Deleting ndefrecord object");
delete priv;
} else
- LogDebug("priv null");
+ LoggerD("priv null");
}
JSObjectRef JSNdefRecord::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 JSNdefRecord::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NFCConverter convert(context);
}
INdefRecordPtr ndefRecord = priv->getObject();
- LogDebug("propertyName : " << convert.toString(propertyName));
+ LoggerD("propertyName : " << convert.toString(propertyName));
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_TNF))
return convert.toJSValueRef(ndefRecord->getTNF());
else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_TYPE))
else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_PAYLOAD))
return convert.toJSValueRef(ndefRecord->getPayload());
} 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("PlatformExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformExceptionException: " << _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);
}
// limitations under the License.
//
-
#include <memory>
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenExceptionFactory.h>
#include <PlatformException.h>
#include "NFCFactory.h"
-
#include "JSNdefRecordMedia.h"
#include "NFCConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
}
void JSNdefRecordMedia::initialize(JSContextRef context, JSObjectRef object) {
- LogDebug("Entered");
+ LoggerD("Entered");
}
void JSNdefRecordMedia::finalize(JSObjectRef object) {
- LogDebug("Entered");
+ LoggerD("Entered");
}
JSObjectRef JSNdefRecordMedia::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 JSNdefRecordMedia::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NFCConverter convert(context);
if (ndefRecord->getMimeType(&mimeType)) {
std::string result(mimeType);
free(mimeType);
- LogDebug("mimeType : " << result);
+ LoggerD("mimeType : " << result);
return convert.toJSValueRef(result);
}
- LogDebug("This record is not MEDIA Type");
+ LoggerD("This record is not MEDIA 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("PlatformExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformExceptionException: " << _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);
}
#include <memory>
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSTizenExceptionFactory.h>
#include <PlatformException.h>
#include "NFCFactory.h"
-
#include "JSNdefRecordText.h"
#include "NFCConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
}
void JSNdefRecordText::initialize(JSContextRef context, JSObjectRef object) {
- LogDebug("entered");
+ LoggerD("entered");
}
void JSNdefRecordText::finalize(JSObjectRef object) {
- LogDebug("Entered");
+ LoggerD("Entered");
}
JSObjectRef JSNdefRecordText::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 JSNdefRecordText::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
NFCConverter convert(context);
if (ndefRecord->getText(&text)) {
std::string result(text);
free(text);
- LogDebug("text : " << result);
+ LoggerD("text : " << result);
return convert.toJSValueRef(result);
}
- LogDebug("This record is not Text Type");
+ LoggerD("This record is not Text Type");
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_TEXT_LANGCODE)) {
char * langCode = NULL;
if (ndefRecord->getLangCode(&langCode)) {
std::string result(langCode);
free(langCode);
- LogDebug("langCode : " << result);
+ LoggerD("langCode : " << result);
return convert.toJSValueRef(result);
}
- LogDebug("This record is not Text Type");
+ LoggerD("This record is not Text Type");
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_NDEFRECORD_TEXT_ENCODING)) {
nfcTextEncodeUTF encodeType = NFC_TEXT_ENCODE_UTF_16;
if (ndefRecord->getEncodeType(&encodeType)) {
- LogDebug("encodeType : " << encodeType);
+ LoggerD("encodeType : " << encodeType);
return convert.toJSValueRef(convert.toNfcTextEncodeUTFString(encodeType));
}
- LogDebug("This record is not Text Type");
+ LoggerD("This record is not Text 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("PlatformExceptionException: " << _rethrown_exception.GetMessage());
+ LoggerE("PlatformExceptionException: " << _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);
}
#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);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <dpl/scoped_ptr.h>
#include <Commons/Exception.h>
#include <JSTizenException.h>
#include "NFCDefaultAdapter.h"
#include "NFCAdapter.h"
#include "NFCUtil.h"
+#include <Logger.h>
using namespace DPL;
namespace DeviceAPI {
namespace NFC {
NFCAdapter::NFCAdapter() {
- LogDebug("NFCAdapter");
+ LoggerD("NFCAdapter");
if (!NFCDefaultAdapterSingleton::Instance().isSupported())
ThrowMsg(UnsupportedException, "Not Support");
}
NFCAdapter::~NFCAdapter() {
- LogDebug("Enter");
+ LoggerD("Enter");
unsetTagListener();
unsetPeerListener();
m_EventNFCChangedSetPoweredPtr.Reset();
}
int NFCAdapter::setTagListener(const EventNFCChangedEmitterPtr& emitter, const TagFilterPtr& filter) {
- LogDebug(" NFCAdapter::setTagListener Entered");
+ LoggerD(" NFCAdapter::setTagListener Entered");
if (m_NFCTagEmitterPtr.Get() != NULL)
ThrowMsg(PlatformException, "It has already set Tag Listener");
}
int NFCAdapter::setPeerListener(const EventNFCChangedEmitterPtr& emitter) {
- LogDebug(" NFCAdapter::setPeerListener Entered");
+ LoggerD(" NFCAdapter::setPeerListener Entered");
if (m_NFCTargetEmitterPtr.Get() != NULL)
ThrowMsg(PlatformException, "It has already set Peer Listener");
return NFCDefaultAdapterSingleton::Instance().setPeerListener(this);
}
void NFCAdapter::unsetTagListener() {
- LogDebug(" NFCAdapter::unsetTagListener Entered");
+ LoggerD(" NFCAdapter::unsetTagListener Entered");
m_NFCTagEmitterPtr.Reset();
m_tagFilter.Reset();
NFCDefaultAdapterSingleton::Instance().unsetTagListener(this);
}
void NFCAdapter::unsetPeerListener() {
- LogDebug(" NFCAdapter::unsetPeerListener Entered");
+ LoggerD(" NFCAdapter::unsetPeerListener Entered");
m_NFCTargetEmitterPtr.Reset();
NFCDefaultAdapterSingleton::Instance().unsetPeerListener(this);
}
nfc_tag_type_e tagType;
if (nfc_tag_get_type((nfc_tag_h)props, &tagType) == NFC_ERROR_NONE) {
- LogDebug("NFCAdapter::NFCTagHasDetected Tag real type : " << tagType);
+ LoggerD("NFCAdapter::NFCTagHasDetected Tag real type : " << tagType);
int cnt;
for (cnt = 0; cnt < m_tagFilter->getFilterSize(); cnt++) {
NFCUtil util;
break;
}
if (cnt == m_tagFilter->getFilterSize()) {
- LogDebug("Filter doesn't have this tag type ");
+ LoggerD("Filter doesn't have this tag type ");
return;
}
} else {
- LogDebug("It can't get real nfc tag type");
+ LoggerD("It can't get real nfc tag type");
int cnt;
for (cnt = 0; cnt < m_tagFilter->getFilterSize(); cnt++) {
if (NFC_TAGTYPE_GENERIC_PICC == m_tagFilter->getFilterValue(cnt))
}
if (cnt == m_tagFilter->getFilterSize()) {
- LogDebug("Filter doesn't have this tag type ");
+ LoggerD("Filter doesn't have this tag type ");
return;
}
event->setNFCProperties(props);
event->setNFCType(NFC_TAG_TYPE);
- LogDebug("emit event with nfc tag info");
+ LoggerD("emit event with nfc tag info");
m_NFCTagEmitterPtr->emit(event);
}
}
event->setNFCStatus(NFC_ATTATCHED);
event->setNFCProperties(props);
event->setNFCType(NFC_TARGET_TYPE);
- LogDebug("emit event with nfc target info");
+ LoggerD("emit event with nfc target info");
m_NFCTargetEmitterPtr->emit(event);
}
}
}
void NFCAdapter::setPowered(const EventNFCChangedSetPoweredPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
EventRequestReceiver<EventNFCChangedSetPowered>::PostRequest(event);
}
NFCDefaultAdapterSingleton::Instance().setPowered(event->getState(), this);
return;
} Catch(PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
event->setResult(false);
event->setError(DeviceAPI::Common::JSTizenException::SERVICE_NOT_AVAILABLE);
event->setErrorMessage("Progressing Identical Operation");
EventRequestReceiver<EventNFCChangedSetPowered>::ManualAnswer(event);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
setPoweredManualAnswer(NFC_ERROR_OPERATION_FAILED);
}
}
// limitations under the License.
//
-
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSNdefRecordURI.h"
#include "JSNdefRecordMedia.h"
#include "JSNdefMessage.h"
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::CommonsJavaScript;
NFCConverter::NFCConverter(JSContextRef context) : Converter(context)
{
- LogDebug("entered");
+ LoggerD("entered");
static bool init = initializeAllowedProperties();
(void) init;
}
NFCConverter::~NFCConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
TagFilterPtr NFCConverter::toNFCTagFilter(JSValueRef jsValue)
{
- LogDebug("entered");
+ LoggerD("entered");
if (JSValueIsNull(m_context, jsValue) ||
JSValueIsUndefined(m_context, jsValue)) {
return TagFilterPtr(); //empty filter
if (!JSValueIsUndefined(m_context, jsValue)) {
vector<std::string> filter_values(toVectorOfStrings(jsValue));
- LogDebug("NFCConverter, start setting filter values, tag_types.size() : " << filter_values.size());
+ LoggerD("NFCConverter, start setting filter values, tag_types.size() : " << filter_values.size());
for (unsigned int i=0; i<filter_values.size(); i++) {
nfcTagType filterValue = toNfcTagType(filter_values.at(i));
filter->addTagTypeValue(filterValue);
- LogDebug("NFCConverter, tag_types.at(i): " << filter_values.at(i));
+ LoggerD("NFCConverter, tag_types.at(i): " << filter_values.at(i));
}
}
- LogDebug("NFCConverter, filter size == " << filter->getFilterSize());
+ LoggerD("NFCConverter, filter size == " << filter->getFilterSize());
return filter;
}
nfcTNF NFCConverter::toNfcTNF(const JSValueRef& arg) {
long value = toLong(arg);
- LogDebug("toNfcTNF, value == " << value);
+ LoggerD("toNfcTNF, value == " << value);
if ((value < NFC_TNF_EMPTY) || (value > NFC_TNF_UNCHANGED)) {
ThrowMsg(InvalidArgumentException, "It is not a correct tnf value");
bool NFCConverter::initializeAllowedProperties()
{
- LogDebug("entered");
+ LoggerD("entered");
//NFC Filter properties
m_allowedTagFilterProperties.push_back(NFC_FILTER_ATTRIBUTE_TAG_TYPES);
return true;
}
bool NFCConverter::isNdefRecord(const JSValueRef& arg) {
- LogDebug("Entered");
+ LoggerD("Entered");
if (JSValueIsNull(m_context, arg) || JSValueIsUndefined(m_context, arg)) {
- LogDebug("Object is Null or Undefied");
+ LoggerD("Object is Null or Undefied");
return false;
}
if (JSValueIsObjectOfClass(m_context, arg, JSNdefRecord::getClassRef())
JSObjectRef obj = toJSObjectRef(arg);
if (!obj) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Object is null");
}
}
void *NFCConverter::getRecordHandle(const JSValueRef& arg) {
- LogDebug("Entered");
+ LoggerD("Entered");
if (!isNdefRecord(arg)) {
ThrowMsg(Commons::ConversionException,
"Message is JS null or JS undefined.");
JSObjectRef obj = toJSObjectRef(arg);
if (!obj) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Object is null");
}
NdefRecordPrivObject* privateObject = static_cast<NdefRecordPrivObject*>(JSObjectGetPrivate(obj));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not set");
}
JSObjectRef obj = toJSObjectRef(arg);
if (!obj) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Object is null");
}
return copiedMessage(obj);
void *NFCConverter::copiedMessage(const JSObjectRef& obj) {
NdefMessagePrivObject* privateObject = static_cast<NdefMessagePrivObject*>(JSObjectGetPrivate(obj));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object is not set");
}
}
NFCChangedCallback NFCConverter::toNFCChangedCallback(const JSValueRef& arg) {
- LogDebug("Entered");
+ LoggerD("Entered");
JSObjectRef object = toJSObjectRef(arg);
NFCChangedCallback result;
// limitations under the License.
//
-#include <dpl/log/log.h>
+#include <dpl/singleton.h>
#include <dpl/scoped_ptr.h>
#include <dpl/singleton_impl.h>
#include <Commons/Exception.h>
#include <nfc.h>
#include "NFCDefaultAdapter.h"
#include "NFCUtil.h"
-
+#include <Logger.h>
using namespace DPL;
IMPLEMENT_SINGLETON(DeviceAPI::NFC::NFCDefaultAdapter)
namespace
{
static void TagDetectedCallback(nfc_discovered_type_e type, nfc_tag_h tag, void *data) {
- LogDebug("Callback TagDetectedCallback.");
+ LoggerD("Callback TagDetectedCallback.");
if (data) {
if (NFC_DISCOVERED_TYPE_ATTACHED == type) {
(static_cast<NFCDefaultAdapter*>(data))->NFCTagHasDetected(NULL);
}
} else {
- LogError("Callback private data is NULL.");
+ LoggerE("Callback private data is NULL.");
}
}
static void TargetDetectedCallback(nfc_discovered_type_e type, nfc_p2p_target_h target, void *data) {
- LogDebug("Callback TargetDetectedCallback.");
+ LoggerD("Callback TargetDetectedCallback.");
if (data) {
if (NFC_DISCOVERED_TYPE_ATTACHED == type) {
(static_cast<NFCDefaultAdapter*>(data))->NFCTargetHasDetected(NULL);
}
} else {
- LogError("Callback private data is NULL.");
+ LoggerE("Callback private data is NULL.");
}
}
static void NFCInitializeCompletedCallback(nfc_error_e result, void *user_data) {
- LogDebug("Callback NFCInitializeCompletedCallback. result : " << (int)result);
+ LoggerD("Callback NFCInitializeCompletedCallback. result : " << (int)result);
if (user_data && (result == NFC_ERROR_NONE))
(static_cast<NFCDefaultAdapter*>(user_data))->getCurrentNFC();
}
static void NFCSetActivationCompletedCallback(nfc_error_e error, void *user_data) {
- LogDebug("Callback NFCSetActivationCompletedCallback.");
+ LoggerD("Callback NFCSetActivationCompletedCallback.");
NFCDefaultAdapterSingleton::Instance().setPoweredManualAnswer(error);
}
NFCDefaultAdapter::NFCDefaultAdapter()
:m_initialized(false) {
- LogDebug("NFC Enter");
+ LoggerD("NFC Enter");
m_NFCTagListeners.clear();
m_NFCTargetListeners.clear();
}
NFCDefaultAdapter::~NFCDefaultAdapter() {
- LogDebug("Enter");
+ LoggerD("Enter");
deinitialze();
}
void NFCDefaultAdapter::setExclusiveMode(bool mode) {
- LogDebug("Enter");
- LogDebug("initilized:" << m_initialized);
+ LoggerD("Enter");
+ LoggerD("initilized:" << m_initialized);
if (!m_initialized) {
if (nfc_manager_initialize_sync() != NFC_ERROR_NONE) {
*/
}
bool bEnabled = !mode;
- LogDebug("system handeler enable?" << bEnabled);
+ LoggerD("system handeler enable?" << bEnabled);
// If exclusive mode is true, system handler has to be disabled.
if (nfc_manager_set_system_handler_enable(bEnabled) != NFC_ERROR_NONE)
ThrowMsg(UnknownException, "Failed to set exclusive mode.");
- LogDebug("End");
+ LoggerD("End");
}
bool NFCDefaultAdapter::isSupported() {
}
void NFCDefaultAdapter::deinitialze() {
- LogDebug("Enter");
+ LoggerD("Enter");
int result = -1;
m_NFCTagListeners.clear();
{
result = nfc_manager_deinitialize ();
if (result !=NFC_ERROR_NONE) {
- LogInfo("failed to deinitialize nfc");
+ LoggerI("failed to deinitialize nfc");
}
}
m_initialized = false;
- LogDebug("destroy nfc");
+ LoggerD("destroy nfc");
}
void NFCDefaultAdapter::unsetExclusiveMode() {
- LogDebug("entered");
+ LoggerD("entered");
if (m_initialized)
if (nfc_manager_set_system_handler_enable(true) != NFC_ERROR_NONE)
- LogDebug("failed to unset exclusive mode");
+ LoggerD("failed to unset exclusive mode");
}
int NFCDefaultAdapter::setTagListener(NFCAdapter * adapter) {
- LogDebug(" NFCDefaultAdapter::setTagListener Entered");
+ LoggerD(" NFCDefaultAdapter::setTagListener Entered");
int result = -1;
m_NFCTagListeners.push_back(adapter);
util.throwNFCException(result, "failed to set callback of nfc_manager_set_tag_discovered_cb");
}
- LogInfo("NFCDefaultAdapter::setTagListener : result << " << result);
+ LoggerI("NFCDefaultAdapter::setTagListener : result << " << result);
return result;
}
int NFCDefaultAdapter::setPeerListener(NFCAdapter *adapter) {
- LogDebug(" NFCDefaultAdapter::setPeerListener Entered");
+ LoggerD(" NFCDefaultAdapter::setPeerListener Entered");
int result = -1;
m_NFCTargetListeners.push_back(adapter);
Util.throwNFCException(result, "failed to set callback of nfc_manager_set_p2p_target_discovered_cb");
}
- LogInfo("NFCDefaultAdapter::setPeerListener : result << " << result);
+ LoggerI("NFCDefaultAdapter::setPeerListener : result << " << result);
return result;
}
void NFCDefaultAdapter::unsetTagListener(NFCAdapter * adapter) {
- LogDebug(" NFCDefaultAdapter::unsetTagListener Entered");
+ LoggerD(" NFCDefaultAdapter::unsetTagListener Entered");
if (!m_initialized) {
m_NFCTagListeners.clear();
for (it = m_NFCTagListeners.begin(); it != m_NFCTagListeners.end(); ++it) {
if (*it == adapter) {
m_NFCTagListeners.erase(it);
- LogDebug("emitter is removed. (" << m_NFCTagListeners.size() << ")");
+ LoggerD("emitter is removed. (" << m_NFCTagListeners.size() << ")");
break;
}
}
}
void NFCDefaultAdapter::unsetPeerListener(NFCAdapter * adapter) {
- LogDebug(" NFCDefaultAdapter::unsetPeerListener Entered");
+ LoggerD(" NFCDefaultAdapter::unsetPeerListener Entered");
if (!m_initialized) {
m_NFCTagListeners.clear();
for (it = m_NFCTargetListeners.begin(); it != m_NFCTargetListeners.end(); ++it) {
if (*it == adapter) {
m_NFCTargetListeners.erase(it);
- LogDebug("emitter is removed. (" << m_NFCTargetListeners.size() << ")");
+ LoggerD("emitter is removed. (" << m_NFCTargetListeners.size() << ")");
break;
}
}
void NFCDefaultAdapter::NFCTagHasDetected(void *props)
{
- LogDebug("NFCDefaultAdapter::NFCTagHasDetected Enter type");
+ LoggerD("NFCDefaultAdapter::NFCTagHasDetected Enter type");
std::vector<NFCAdapter *>::iterator it;
for (it = m_NFCTagListeners.begin(); it != m_NFCTagListeners.end(); ++it) {
}
void NFCDefaultAdapter::getCurrentNFC() {
- LogDebug("Enter");
+ LoggerD("Enter");
if (!m_initialized) {
- LogError("No Initialized");
+ LoggerE("No Initialized");
return;
}
}
int NFCDefaultAdapter::initialize() {
- LogDebug("NFCDefaultAdapter::initialize Entered");
+ LoggerD("NFCDefaultAdapter::initialize Entered");
int result = -1;
//nfc_manager_deinitialize();
result = nfc_manager_initialize(NFCInitializeCompletedCallback, this);
if (result != NFC_ERROR_NONE) {
- LogError("Could not initialize NFC.");
+ LoggerE("Could not initialize NFC.");
m_initialized = false;
} else {
m_initialized = true;
}
void *NFCDefaultAdapter::getCachedMessage() {
- LogDebug("Entered");
+ LoggerD("Entered");
nfc_ndef_message_h messageHandle = NULL;
int result = nfc_manager_get_cached_message(&messageHandle);
if ((result == NFC_ERROR_INVALID_NDEF_MESSAGE) || (result == NFC_ERROR_NO_NDEF_MESSAGE)) {
}
void NFCDefaultAdapter::setPowered(const bool state, NFCAdapter * poweredAdapter) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
if (m_poweredAdapter != NULL) {
ThrowMsg(PlatformException, "Progressing Identical Operation");
m_poweredAdapter = NULL;
}
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
poweredAdapter->setPoweredManualAnswer(NFC_ERROR_OPERATION_FAILED);
m_poweredAdapter = NULL;
}
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSNFCAdapter.h"
#include "JSNFCTarget.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
virtual void cancelListener()
{
- LogDebug("context : " << m_context);
- LogDebug("object : " << m_object);
+ LoggerD("context : " << m_context);
+ LoggerD("object : " << m_object);
switch(m_watchId) {
case ID_NFCPEER_RECEIVENDEF_LISTENER:
{
NFCTargetPrivObject* privateObject = static_cast<NFCTargetPrivObject*>(JSObjectGetPrivate(m_object));
if (NULL == privateObject) {
- LogWarning("Object has no privateObject");
+ LoggerW("Object has no privateObject");
return;
}
{
NFCAdapterPrivObject* privateObject = static_cast<NFCAdapterPrivObject*>(JSObjectGetPrivate(m_object));
if (NULL == privateObject) {
- LogError("Object has no privateObject");
+ LoggerE("Object has no privateObject");
return;
}
Try {
else
nfcAdapter->unsetPeerListener();
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
break;
}
default:
- LogError("Wrong ID");
+ LoggerE("Wrong ID");
}
}
};
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <JavaScriptCore/JavaScript.h>
#include "JSNFCTarget.h"
#include "NFCConverter.h"
#include "NFCAsyncCallbackManager.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::CommonsJavaScript;
}
void NFCStaticController::onAnswerReceived(const EventNFCChangedPtr& event) {
- LogDebug("onAnswerReceived Enter");
+ LoggerD("onAnswerReceived Enter");
EventNFCChangedPrivateDataPtr privateData =
DPL::DynamicPointerCast<EventNFCChangedPrivateData>(event->getPrivateData());
nfcObj = JSNFCTag::createJSObject(context, nfcProp);
else
nfcObj = JSNFCTarget::createJSObject(context, nfcProp);
- LogDebug("callOnSuccess");
+ LoggerD("callOnSuccess");
callbackManager->callOnSuccess(static_cast<JSValueRef>(nfcObj));
} else {
JSCallbackManagerPtr detachedCallbackManager = privateData->getDetachedCallbackManager();
detachedCallbackManager->callOnSuccess();
}
} Catch (ConversionException) {
- LogError("Conversion exception while processing EventNFCChanged");
+ LoggerE("Conversion exception while processing EventNFCChanged");
} Catch (PlatformException) {
- LogError("PlatformException:Platform can't create NFCTag" << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException:Platform can't create NFCTag" << _rethrown_exception.GetMessage());
} Catch (UnknownException) {
- LogError("UnknownException:Platform can't create NFCTag" << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException:Platform can't create NFCTag" << _rethrown_exception.GetMessage());
} Catch (NullPointerException) {
- LogError("NullPointer exception while processing EventNFCChanged");
+ LoggerE("NullPointer exception while processing EventNFCChanged");
}
}
Try {
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess();
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
JSValueRef errorObject;
errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
} Catch (PlatformException) {
- LogError("PlatformException" << _rethrown_exception.GetMessage());
+ LoggerE("PlatformException" << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::SERVICE_NOT_AVAILABLE,"Service Not Available");
cbm->callOnError(errorObject);
} Catch (UnknownException) {
- LogError("UnknownException" << _rethrown_exception.GetMessage());
+ LoggerE("UnknownException" << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
} Catch (Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
}
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include <JSTizenException.h>
#include "NFCTag.h"
#include "NFCUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
* @param this_ User data pointer.
*/
static bool TagInformationCallback(const char *key, const unsigned char *value, int value_size, void *user_data) {
- LogDebug("Callback TagInformationCallback.");
+ LoggerD("Callback TagInformationCallback.");
if (user_data) {
NFCUtil util;
std::vector<unsigned char> tagInfo = util.toVector(value, value_size);
(static_cast<NFCTag*>(user_data))->makeTagProperties(key, tagInfo);
return TRUE;
}
- LogDebug("Error! TagInformationCallback is Null.");
+ LoggerD("Error! TagInformationCallback is Null.");
return false;
}
static void TagReadCallback(nfc_error_e result , nfc_ndef_message_h message , void * data) {
- LogDebug("Callback TagReadCallback.");
+ LoggerD("Callback TagReadCallback.");
if (data) {
NFCTag *tagPtr = (NFCTag *)((EventNFCPtrs<EventTagActionRead> *)data)->getThisPtr();
if (tagPtr) {
EventTagActionReadPtr event = ((EventNFCPtrs<EventTagActionRead> *)data)->getEventPtrs();
- LogDebug("message handler :" << message);
+ LoggerD("message handler :" << message);
unsigned char *rawdata = NULL;
int size;
if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
- LogError("Can't get record's rawdata");
+ LoggerE("Can't get record's rawdata");
if (rawdata)
free(rawdata);
return;
}
} else {
- LogDebug("Error! TagReadCallback is Null.");
+ LoggerD("Error! TagReadCallback is Null.");
}
}
static void TagWriteCallback(nfc_error_e result, void *data) {
- LogDebug("Callback TagWriteCallback.");
+ LoggerD("Callback TagWriteCallback.");
if (data) {
((NFCTag *)data)->writeNdefManualAnswer((int)result);
} else {
- LogDebug("Error! TagWriteCallback is Null.");
+ LoggerD("Error! TagWriteCallback is Null.");
}
}
static void TagTransceiveCallback(nfc_error_e result, unsigned char *buffer, int buffer_size, void *data) {
- LogDebug("Callback TagTransceiveCallback.");
+ LoggerD("Callback TagTransceiveCallback.");
if (data) {
NFCUtil util;
std::vector<unsigned char> responseData = util.toVector(buffer, buffer_size) ;
((NFCTag *)data)->transceiveManualAnswer((int)result, responseData);
} else {
- LogDebug("Error! TagTransceiveCallback is Null.");
+ LoggerD("Error! TagTransceiveCallback is Null.");
}
}
static void TagFormatCallback(nfc_error_e result, void *data) {
- LogDebug("Callback TagFormatCallback.");
+ LoggerD("Callback TagFormatCallback.");
if (data) {
((NFCTag *)data)->formatManualAnswer((int)result);
} else {
- LogDebug("Error! TagFormatCallback is Null.");
+ LoggerD("Error! TagFormatCallback is Null.");
}
}
}//private namespace
NFCTag::NFCTag(void *tagHandle)
{
- LogDebug("entered");
+ LoggerD("entered");
handle = (nfc_tag_h)tagHandle;
NFCTag::~NFCTag()
{
- LogDebug("entered");
+ LoggerD("entered");
handle = NULL;
}
return static_cast<long>(ndefSize);
}
std::vector<NFCTagProperties> NFCTag::getProperties() {
- LogDebug("Enter");
+ LoggerD("Enter");
props.clear();
int result = nfc_tag_foreach_information(handle, TagInformationCallback, this);
}
void NFCTag::readNdef(const EventTagActionReadPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (!isNDEFSupport())
ThrowMsg(WrtDeviceApis::Commons::UnsupportedException, "Not Support NDEF");
}
void NFCTag::writeNdef(const EventTagActionWritePtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (!isNDEFSupport())
ThrowMsg(WrtDeviceApis::Commons::UnsupportedException, "Not Support NDEF");
}
void NFCTag::transceive(const EventTagActionTransceivePtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTagActionTransceivePtr.Get() != NULL)
EventTagActionTransceives.push_back(event);
}
void NFCTag::format(const EventTagActionFormatPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
EventRequestReceiver<EventTagActionFormat>::PostRequest(event);
}
void NFCTag::readNdefManualAnswer(int result, std::vector<unsigned char> &data, const EventTagActionReadPtr &event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if ((nfc_error_e)result == NFC_ERROR_NONE) {
event->setResult(TRUE);
event->setReadNdefResult(data);
for (it = EventTagActionsReads.begin(); it != EventTagActionsReads.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
EventTagActionsReads.erase(it);
- LogDebug("event is removed. (" << EventTagActionsReads.size() << ")");
+ LoggerD("event is removed. (" << EventTagActionsReads.size() << ")");
break;
}
}
void NFCTag::writeNdefManualAnswer(int result)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTagActionWritePtr.Get() != NULL) {
if (nfc_ndef_message_destroy(static_cast<nfc_ndef_message_h>(m_EventTagActionWritePtr->getNdefForWriting())) != NFC_ERROR_NONE)
- LogError("Can't destroy NdefMessage");
+ LoggerE("Can't destroy NdefMessage");
if ((nfc_error_e)result == NFC_ERROR_NONE) {
m_EventTagActionWritePtr->setResult(TRUE);
if (EventTagActionWrites.size() > 0) {
EventTagActionWritePtr event = EventTagActionWrites.front();
EventTagActionWrites.erase(EventTagActionWrites.begin());
- LogDebug("EventTagActionWrites is removed. (" << EventTagActionWrites.size() << ")");
+ LoggerD("EventTagActionWrites is removed. (" << EventTagActionWrites.size() << ")");
EventRequestReceiver<EventTagActionWrite>::PostRequest(event);
}
}
void NFCTag::transceiveManualAnswer(int result , std::vector<unsigned char> &data)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTagActionTransceivePtr.Get() != NULL) {
if ((nfc_error_e)result == NFC_ERROR_NONE) {
m_EventTagActionTransceivePtr->setResult(TRUE);
if (EventTagActionTransceives.size() > 0) {
EventTagActionTransceivePtr event = EventTagActionTransceives.front();
EventTagActionTransceives.erase(EventTagActionTransceives.begin());
- LogDebug("EventTagActionWrites is removed. (" << EventTagActionTransceives.size() << ")");
+ LoggerD("EventTagActionWrites is removed. (" << EventTagActionTransceives.size() << ")");
EventRequestReceiver<EventTagActionTransceive>::PostRequest(event);
}
}
void NFCTag::formatManualAnswer(int result)
{
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTagActionFormatPtr.Get() != NULL) {
if ((nfc_error_e)result == NFC_ERROR_NONE) {
m_EventTagActionFormatPtr->setResult(TRUE);
}
void NFCTag::OnRequestReceived(const EventTagActionReadPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
event->switchToManualAnswer();
for (it = EventTagActionsReads.begin(); it != EventTagActionsReads.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
EventTagActionsReads.erase(it);
- LogDebug("event is removed. (" << EventTagActionsReads.size() << ")");
+ LoggerD("event is removed. (" << EventTagActionsReads.size() << ")");
break;
}
}
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setResult(false);
EventRequestReceiver<EventTagActionRead>::ManualAnswer(event);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
if (event != m_EventTagActionWritePtr)
m_EventTagActionWritePtr = event;
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
std::vector<unsigned char> emptyData;
transceiveManualAnswer(NFC_ERROR_OPERATION_FAILED, emptyData);
m_EventTagActionFormatPtr = event;
NFCUtil util;
- LogDebug("key size :" << event->getKeySize());
+ LoggerD("key size :" << event->getKeySize());
unsigned char *key = util.toCharPtr(event->getKey());
int result = nfc_tag_format_ndef(handle, key, event->getKeySize(), TagFormatCallback, this);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setResult(false);
EventRequestReceiver<EventTagActionFormat>::ManualAnswer(event);
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
-
#include "NFCTarget.h"
#include "NFCUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
* @param this_ User data pointer.
*/
static void TargetReceivedCallback(nfc_p2p_target_h target, nfc_ndef_message_h message, void *user_data) {
- LogDebug("Callback TargetReceivedCallback.");
+ LoggerD("Callback TargetReceivedCallback.");
if (user_data) {
unsigned char *rawdata = NULL;
int size;
if (nfc_ndef_message_get_rawdata(message, &rawdata, &size) != NFC_ERROR_NONE) {
- LogError("Can't get rawdata of message");
+ LoggerE("Can't get rawdata of message");
if (rawdata)
free(rawdata);
return;
free(rawdata);
((NFCTarget *)user_data)->receiveNdef(receiveData);
} else {
- LogDebug("Error! TargetReceivedCallback is Null.");
+ LoggerD("Error! TargetReceivedCallback is Null.");
}
}
static void TargetSentCallback(nfc_error_e result, void *user_data) {
- LogDebug("Callback TargetSentCallback.");
+ LoggerD("Callback TargetSentCallback.");
if (user_data) {
((NFCTarget *)user_data)->sendNDEFManualAnswer((unsigned int)result);
} else {
- LogDebug("Error! TargetSentCallback is Null.");
+ LoggerD("Error! TargetSentCallback is Null.");
}
}
}//private namespace
NFCTarget::NFCTarget(void *targetHandle)
{
- LogDebug("entered");
+ LoggerD("entered");
if (targetHandle == NULL)
ThrowMsg(Commons::UnknownException, "Target Handler is Null Pointer.");
handle = (nfc_p2p_target_h)targetHandle;
- LogDebug("handle:"<<targetHandle);
+ LoggerD("handle:"<<targetHandle);
m_isSetReceiveListenter = false;
m_EventTargetActionSendPtr.Reset();
}
NFCTarget::~NFCTarget()
{
- LogDebug("entered");
+ LoggerD("entered");
handle = NULL;
}
}
void NFCTarget::setReceiveNDEFListener(const EventTargetActionReceiveEmitterPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_isSetReceiveListenter == true)
ThrowMsg(Commons::AlreadyInUseException, "Already set Listener");
}
void NFCTarget::receiveNdef(std::vector<unsigned char>&messageData) {
- LogDebug("Enter");
+ LoggerD("Enter");
if ((m_isSetReceiveListenter == true) && (m_emitter.Get() != NULL)) {
EventTargetActionReceivePtr event(new EventTargetActionReceive());
event->setReadNdefResult(messageData);
}
void NFCTarget::unsetReceiveNDEFListener() {
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_isSetReceiveListenter == true) {
nfc_p2p_unset_data_received_cb(handle);
- LogDebug("Success to unset Listener");
+ LoggerD("Success to unset Listener");
} else {
- LogDebug("No set Listener");
+ LoggerD("No set Listener");
}
m_isSetReceiveListenter = false;
}
void NFCTarget::sendNDEF(const EventTargetActionSendPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTargetActionSendPtr.Get() != NULL)
m_EventTargetActionSends.push_back(event);
}
void NFCTarget::sendNDEFManualAnswer(unsigned int result) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (m_EventTargetActionSendPtr.Get() != NULL) {
if (nfc_ndef_message_destroy(static_cast<nfc_ndef_message_h>(m_EventTargetActionSendPtr->getMessageForSending())) != NFC_ERROR_NONE)
- LogError("Can't destroy NdefMessage");
+ LoggerE("Can't destroy NdefMessage");
if ((nfc_error_e)result == NFC_ERROR_NONE) {
m_EventTargetActionSendPtr->setResult(TRUE);
if (m_EventTargetActionSends.size() > 0) {
EventTargetActionSendPtr event = m_EventTargetActionSends.front();
m_EventTargetActionSends.erase(m_EventTargetActionSends.begin());
- LogDebug("m_EventTargetActionSends is removed. (" << m_EventTargetActionSends.size() << ")");
+ LoggerD("m_EventTargetActionSends is removed. (" << m_EventTargetActionSends.size() << ")");
EventRequestReceiver<EventTargetActionSend>::PostRequest(event);
}
}
}
void NFCTarget::OnRequestReceived(const EventTargetActionSendPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
event->switchToManualAnswer();
m_EventTargetActionSendPtr = event;
sendNDEFManualAnswer(result);
}
} catch (const Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
if (event != m_EventTargetActionSendPtr)
m_EventTargetActionSendPtr = event;
sendNDEFManualAnswer(NFC_ERROR_OPERATION_FAILED);
// limitations under the License.
//
-
-
#include <Commons/Exception.h>
#include <JSTizenException.h>
-#include <dpl/log/log.h>
#include <nfc.h>
-
#include "NFCUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
for (i = 0; i < size; i++)
vec.push_back(ch[i]);
- LogDebug("result:" << byteToString(ch, size));
+ LoggerD("result:" << byteToString(ch, size));
} else
- LogDebug("result: NULL");
+ LoggerD("result: NULL");
return vec;
}
if (charBuf) {
if (buffer->size() > 255) {
memcpy(localbuffer, charBuf, 255);
- LogDebug("size is " << buffer->size() << ". Too Big! It will copy some of data(255 bytes)");
+ LoggerD("size is " << buffer->size() << ". Too Big! It will copy some of data(255 bytes)");
} else
memcpy(localbuffer, charBuf, buffer->size());
free(charBuf);
} else
- LogDebug("Size is 0");
+ LoggerD("Size is 0");
} else
- LogDebug("Size is 0");
+ LoggerD("Size is 0");
return localbuffer;
}
char *NFCUtil::byteToString(const unsigned char* buffer, const int size){
if (size > 255)
- LogDebug("size is " << size << ". Too Big! It will copy some of data(255 bytes)");
+ LoggerD("size is " << size << ". Too Big! It will copy some of data(255 bytes)");
static char localbuffer[256];
memset(localbuffer, 0, 256);
if (size > 0)
memcpy(localbuffer, buffer, size > 255 ? 255 : size);
else
- LogDebug("Size is 0");
+ LoggerD("Size is 0");
return localbuffer;
}
result = nfc_ndef_record_get_payload(recordHandle, &payload, &payloadSize);
throwNFCException(result, "Can't get record's payload");
- LogDebug("tnf : " <<tnf);
- LogDebug("typeName : " << byteToString(typeName, typeSize));
- LogDebug("payload : " << byteToString(payload, payloadSize));
+ LoggerD("tnf : " <<tnf);
+ LoggerD("typeName : " << byteToString(typeName, typeSize));
+ LoggerD("payload : " << byteToString(payload, payloadSize));
recordData.properties.tnf = convertTonfcTNF(static_cast<unsigned short>(tnf));
recordData.properties.typeName = toVector(typeName, typeSize);
}
std::string NFCUtil::getNFCErrorString(const int errorCode) {
- LogDebug ("Errorcode : " << errorCode);
+ LoggerD ("Errorcode : " << errorCode);
switch(errorCode) {
case NFC_ERROR_NONE:
return "";
}
std::string NFCUtil::getNFCErrorMessage(const int errorCode) {
- LogDebug ("Errorcode : " << errorCode);
+ LoggerD ("Errorcode : " << errorCode);
switch(errorCode) {
case NFC_ERROR_NONE:
return "";
}
void NFCUtil::throwNFCException(const int errorCode, const std::string &message) {
- LogDebug ("Errorcode : " << static_cast<unsigned int>(errorCode));
+ LoggerD ("Errorcode : " << static_cast<unsigned int>(errorCode));
switch(errorCode) {
case NFC_ERROR_NONE:
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
-
#include "NdefMessage.h"
#include "NFCUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
NdefMessage::NdefMessage()
{
- LogDebug("entered");
+ LoggerD("entered");
recordPtr = NULL;
NFCUtil util;
int result = nfc_ndef_message_create(&handle);
NdefMessage::NdefMessage(void *messageHandle)
{
- LogDebug("entered");
+ LoggerD("entered");
recordPtr = NULL;
if (messageHandle == NULL) {
handle = NULL;
NdefMessage::NdefMessage(std::vector<void *> &ndefRcords)
{
- LogDebug("entered");
+ LoggerD("entered");
recordPtr = NULL;
handle = NULL;
handle = static_cast<nfc_ndef_message_h>(makeMessage(ndefRcords));
NdefMessage::NdefMessage(const std::vector<unsigned char> &rawdata)
{
- LogDebug("entered");
+ LoggerD("entered");
recordPtr = NULL;
handle = static_cast<nfc_ndef_message_h>(makeMessage(rawdata));
}
NdefMessage::~NdefMessage()
{
- LogDebug("entered"<<recordPtr);
+ LoggerD("entered"<<recordPtr);
if (handle != NULL)
nfc_ndef_message_destroy(handle);
}
nfc_ndef_record_h insertRecord;
if (!util.copyNDEFRecord(&ndefRcords[i], (void **)(&insertRecord))) {
- LogDebug("copyNDEFRecord fail!");
+ LoggerD("copyNDEFRecord fail!");
ThrowMsg(UnknownException, "Can't copy Record");
}
result = nfc_ndef_message_append_record(message, insertRecord);
if (result != NFC_ERROR_NONE) {
- LogError(i << " record can't be inserted. " << insertRecord << " : " << message);
+ LoggerE(i << " record can't be inserted. " << insertRecord << " : " << message);
nfc_ndef_message_destroy(message);
util.throwNFCException(result, "Can't insert record in Ndef Message");
}
}
void NdefMessage::setRecordesPtr(void *records) {
- LogDebug("entered"<<records);
+ LoggerD("entered"<<records);
recordPtr = records;
}
void* NdefMessage::getRecordesPtr() {
- LogDebug("entered"<<recordPtr);
+ LoggerD("entered"<<recordPtr);
return recordPtr;
}
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get Record Count");
- LogDebug("record Count : " << count);
+ LoggerD("record Count : " << count);
return static_cast<long>(count);
}
free(rawdata);
util.throwNFCException(result, "Can't get serial bytes of NDEF message");
}
- LogDebug(rawdata);
+ LoggerD(rawdata);
std::vector<unsigned char> byteData = util.toVector(rawdata, size);
if (rawdata)
free(rawdata);
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
-
#include "NdefRecord.h"
#include "NFCUtil.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace NFC {
NdefRecord::NdefRecord(std::vector<unsigned char> data)
{
- LogDebug("entered");
+ LoggerD("entered");
nfc_ndef_message_h messageHandle;
NFCUtil util;
NdefRecord::NdefRecord(const NdefRecordProperties &ndefRecordProperties, std::vector<unsigned char> payload)
{
- LogDebug("entered");
+ LoggerD("entered");
NFCUtil util;
unsigned char * typeName = util.toCharPtr(ndefRecordProperties.typeName);
unsigned char * id = util.toCharPtr(ndefRecordProperties.id);
- LogDebug("typeName : " << util.byteToString(typeName, ndefRecordProperties.typeName.size()));
+ LoggerD("typeName : " << util.byteToString(typeName, ndefRecordProperties.typeName.size()));
int result = nfc_ndef_record_create(&handle, static_cast<nfc_record_tnf_e>(util.convertToTNF(ndefRecordProperties.tnf)), typeName, ndefRecordProperties.typeName.size(),
id, ndefRecordProperties.id.size(), recordPayload, payload.size()) ;
if (recordPayload)
NdefRecord::NdefRecord(const std::string &text, const std::string &langCode, const short encodeType)
{
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_create_text(&handle, text.c_str(), langCode.c_str(), _convertToEncodeType(static_cast<nfcTextEncodeUTF>(encodeType)));
NdefRecord::NdefRecord(const std::string &uri)
{
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_create_uri(&handle, uri.c_str());
NdefRecord::NdefRecord(const std::string &mimeType, const std::vector<unsigned char> data)
{
- LogDebug("entered");
+ LoggerD("entered");
NFCUtil util;
NdefRecord::~NdefRecord()
{
- LogDebug("entered");
+ LoggerD("entered");
if (handle != NULL)
nfc_ndef_record_destroy(handle);
}
}
NdefRecordProperties NdefRecord::getNDEFRecordProperties() {
- LogDebug("entered");
+ LoggerD("entered");
NdefRecordProperties props;
NFCUtil util;
props.tnf = getTNF();
- LogDebug("tnf : " << props.tnf);
+ LoggerD("tnf : " << props.tnf);
props.typeName = getTypeName();
props.id = getID();
- LogDebug("typeName : " << util.byteToString(&props.typeName));
+ LoggerD("typeName : " << util.byteToString(&props.typeName));
return props;
}
}
bool NdefRecord::getText(char **text) {
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_get_text(handle, text);
if (result == NFC_ERROR_INVALID_RECORD_TYPE)
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get text of record");
- LogDebug("text : " << *text);
+ LoggerD("text : " << *text);
return true;
}
bool NdefRecord::getLangCode(char **langCode) {
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_get_langcode(handle, langCode);
if (result == NFC_ERROR_INVALID_RECORD_TYPE)
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get langcode of record");
- LogDebug("langCode : " << *langCode);
+ LoggerD("langCode : " << *langCode);
return true;
}
bool NdefRecord::getEncodeType(nfcTextEncodeUTF *encodeType) {
- LogDebug("entered");
+ LoggerD("entered");
nfc_encode_type_e type;
int result = nfc_ndef_record_get_encode_type(handle, &type);
util.throwNFCException(result, "Can't get encode type of record");
*encodeType = _convertToNfcEncodeType(type);
- LogDebug("encodeType : " << *encodeType);
+ LoggerD("encodeType : " << *encodeType);
return true;
}
bool NdefRecord::getUri(char **uri) {
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_get_uri(handle, uri);
if (result == NFC_ERROR_INVALID_RECORD_TYPE)
return false;
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get uri of record");
- LogDebug("uri : " << *uri);
+ LoggerD("uri : " << *uri);
return true;
}
bool NdefRecord::getMimeType(char **mimeType) {
- LogDebug("entered");
+ LoggerD("entered");
int result = nfc_ndef_record_get_mime_type(handle, mimeType);
if (result == NFC_ERROR_INVALID_RECORD_TYPE)
return false;
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get mime type of record");
- LogDebug("mimeType : " << *mimeType);
+ LoggerD("mimeType : " << *mimeType);
return true;
}
std::vector<unsigned char> NdefRecord::getPayload() {
- LogDebug("entered");
+ LoggerD("entered");
int size;
unsigned char *recordbuffer;
int result = nfc_ndef_record_get_payload(handle, &recordbuffer, &size);
if (result != NFC_ERROR_NONE)
util.throwNFCException(result, "Can't get record's payload");
- LogDebug("payload : " << util.byteToString(recordbuffer, size));
+ LoggerD("payload : " << util.byteToString(recordbuffer, size));
return util.toVector(recordbuffer, size);
}
//
#include <vector>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include "NFCConverter.h"
#include "JSNdefMessage.h"
#include "NFCAsyncCallbackManager.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
TargetSendNdefAnswerReceiver(ThreadEnum::NULL_THREAD),
TargetReceiveNdefListener(ThreadEnum::NULL_THREAD)
{
- LogDebug("entered");
+ LoggerD("entered");
}
NFCResponseDispatcher::~NFCResponseDispatcher()
{
- LogDebug("entered");
+ LoggerD("entered");
}
void NFCResponseDispatcher::OnAnswerReceived(const EventTagActionReadPtr &event)
Try {
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(JSNdefMessage::createJSObject(cbm->getContext(), event->getReadNdefResult()));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
cbm->callOnError(errorObject);
} Catch (PlatformException) {
- LogError("Platform can't create NdefMessage" << _rethrown_exception.GetMessage());
+ LoggerE("Platform can't create NdefMessage" << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
} Catch (Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
}
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess();
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
Try {
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
NFCConverter convert(context);
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(convert.toJSValueRef(event->getTransceiveBuffer()));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
cbm->callOnError(errorObject);
} Catch (ConversionException) {
- LogError("Conversion exception while processing EventTagActionTransceive");
+ LoggerE("Conversion exception while processing EventTagActionTransceive");
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
} Catch (Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSValueRef errorObject = JSTizenExceptionFactory::makeErrorObject(cbm->getContext(), JSTizenException::UNKNOWN_ERROR,"Unknown Error");
cbm->callOnError(errorObject);
}
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess();
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
NFCAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(cbm);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess();
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
std::string error = event->getError();
std::string errorMessage = event->getErrorMessage();
void NFCResponseDispatcher::onAnswerReceived(const EventTargetActionReceivePtr &event)
{
- LogDebug("onAnswerReceived Enter");
+ LoggerD("onAnswerReceived Enter");
JSCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
Try {
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
JSContextRef context = cbm->getContext();
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(JSNdefMessage::createJSObject(context, event->getReadNdefResult()));
} Catch (PlatformException) {
- LogError("Platform can't create NdefMessage" << _rethrown_exception.GetMessage());
+ LoggerE("Platform can't create NdefMessage" << _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <GlobalContextManager.h>
#include "NFCAsyncCallbackManager.h"
#include "NFCListenerManager.h"
#include "NFCDefaultAdapter.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[TIZEN\\NFC ] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[TIZEN\\NFC ] on_widget_start_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[TIZEN\\NFC ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[TIZEN\\NFC ] on_widget_stop_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\NFC] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\NFC] on_frame_load_callback (" << context << ")");
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\NFC] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\NFC] on_frame_unload_callback (" << context << ")");
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
DeviceAPI::NFC::NFCAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::NFC::NFCListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
#include "JSNetworkBearerSelectionCallbackManager.h"
#include "NetworkBearerSelectionResponseDispatcher.h"
#include "plugin_config.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_N_NETWORKBEARER"
-#endif
+#include <Logger.h>
namespace DeviceAPI {
namespace NetworkBearerSelection {
INetworkBearerSelectionPtr NetworkBearers(NetworkBearerSelectionFactory::getInstance().getNetworkBearerSelections());
JSNetworkBearerSelectionPriv* priv = new JSNetworkBearerSelectionPriv(context, NetworkBearers);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
- LogDebug("JSNetworkBearerSelection::initialize ");
+ LoggerD("JSNetworkBearerSelection::initialize ");
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
JSNetworkBearerSelectionPriv* priv = static_cast<JSNetworkBearerSelectionPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting gallery");
+ LoggerD("Deleting gallery");
delete priv;
}
JSValueRef JSNetworkBearerSelection::requestRouteToHost(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
JSNetworkBearerSelectionPriv *priv = static_cast<JSNetworkBearerSelectionPriv*>(JSObjectGetPrivate(thisObject));
Converter converter(context);
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 3) {
}
if (argumentCount == 4) {
if (check.isCallback(arguments[3])) {
- LogDebug("arguments 3 is callback");
+ LoggerD("arguments 3 is callback");
} else if (!JSValueIsNull(context, arguments[3]) && !JSValueIsUndefined(context, arguments[3])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
} Catch(ConversionException) {
- LogError("Error on conversion : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on conversion : " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
}
JSValueRef JSNetworkBearerSelection::releaseRouteToHost(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
JSNetworkBearerSelectionPriv *priv = static_cast<JSNetworkBearerSelectionPriv*>(JSObjectGetPrivate(thisObject));
Converter converter(context);
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 3) {
//
#include "JSNetworkBearerSelectionCallbackManager.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace NetworkBearerSelection {
{
if (m_onSuccess == NULL)
{
- //LogDebug("oncontactsadded callback is not set");
+ //LoggerD("oncontactsadded callback is not set");
return;
}
{
if (m_onPaused == NULL)
{
- //LogDebug("oncontactsadded callback is not set");
+ //LoggerD("oncontactsadded callback is not set");
return;
}
{
if (m_onResumed == NULL)
{
- //LogDebug("oncontactsadded callback is not set");
+ //LoggerD("oncontactsadded callback is not set");
return;
}
{
if (m_onDisconnected == NULL)
{
- //LogDebug("oncontactsadded callback is not set");
+ //LoggerD("oncontactsadded callback is not set");
return;
}
{
if (m_onError == NULL)
{
- //LogDebug("Error callback is not set");
+ //LoggerD("Error callback is not set");
return;
}
JSValueRef objParam[1] = { error };
{
if (callback == NULL)
{
- LogError("callback is NULL");
+ LoggerE("callback is NULL");
return;
}
{
if (argc == 0)
{
- //LogDebug("Calling object directly, no arguments");
+ //LoggerD("Calling object directly, no arguments");
JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
}
else
{
- //LogDebug("Calling object directly, one argument");
+ //LoggerD("Calling object directly, one argument");
JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
}
return;
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "NetworkBearerSelection.h"
#include <netdb.h>
#include <arpa/inet.h>
+#include <Logger.h>
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis::Commons;
static void connection_state_changed_callback(connection_profile_state_e state, void* user_data)
{
+ LoggerD("enter");
if(user_data != NULL) {
- LogDebug("Callback registration Succeeded");
+ LoggerD("Callback registration Succeeded");
NewtorkBearerSelectionPendingEvent *pendingEvent = (NewtorkBearerSelectionPendingEvent *)user_data;
NetworkBearerSelection *networkBearerSelection = (NetworkBearerSelection *)pendingEvent->getThisObject();
EventNetworkBearerSelectionPtr event = pendingEvent->getEvent();
static void connection_opened_callback(connection_error_e result, void* user_data)
{
+ LoggerD("enter");
if (result == CONNECTION_ERROR_NONE) {
- LogDebug("Connection open Succeeded");
+ LoggerD("Connection open Succeeded");
if(user_data != NULL) {
NewtorkBearerSelectionPendingEvent *pendingEvent = (NewtorkBearerSelectionPendingEvent *)user_data;
NetworkBearerSelection *networkBearerSelection = (NetworkBearerSelection *)pendingEvent->getThisObject();
static void connection_closed_callback(connection_error_e result, void* user_data)
{
+ LoggerD("enter");
if (result == CONNECTION_ERROR_NONE) {
- LogDebug("Connection close Succeeded");
+ LoggerD("Connection close Succeeded");
if (user_data != NULL) {
NewtorkBearerReleasePendingEvent *pendingEvent = (NewtorkBearerReleasePendingEvent *)user_data;
NetworkBearerSelection *networkBearerSelection = (NetworkBearerSelection *)pendingEvent->getThisObject();
}
}
+static void connection_closed_callback2(connection_error_e result, void* user_data)
+{
+ LoggerD("enter");
+ if (result == CONNECTION_ERROR_NONE) {
+ LoggerD("Connection close Succeeded");
+ }
+}
+
+
static void connection_removed_callback(connection_error_e result, void* user_data)
{
+ LoggerD("enter");
if (user_data != NULL) {
if (result == CONNECTION_ERROR_NONE) {
- LogDebug("Connection close Succeeded");
+ LoggerD("Connection close Succeeded");
NewtorkBearerSelectionPendingEvent *pendingEvent = (NewtorkBearerSelectionPendingEvent *)user_data;
NetworkBearerSelection *networkBearerSelection = (NetworkBearerSelection *)pendingEvent->getThisObject();
EventNetworkBearerSelectionPtr event = pendingEvent->getEvent();
}
NetworkBearerSelection::NetworkBearerSelection() : m_connectionHandle(NULL),
- m_profileHandle(NULL)
+ m_profileHandle(NULL),
+ m_connectionState(NETWORK_UNKNOWN)
{
int ret = connection_create(&m_connectionHandle);
if (CONNECTION_ERROR_NONE == ret) {
- LogDebug("Client registration success");
+ LoggerD("Client registration success");
} else {
- LogDebug("Client registration failed");
+ LoggerD("Client registration failed");
m_connectionHandle = NULL;
}
}
NetworkBearerSelection::~NetworkBearerSelection()
{
if(m_connectionHandle != NULL) {
- LogDebug("Client deregistration success");
+ LoggerD("Client deregistration success");
connection_destroy(m_connectionHandle);
} else {
- LogDebug("Client deregistration failed");
+ LoggerD("Client deregistration failed");
}
}
void NetworkBearerSelection::requestRouteToHost(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("enter");
EventRequestReceiver<EventNetworkBearerSelection>::PostRequest(event);
}
void NetworkBearerSelection::releaseRouteToHost(const EventNetworkBearerReleasePtr &event)
{
- LogDebug("enter");
EventRequestReceiver<EventNetworkBearerRelease>::PostRequest(event);
}
void NetworkBearerSelection::OnRequestReceived(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("enter");
+ LoggerD("m_connectionState : " << m_connectionState);
- if (checkProfileHandle() == false) {
+ if (m_connectionState == NETWORK_CONNECTED) {
reLaunchConnection(event);
return;
}
int ret = connection_get_profile_iterator(m_connectionHandle, CONNECTION_ITERATOR_TYPE_REGISTERED, &profileIter);
if (ret != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get profile iterator");
+ LoggerD("Fail to get profile iterator");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
return;
}
while (connection_profile_iterator_has_next(profileIter)) {
if (connection_profile_iterator_next(profileIter, &m_profileHandle) != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get profile handle");
+ LoggerD("Fail to get profile handle");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
return;
}
}
NewtorkBearerSelectionPendingEvent *pendingEvent = new NewtorkBearerSelectionPendingEvent((void *)this, event);
if (connection_open_profile(m_connectionHandle, m_profileHandle, connection_opened_callback, pendingEvent) != CONNECTION_ERROR_NONE) {
- LogDebug("Connection open Failed");
+ LoggerD("Connection open Failed");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
delete pendingEvent;
pendingEvent = NULL;
}
void NetworkBearerSelection::OnRequestReceived(const EventNetworkBearerReleasePtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
if (event->getDomainName().compare(m_domainName) == 0) {
event->switchToManualAnswer();
if (connection_profile_unset_state_changed_cb(m_profileHandle) != CONNECTION_ERROR_NONE) {
- LogDebug("unset callback is failed");
+ LoggerD("unset callback is failed");
return;
}
NewtorkBearerReleasePendingEvent *pendingEvent = new NewtorkBearerReleasePendingEvent((void *)this, event);
-
+
if (connection_close_profile(m_connectionHandle, m_profileHandle, connection_closed_callback, pendingEvent) != CONNECTION_ERROR_NONE) {
- LogDebug("connection close failed");
+ LoggerD("connection close failed");
delete pendingEvent;
pendingEvent = NULL;
EventRequestReceiver<EventNetworkBearerRelease>::ManualAnswer(event);
void NetworkBearerSelection::reLaunchConnection(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
if (connection_profile_unset_state_changed_cb(m_profileHandle) != CONNECTION_ERROR_NONE) {
- LogDebug("unset callback is failed");
+ LoggerD("unset callback is failed");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
return;
}
NewtorkBearerSelectionPendingEvent *pendingEvent = new NewtorkBearerSelectionPendingEvent((void *)this, event);
if (connection_close_profile(m_connectionHandle, m_profileHandle, connection_removed_callback, pendingEvent) != CONNECTION_ERROR_NONE) {
- LogDebug("connection close failed");
+ LoggerD("connection close failed");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
delete pendingEvent;
pendingEvent = NULL;
}
void NetworkBearerSelection::removeStateChangeListener(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
m_profileHandle = NULL;
connection_profile_iterator_h profileIter;
int ret = connection_get_profile_iterator(m_connectionHandle, CONNECTION_ITERATOR_TYPE_REGISTERED, &profileIter);
if (ret != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get profile iterator");
+ LoggerD("Fail to get profile iterator");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
return;
}
while (connection_profile_iterator_has_next(profileIter)) {
if (connection_profile_iterator_next(profileIter, &m_profileHandle) != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get profile handle");
+ LoggerD("Fail to get profile handle");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
return;
}
}
NewtorkBearerSelectionPendingEvent *pendingEvent = new NewtorkBearerSelectionPendingEvent((void *)this, event);
if (connection_open_profile(m_connectionHandle, m_profileHandle, connection_opened_callback, pendingEvent) != CONNECTION_ERROR_NONE) {
- LogDebug("Connection open Failed");
+ LoggerD("Connection open Failed");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
delete pendingEvent;
pendingEvent = NULL;
}
void NetworkBearerSelection::registStateChangeListener(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
char *interfaceName = NULL;
char *hostAddr = NULL;
struct hostent *host_entry;
- int ndx = 0;
- int ret = 0;
if (connection_profile_get_network_interface_name(m_profileHandle, &interfaceName) != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get interface name!");
+ LoggerD("Fail to get interface name!");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
}
else {
- LogDebug("Interface name : " << interfaceName);
+ LoggerD("Interface name : " << interfaceName);
}
host_entry = gethostbyname(event->getDomainName().c_str());
if(!host_entry) {
- LogDebug("gethostbyname is failed");
- makeCallback(event, CONNECTION_STATE_ERROR);
+ LoggerD("gethostbyname is failed");
+ makeCallback(event, CONNECTION_STATE_INVALID_VALUES_ERROR);
+
+ if (connection_close_profile(m_connectionHandle, m_profileHandle, connection_closed_callback2, NULL) != CONNECTION_ERROR_NONE) {
+ LoggerD("connection close failed");
+ makeCallback(event, CONNECTION_STATE_PLATFORM_ERROR);
+ }
+ m_profileHandle = NULL;
return;
}
hostAddr = inet_ntoa( *(struct in_addr*)host_entry->h_addr_list[0]);
- LogDebug("hostAddr : " << hostAddr);
+ LoggerD("hostAddr : " << hostAddr);
NewtorkBearerSelectionPendingEvent *pendingEvent = new NewtorkBearerSelectionPendingEvent((void *)this, event);
connection_profile_set_state_changed_cb(m_profileHandle, connection_state_changed_callback, pendingEvent);
void NetworkBearerSelection::deregistStateChangeListener(const EventNetworkBearerReleasePtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
m_profileHandle = NULL;
-
+ m_connectionState = NETWORK_DISCONNECTED;
EventRequestReceiver<EventNetworkBearerRelease>::ManualAnswer(event);
}
void NetworkBearerSelection::makeCallback(const EventNetworkBearerSelectionPtr &event, connectionStateType state)
{
- LogDebug("enter");
+ LoggerD("state : " << state);
OnNetworkBearerSelectionStateChangedEmitterPtr emitter = event->getEmitter();
OnNetworkBearerSelectionStateChangedPtr listener(new OnNetworkBearerSelectionStateChanged());
m_domainName = event->getDomainName();
-
listener->setConnectionStateType(state);
- if (state == CONNECTION_STATE_ERROR) {
+ if (state == CONNECTION_STATE_INVALID_VALUES_ERROR) {
+ m_connectionState = NETWORK_CONNECTION_FAILED;
listener->setExceptionCode(ExceptionCodes::InvalidArgumentException);
+ } else if (state == CONNECTION_STATE_PLATFORM_ERROR) {
+ m_connectionState = NETWORK_CONNECTION_FAILED;
+ listener->setExceptionCode(ExceptionCodes::PlatformException);
+ } else if (state == CONNECTION_STATE_DISCONNECTED) {
+ m_connectionState = NETWORK_DISCONNECTED;
+ } else if (state == CONNECTION_STATE_CONNECTED) {
+ m_connectionState = NETWORK_CONNECTED;
}
-
emitter->emit(listener);
}
connection_cellular_state_e cellularState;
if (connection_get_cellular_state(m_connectionHandle, &cellularState) != CONNECTION_ERROR_NONE) {
- LogDebug("Fail to get Cellular state");
+ LoggerD("Fail to get Cellular state");
return false;
}
- LogDebug("celluar network state is " << cellularState);
+ LoggerD("celluar network state is " << cellularState);
if (cellularState == CONNECTION_CELLULAR_STATE_AVAILABLE || cellularState == CONNECTION_CELLULAR_STATE_CONNECTED) {
return true;
namespace DeviceAPI {
namespace NetworkBearerSelection {
+enum {
+ NETWORK_UNKNOWN = 0,
+ NETWORK_CONNECTED = 1,
+ NETWORK_DISCONNECTED = 2,
+ NETWORK_CONNECTION_FAILED = 3
+};
+
class NetworkBearerSelection : public INetworkBearerSelection
{
friend class NetworkBearerSelectionFactory;
connection_h m_connectionHandle;
connection_profile_h m_profileHandle;
std::string m_domainName;
+ long m_connectionState;
};
class NewtorkBearerSelectionPendingEvent
#include "NetworkBearerSelectionResponseDispatcher.h"
#include "JSNetworkBearerSelectionCallbackManager.h"
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
void NetworkBearerSelectionResponseDispatcher::OnAnswerReceived(const EventNetworkBearerSelectionPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
}
void NetworkBearerSelectionResponseDispatcher::OnAnswerReceived(const EventNetworkBearerReleasePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
void NetworkBearerSelectionResponseDispatcher::onAnswerReceived(const OnNetworkBearerSelectionStateChangedPtr& event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSNetworkBearerSelectionCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSNetworkBearerSelectionCallbackManager>(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
Try
{
if (event->getConnectionStateType() == CONNECTION_STATE_CONNECTED) {
- LogDebug("success callback");
+ LoggerD("success callback");
callbackManager->callOnSuccess();
} else if (event->getConnectionStateType() == CONNECTION_STATE_DISCONNECTED) {
- LogDebug("disconnect callback");
+ LoggerD("disconnect callback");
callbackManager->callOnDisconnected();
- } else if (event->getConnectionStateType() == CONNECTION_STATE_ERROR) {
+ } else if (event->getConnectionStateType() == CONNECTION_STATE_INVALID_VALUES_ERROR || event->getConnectionStateType() == CONNECTION_STATE_PLATFORM_ERROR) {
JSContextRef gContext = callbackManager->getContext();
JSValueRef error = NULL;
callbackManager->callOnError(error);
return;
}
- LogDebug("error callback");
+ LoggerD("error callback");
}
}
Catch(Exception)
{
- LogError("Error during processing answer.");
+ LoggerE("Error during processing answer.");
}
}
enum connectionStateType {
CONNECTION_STATE_DISCONNECTED = 0,
CONNECTION_STATE_CONNECTED = 1,
- CONNECTION_STATE_ERROR = 2
+ CONNECTION_STATE_INVALID_VALUES_ERROR = 2,
+ CONNECTION_STATE_PLATFORM_ERROR = 3
};
class OnNetworkBearerSelectionStateChanged : public WrtDeviceApis::Commons::ListenerEvent<OnNetworkBearerSelectionStateChanged>
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include "JSNetworkBearerSelection.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\NetworkBearerSelection ] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\NetworkBearerSelection ] on_widget_start_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\NetworkBearerSelection ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\NetworkBearerSelection ] on_widget_stop_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
try {
priv->setMainText(validator.toString(0, false, ""));
} catch (const BasePlatformException& err) {
- LogWarning("mainText convertion is failed. %s", err.getMessage().c_str());
+ LoggerW("mainText convertion is failed. %s", err.getMessage().c_str());
}
try {
priv->setSubText(validator.toString(1, true, ""));
} catch (const BasePlatformException& err) {
- LogWarning("subText convertion is failed. %s", err.getMessage().c_str());
+ LoggerW("subText convertion is failed. %s", err.getMessage().c_str());
}
JSObjectRef obj = JSObjectMake(context, getClassRef(), NULL);
{
if (!JSObjectGetPrivate(object)) {
NotificationManager *priv = new NotificationManager();
- LogDebug("initialize priv=" << priv);
+ LoggerD("initialize priv=" << priv);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
delete priv;
}
throw TypeMismatchException("Private object is NULL.");
}
- LogInfo("priv=" << priv);
+ LoggerI("priv=" << priv);
ArgumentValidator validator(context, argumentCount, arguments);
// notification
JSObjectRef notificationObj = validator.toObject(0, JSStatusNotification::getClassRef());
- LogInfo("Notification Obj: " << notificationObj);
+ LoggerI("Notification Obj: " << notificationObj);
StatusNotification *notification = JSStatusNotification::getPrivateObject(context, notificationObj);
- LogInfo("Notification : " << notification);
+ LoggerI("Notification : " << notification);
if (!notification) {
throw TypeMismatchException("Notification's private object is NULL.");
if(stream.fail())
throw TypeMismatchException("Notification's ID conversion is failed.");
- LogInfo ("posted notification id : " << stream.str());
+ LoggerI ("posted notification id : " << stream.str());
//delete notificaiton ID
JSStringRef propertyIDName = JSStringCreateWithUTF8CString(NOTIFICATION_ID);
AceSecurityStatus status = NOTIFICATION_CHECK_ACCESS(NOTIFICATION_FUNC);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
- LogInfo("remove All");
+ LoggerI("remove All");
try {
// Private Object
NotificationManager *priv = static_cast<NotificationManager*>(JSObjectGetPrivate(thisObject));
// id
std::string id = validator.toString(0);
- LogDebug("get notification id :" << id);
+ LoggerD("get notification id :" << id);
JSObjectRef obj = JSObjectMake(context, JSStatusNotification::getClassRef(), NULL); //make object
StatusNotification* noti = priv->get(id); // perform
JSStatusNotification::setPrivateObject(context, obj, noti);
{
StatusNotification *priv = static_cast<StatusNotification*>(JSObjectGetPrivate(object));
- LogDebug("statusNotification :" << priv);
+ LoggerD("statusNotification :" << priv);
if (!priv) {
throw TypeMismatchException("StatusNotification's private object is NULL.");
}
delete[] buffer;
}
- LogInfo("property =" << property);
+ LoggerI("property =" << property);
if ( property == STATUS_NOTIFICATION_PROGRESS_TYPE)
{
std::string strProgressType = JSUtil::JSValueToString(context, value);
- LogInfo("Progress Type : " << strProgressType);
+ LoggerI("Progress Type : " << strProgressType);
NotificationProgressType progType = NOTI_PROGRESS_TYPE_NONE;
if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE) == 0)
{
// progressValue
unsigned long progressVal = JSUtil::JSValueToULong(context, value);
- LogInfo("Progress Value : " << progressVal);
+ LoggerI("Progress Value : " << progressVal);
if ( priv->getProgressType() == NOTI_PROGRESS_TYPE_PERCENTAGE)
{
}
catch ( const BasePlatformException& err)
{
- LogWarning(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
+ LoggerW(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
}
{
StatusNotification *priv = static_cast<StatusNotification*>(JSObjectGetPrivate(object));
- LogDebug("statusNotification :" << priv);
+ LoggerD("statusNotification :" << priv);
if (!priv) {
throw TypeMismatchException("StatusNotification's private object is NULL.");
}
delete[] buffer;
}
- LogInfo("property =" << property);
+ LoggerI("property =" << property);
if ( property == STATUS_NOTIFICATION_PROGRESS_TYPE)
{
std::string type;
else if ( property == STATUS_NOTIFICATION_PROGRESS_VALUE)
{
// progressValue
- LogInfo("Progress Type=" << priv->getProgressType());
+ LoggerI("Progress Type=" << priv->getProgressType());
// progressValue
unsigned long progressVal = 0;
progressVal = (unsigned long)priv->getProgressValue();
}
- LogInfo("Progress Value=" << progressVal);
+ LoggerI("Progress Value=" << progressVal);
if( priv->getNotiType() != NOTI_TYPE_PROGRESS && progressVal == 0)
{
}
catch ( const BasePlatformException& err)
{
- LogWarning(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
+ LoggerW(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
return NULL;
}
void JSStatusNotification::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("JSStatusNotification::initialize, nothing ");
+ LoggerD("JSStatusNotification::initialize, nothing ");
}
void JSStatusNotification::finalize(JSObjectRef object)
//Status Notification Type.
NotificationType notiType = NOTI_TYPE_NONE;
std::string strStatusType = validator.toString(0, false, "");
- LogInfo("Notification Type : " << strStatusType);
+ LoggerI("Notification Type : " << strStatusType);
if( strStatusType.compare(TIZEN_STATUS_NOTIFICATION_TYPE_SIMPLE) == 0)
notiType = NOTI_TYPE_SIMPLE;
if (notiInitDict)
{
- LogInfo("Set Notification Init Dictionary");
+ LoggerI("Set Notification Init Dictionary");
//content
JSValueRef contentValue = JSUtil::getProperty(context, notiInitDict, NOTIFICATION_CONTENT);
if (!JSValueIsUndefined(context, contentValue))
#if 0
catch ( const BasePlatformException& err)
{
- LogWarning("notification's icon path convertion is failed." << err.getMessage());
+ LoggerW("notification's icon path convertion is failed." << err.getMessage());
}
#endif
{
JSValueRef progressTypeValue = JSUtil::getProperty(context, notiInitDict, STATUS_NOTIFICATION_PROGRESS_TYPE);
std::string strProgressType = JSUtil::JSValueToString(context, progressTypeValue);
- LogInfo("==Progress Type : " << strProgressType);
+ LoggerI("==Progress Type : " << strProgressType);
if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE) == 0)
progressType = NOTI_PROGRESS_TYPE_PERCENTAGE;
else if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_BYTE) == 0)
if (!JSValueIsUndefined(context, progressTypeValue))
{
std::string strProgressType = JSUtil::JSValueToString(context, progressTypeValue);
- LogInfo("==Progress Type : " << strProgressType);
+ LoggerI("==Progress Type : " << strProgressType);
if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE) == 0)
progressType = NOTI_PROGRESS_TYPE_PERCENTAGE;
else if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_BYTE) == 0)
NotificationDetailInfo* item = static_cast<NotificationDetailInfo*>(JSObjectGetPrivate(object));
std::string main = item->getMainText();
std::string sub = item->getSubText();
- LogInfo("Main : " << main << " Sub : " << sub);
+ LoggerI("Main : " << main << " Sub : " << sub);
NotificationDetailInfo *detailinfo = new NotificationDetailInfo(NULL, (int)i, main, sub);
detailInfos.push_back(detailinfo);
JSValueRef element = JSGetArrayElement(context, arrayobj, i);
DeviceAPI::Filesystem::IPathPtr thumbnailPath =
DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, element));
- LogInfo("thumbnail Path = " << thumbnailPath->getFullPath());
+ LoggerI("thumbnail Path = " << thumbnailPath->getFullPath());
thumbnailPaths.push_back(thumbnailPath->getFullPath());
}
}
}
catch ( const BasePlatformException& err)
{
- LogWarning(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
+ LoggerW(" notification convertion is failed. " << err.getName().c_str() << ":" << err.getMessage().c_str());
JSObjectRef error = JSWebAPIError::makeJSWebAPIError(context, err);
*exception = error;
return error;
StatusNotification* JSStatusNotification::getPrivateObject(JSContextRef context, JSObjectRef object)
{
- LogDebug("get object :" << object);
+ LoggerD("get object :" << object);
StatusNotification *priv = static_cast<StatusNotification*>(JSObjectGetPrivate(object));
- LogDebug("statusNotification :" << priv);
+ LoggerD("statusNotification :" << priv);
if (!priv) {
throw TypeMismatchException("StatusNotification's private object is NULL.");
}
JSValueRef element = JSGetArrayElement(context, arrayobj, i);
DeviceAPI::Filesystem::IPathPtr thumbnailPath =
DeviceAPI::Filesystem::Utils::fromVirtualPath(context, JSUtil::JSValueToString(context, element));
- LogInfo("thumbnail Path = " << thumbnailPath->getFullPath());
+ LoggerI("thumbnail Path = " << thumbnailPath->getFullPath());
thumbnailPaths.push_back(thumbnailPath->getFullPath());
}
}
// progressType
JSValueRef progressType = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_PROGRESS_TYPE);
std::string strProgressType = JSUtil::JSValueToString(context, progressType);
- LogInfo("Progress Type : " << strProgressType);
+ LoggerI("Progress Type : " << strProgressType);
NotificationProgressType progType = NOTI_PROGRESS_TYPE_NONE;
if( strProgressType.compare(TIZEN_NOTIFICATION_PROGRESS_TYPE_PERCENTAGE) == 0)
// progressValue
JSValueRef progressValue = JSUtil::getProperty(context, object, STATUS_NOTIFICATION_PROGRESS_VALUE);
- LogInfo(" Progress Value in Private Object = " << JSUtil::JSValueToULong(context, progressValue));
+ LoggerI(" Progress Value in Private Object = " << JSUtil::JSValueToULong(context, progressValue));
if ( progType == NOTI_PROGRESS_TYPE_PERCENTAGE)
{
if ( 100 < JSUtil::JSValueToULong(context, progressValue) )
// thumbnails
std::vector<std::string> thumbnails = priv->getThumbnails();
- LogInfo("Thumbnail Size : " << thumbnails.size());
+ LoggerI("Thumbnail Size : " << thumbnails.size());
JSValueRef tumbnailvalueArray[thumbnails.size()];
for( unsigned int i = 0 ; i < thumbnails.size(); i++) {
if (!thumbnails[i].empty())
{
- LogInfo("Thumbnail :" << thumbnails[i]);
+ LoggerI("Thumbnail :" << thumbnails[i]);
tumbnailvalueArray[i] = JSUtil::toJSValueRef(context, DeviceAPI::Filesystem::Utils::toVirtualPath(context, thumbnails[i]));
}
}
#if 0
// progressType & Value
- LogInfo("Progress Type=" << priv->getProgressType());
+ LoggerI("Progress Type=" << priv->getProgressType());
// progressValue
unsigned long progressVal = 0;
progressVal = (unsigned long)priv->getProgressValue();
}
- LogInfo("Progress Type=" << type);
+ LoggerI("Progress Type=" << type);
JSUtil::setProperty(context, object, STATUS_NOTIFICATION_PROGRESS_TYPE,
JSUtil::toJSValueRef(context, type), kJSPropertyAttributeNone);
- LogInfo("Progress Value =" << progressVal);
+ LoggerI("Progress Value =" << progressVal);
JSUtil::setProperty(context, object, STATUS_NOTIFICATION_PROGRESS_VALUE,
JSUtil::toJSValueRef(context, progressVal), kJSPropertyAttributeNone);
#endif
// detailInfo
std::vector<NotificationDetailInfo*> detailInfo = priv->getDetailInfos();
- LogInfo("detail Info Size : " << detailInfo.size());
+ LoggerI("detail Info Size : " << detailInfo.size());
JSObjectRef valueArray[detailInfo.size()];
for( unsigned int i = 0 ; i < detailInfo.size(); i++) {
if (detailInfo[i])
{
- LogInfo("Main = " << detailInfo[i]->getMainText() << " Sub = " << detailInfo[i]->getSubText());
+ LoggerI("Main = " << detailInfo[i]->getMainText() << " Sub = " << detailInfo[i]->getSubText());
valueArray[i] = JSObjectMake(GlobalContextManager::getInstance()->getGlobalContext(context), JSNotificationDetailInfo::getClassRef(), static_cast<void*>(detailInfo[i]));
JSNotificationDetailInfo::setPrivateObject(context, valueArray[i], detailInfo[i]);
- LogInfo("make Object : " << valueArray[i]);
+ LoggerI("make Object : " << valueArray[i]);
}
}
m_index(-1),
m_notiHandle(NULL)
{
- LogDebug("create by constructor");
+ LoggerD("create by constructor");
}
NotificationDetailInfo::NotificationDetailInfo(notification_h noti):
m_index(-1),
m_notiHandle(noti)
{
- LogDebug("create by constructor");
+ LoggerD("create by constructor");
}
NotificationDetailInfo::NotificationDetailInfo(std::string &mainText, std::string &subText):
m_mainText(mainText),
m_subText(subText)
{
- LogDebug("create DetilaInfo mainText:" << mainText << " subText:" << subText);
+ LoggerD("create DetilaInfo mainText:" << mainText << " subText:" << subText);
}
NotificationDetailInfo::NotificationDetailInfo(notification_h noti, int index, std::string &mainText, std::string &subText) :
m_updated(false),
m_mainText(mainText),
m_subText(subText),
- m_notiHandle(noti),
- m_index(index)
+ m_index(index),
+ m_notiHandle(noti)
{
- LogDebug("create DetilaInfo mainText:" << mainText << " subText:" << subText);
- LogDebug("handle:" << noti << " m_index:" << index);
+ LoggerD("create DetilaInfo mainText:" << mainText << " subText:" << subText);
+ LoggerD("handle:" << noti << " m_index:" << index);
}
NotificationDetailInfo::~NotificationDetailInfo()
{
//free.
- LogDebug(" ~NotificationDetailInfo");
+ LoggerD(" ~NotificationDetailInfo");
}
std::string NotificationDetailInfo::getMainText() const
{
-#if 0
- //return m_info;
- if (m_notiHandle && m_index >= 0)
- {
- LogDebug("index = " << m_index);
- int index = m_index;
- notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
- switch (index)
- {
- case 0:
- type = NOTIFICATION_TEXT_TYPE_INFO_1;
- break;
- case 1:
- type = NOTIFICATION_TEXT_TYPE_INFO_2;
- break;
- case 2:
- type = NOTIFICATION_TEXT_TYPE_INFO_3;
- break;
- default :
- type = NOTIFICATION_TEXT_TYPE_NONE;
- }
-
- char *info = NULL;
-
- if (NOTIFICATION_TEXT_TYPE_NONE != type && notification_get_text(m_notiHandle, type, &info) != NOTIFICATION_ERROR_NONE)
- {
- throw UnknownException("get notification information error");
- }
-
- std::string strInfo;
- if (info)
- strInfo = info;
- LogDebug(" info " << strInfo);
-
- return strInfo;
- }
- else
- {
- return m_mainText;
- }
-#endif
- LogInfo(" Main Text : " << m_mainText);
+ LoggerI(" Main Text : " << m_mainText);
return m_mainText;
}
void NotificationDetailInfo::setMainText(std::string mainText)
{
- LogInfo("mainText :" << mainText);
-#if 0
- if (m_notiHandle && m_index >= 0)
- {
- int idx = m_index;
- LogDebug(" index : " << idx);
- LogDebug(" mainText : " << mainText);
- notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
-
- switch (idx)
- {
- case 0:
- type = NOTIFICATION_TEXT_TYPE_INFO_1;
- break;
- case 1:
- type = NOTIFICATION_TEXT_TYPE_INFO_2;
- break;
- case 2:
- type = NOTIFICATION_TEXT_TYPE_INFO_3;
- break;
- default :
- type = NOTIFICATION_TEXT_TYPE_NONE;
- }
-
- if ( type != NOTIFICATION_TEXT_TYPE_NONE)
- {
- if (getMainText().compare(mainText))
- {
- if (notification_set_text(m_notiHandle, type, mainText.c_str(),
- NULL, NOTIFICATION_VARIABLE_TYPE_NONE) != NOTIFICATION_ERROR_NONE)
- {
- throw UnknownException("set notification sound error");
- }
- setUpdatedFlag(true);
- }
- }
- }
- else
- {
- m_mainText = mainText;
- }
-#endif
+ LoggerI("mainText :" << mainText);
m_mainText = mainText;
-
}
std::string NotificationDetailInfo::getSubText() const
{
-#if 0
- if (m_notiHandle && m_index >= 0)
- {
- int index = m_index;
- LogDebug(" index : " << index);
-
- notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
- switch (index)
- {
- case 0:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_1;
- break;
- case 1:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_2;
- break;
- case 2:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_3;
- break;
- default :
- type = NOTIFICATION_TEXT_TYPE_NONE;
- }
-
- char *subInfo = NULL;
-
- if (NOTIFICATION_TEXT_TYPE_NONE != type && notification_get_text(m_notiHandle, type, &subInfo) != NOTIFICATION_ERROR_NONE)
- {
- throw UnknownException("get notification sub information error");
- }
-
- std::string strSubInfo;
- if (subInfo)
- strSubInfo = subInfo;
- LogDebug(" sub info " << strSubInfo);
- return strSubInfo;
-
- }
- else
- {
- return m_subText;
- }
-#endif
- LogInfo("sub Text : " << m_subText);
+ LoggerI("sub Text : " << m_subText);
return m_subText;
-
}
void NotificationDetailInfo::setSubText(std::string subText)
{
- LogDebug("subText :" << subText);
-#if 0
- if (m_notiHandle && m_index >= 0)
- {
- int idx = m_index;
- LogDebug(" index : " << idx);
- LogDebug(" input value : " << subText);
- notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
-
- switch (idx)
- {
- case 0:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_1;
- break;
- case 1:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_2;
- break;
- case 2:
- type = NOTIFICATION_TEXT_TYPE_INFO_SUB_3;
- break;
- default :
- type = NOTIFICATION_TEXT_TYPE_NONE;
- }
-
- if ( type != NOTIFICATION_TEXT_TYPE_NONE)
- {
- if (getSubText().compare(subText))
- {
- if (notification_set_text(m_notiHandle, type, subText.c_str(),
- NULL, NOTIFICATION_VARIABLE_TYPE_NONE) != NOTIFICATION_ERROR_NONE)
- {
- throw UnknownException("set notification sound error");
- }
- setUpdatedFlag(true);
- }
- }
- }
- else
- {
- m_subText = subText;
- }
-#endif
+ LoggerD("subText :" << subText);
m_subText = subText;
}
m_notiHandle(NULL),
m_index(-1)
{
- LogDebug("created by constructor");
+ LoggerD("created by constructor");
}
NotificationLine::~NotificationLine()
m_notiHandle(noti),
m_index(index)
{
- LogDebug("create by notification");
+ LoggerD("create by notification");
}
NotificationLine::NotificationLine(notification_h noti, int index, std::string &info, std::string &subInfo):
m_notiHandle(noti),
m_index(index)
{
- LogDebug("create by notification with data" );
+ LoggerD("create by notification with data" );
}
std::string NotificationLine::getInformation() const
//return m_info;
if (m_notiHandle && m_index >= 0)
{
- LogDebug("index = " << m_index);
+ LoggerD("index = " << m_index);
int index = m_index;
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (index)
std::string strInfo;
if (info)
strInfo = info;
- LogDebug(" info " << strInfo);
+ LoggerD(" info " << strInfo);
return strInfo;
}
if (m_notiHandle && m_index >= 0)
{
int idx = m_index;
- LogDebug(" index : " << idx);
- LogDebug(" info : " << info);
+ LoggerD(" index : " << idx);
+ LoggerD(" info : " << info);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
if (m_notiHandle && m_index >= 0)
{
int index = m_index;
- LogDebug(" index : " << index);
+ LoggerD(" index : " << index);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (index)
std::string strSubInfo;
if (subInfo)
strSubInfo = subInfo;
- LogDebug(" sub info " << strSubInfo);
+ LoggerD(" sub info " << strSubInfo);
return strSubInfo;
}
if (m_notiHandle && m_index >= 0)
{
int idx = m_index;
- LogDebug(" index : " << idx);
- LogDebug(" input value : " << subInfo);
+ LoggerD(" index : " << idx);
+ LoggerD(" input value : " << subInfo);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
return false;
}
- LogDebug("handle package=" << handle_package);
+ LoggerD("handle package=" << handle_package);
if (app_get_package(&package))
{
cmdline[ret] = 0;
close(fd);
- LogDebug("package=" << package);
+ LoggerD("package=" << package);
if (strlen(cmdline) == strlen(handle_package))
{
}
else
{
- LogDebug("package=" << package);
+ LoggerD("package=" << package);
if (strlen(package) == strlen(handle_package))
{
if ( notification )
{
- LogInfo(" notification id = " << notification->getID());
+ LoggerI(" notification id = " << notification->getID());
notification_h handle = (notification_h)notification->getNotificationHandle();
- LogInfo("notification hanel :" << handle);
+ LoggerI("notification hanel :" << handle);
if ( handle )
{
{
if (notification->getLaunchFlag())
{
- LogInfo("Notification Launch Flag True");
+ LoggerI("Notification Launch Flag True");
notification_set_property(handle, 0);
notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
}
else
{
- LogInfo("Notification Launch Flag False");
+ LoggerI("Notification Launch Flag False");
notification_set_property(handle, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
}
}
}
- LogDebug(" Layout type = " << noti_layout);
+ LoggerD(" Layout type = " << noti_layout);
ret = notification_set_layout(handle, noti_layout);
- LogDebug("set Layout result= " << ret);
+ LoggerD("set Layout result= " << ret);
int privID = -1;
if (NOTIFICATION_ERROR_NONE == ret)
{
id = privID;
- LogDebug("private ID : " << privID);
+ LoggerD("private ID : " << privID);
notification->setUpdatedFlag(false);
}
else
{
throw UnknownException("get notification size error");
}
- LogInfo("get Size : " << value);
+ LoggerI("get Size : " << value);
notification_update_size(handle, NOTIFICATION_PRIV_ID_NONE, value);
if (notification_get_progress(handle, &value) != NOTIFICATION_ERROR_NONE)
{
throw UnknownException("get notification percentage error");
}
- LogInfo("get Percentage : " << value);
+ LoggerI("get Percentage : " << value);
notification_update_progress(handle, NOTIFICATION_PRIV_ID_NONE, value);
}
}
else
{
- LogDebug("it has not notification handle.");
+ LoggerD("it has not notification handle.");
throw UnknownException("It is Empty Notification.");
}
}
{
if (notification)
{
- LogDebug(" notification id = " << notification->getID());
+ LoggerD(" notification id = " << notification->getID());
notification_h handle = (notification_h)notification->getNotificationHandle();
- LogDebug("handle = " << handle);
+ LoggerD("handle = " << handle);
if (handle)
{
- LogDebug(" noti type = " << notification->getNotiType());
+ LoggerD(" noti type = " << notification->getNotiType());
if ( notification->getNotiType() == NOTI_TYPE_PROGRESS)
{
int ret = 0;
- LogDebug(" progress type = " << notification->getProgressType());
- LogDebug(" noti id = " << notification->getID());
- LogDebug(" noti progress value = " << notification->getProgressValue());
+ LoggerD(" progress type = " << notification->getProgressType());
+ LoggerD(" noti id = " << notification->getID());
+ LoggerD(" noti progress value = " << notification->getProgressValue());
if ( NOTI_PROGRESS_TYPE_PERCENTAGE == notification->getProgressType() )
{
- LogDebug( " Percentage ");
+ LoggerD( " Percentage ");
ret = notification_update_progress(handle, NOTIFICATION_PRIV_ID_NONE, notification->getProgressValue());
}
else if ( NOTI_PROGRESS_TYPE_SIZE == notification->getProgressType())
{
- LogDebug( " size ");
+ LoggerD( " size ");
ret = notification_update_size(handle, NOTIFICATION_PRIV_ID_NONE, notification->getProgressValue());
}
- LogDebug(" notification_update_progress = " << ret);
+ LoggerD(" notification_update_progress = " << ret);
if (NOTIFICATION_ERROR_NONE != ret)
{
}
- LogDebug(" updated Flag = " << notification->getUpdatedFlag());
+ LoggerD(" updated Flag = " << notification->getUpdatedFlag());
if ( notification->getUpdatedFlag())
{
}
}
- LogDebug(" Layout type = " << noti_layout);
+ LoggerD(" Layout type = " << noti_layout);
int ret = notification_set_layout(handle, noti_layout);
- LogDebug("set Layout result= " << ret);
+ LoggerD("set Layout result= " << ret);
bundle *service_data = NULL;
{
if (notification->getLaunchFlag())
{
- LogInfo("Notification Launch Flag True");
+ LoggerI("Notification Launch Flag True");
notification_set_property(handle, 0);
notification_set_execute_option(handle, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, service_data);
}
else
{
- LogInfo("Notification Launch Flag False");
+ LoggerI("Notification Launch Flag False");
notification_set_property(handle, NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
}
notification->setLaunchFlag(false);
- LogDebug(" get Title = " << notification->getTitle());
+ LoggerD(" get Title = " << notification->getTitle());
ret = notification_update(handle);
- LogDebug(" notification_update = " << ret);
+ LoggerD(" notification_update = " << ret);
notification->setUpdatedFlag(false); //init
if (ret != NOTIFICATION_ERROR_NONE)
throw UnknownException("Notification Object update fail, Error Code : ");
}
- LogDebug(" get Title = " << notification->getTitle());
+ LoggerD(" get Title = " << notification->getTitle());
}
}
else
{
- LogDebug("it has not notification handle.");
+ LoggerD("it has not notification handle.");
throw UnknownException("It is Empty Notification.");
}
}
else
{
- LogDebug(" INotification is NULL");
+ LoggerD(" INotification is NULL");
throw UnknownException("Notificaton Error.");
}
int ret = 0;
bool existFalg = false;
- LogDebug("id : " << id);
+ LoggerD("id : " << id);
std::istringstream stream(id);
if (stream.fail())
{
if (notification_get_grouping_list( NOTIFICATION_TYPE_NONE , -1, ¬i_list))
{
- LogDebug(" get notification list failed...");
+ LoggerD(" get notification list failed...");
throw UnknownException("Can't get noti list");
}
{
int noti_priv = -1;
notification_get_id(noti, NULL, ¬i_priv);
- LogDebug(" notification id = " << noti_priv);
+ LoggerD(" notification id = " << noti_priv);
if (noti_priv == privID)
existFalg = true;
}
if (noti_list)
notification_free_list(noti_list);
- LogDebug(" notification ID : "<< privID);
+ LoggerD(" notification ID : "<< privID);
if ( !existFalg )
throw NotFoundException("not exist id");
ret = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NONE, privID);
- LogDebug("ret = " << ret);
+ LoggerD("ret = " << ret);
if (ret != NOTIFICATION_ERROR_NONE)
{
if (ret == NOTIFICATION_ERROR_NOT_EXIST_ID)
{
int privID = 0;
- LogDebug("id : " << id);
+ LoggerD("id : " << id);
std::istringstream stream(id);
if (stream.fail())
{
}
std::vector<StatusNotification*> NotificationManager::getAll()
{
- LogDebug("OK");
+ LoggerD("OK");
std::vector<StatusNotification*> data;
notification_h noti = NULL;
if (notification_get_grouping_list( NOTIFICATION_TYPE_NONE , -1, ¬i_list))
{
- LogDebug(" get notification list failed...");
+ LoggerD(" get notification list failed...");
throw UnknownException("Can't get noti list");
}
{
int noti_priv = -1;
notification_get_id(noti, NULL, ¬i_priv);
- LogDebug(" notification id = " << noti_priv);
+ LoggerD(" notification id = " << noti_priv);
StatusNotification* notification = new StatusNotification(noti_priv);
notification_get_id((notification_h)notification->getNotificationHandle(), NULL, ¬i_priv);
- LogDebug("loaded notification id = " << noti_priv);
+ LoggerD("loaded notification id = " << noti_priv);
data.push_back(notification);
{
int noti_priv = -1;
notification_get_id(noti, NULL, ¬i_priv);
- LogDebug(" notification id = " << noti_priv);
+ LoggerD(" notification id = " << noti_priv);
StatusNotification* notification = new StatusNotification(noti_priv);
notification_get_id((notification_h)notification->getNotificationHandle(), NULL, ¬i_priv);
- LogDebug("loaded notification id = " << noti_priv);
+ LoggerD("loaded notification id = " << noti_priv);
data.push_back(notification);
//callback functions.
static bool service_extra_data_cb(service_h service, const char *key, void *user_data)
{
- LogInfo("OK");
+ LoggerI("OK");
char **value = NULL;
int length = 0;
if (user_data != NULL && key != NULL)
{
- LogInfo("user data & key is existed");
+ LoggerI("user data & key is existed");
DeviceAPI::Application::ApplicationControlPtr* appControl =
(DeviceAPI::Application::ApplicationControlPtr*)(user_data);
DeviceAPI::Application::ApplicationControlDataPtr data(new DeviceAPI::Application::ApplicationControlData());
- LogInfo("key = " << key);
+ LoggerI("key = " << key);
std::string keyStr = key;
std::vector<std::string> keyValue;
int index = 0;
if (service_get_extra_data_array((*appControl)->getService_h(), key, &value, &length) == SERVICE_ERROR_NONE)
{
- LogInfo("extra_data_array length = " << length);
+ LoggerI("extra_data_array length = " << length);
if (value != NULL && length != 0)
{
- LogInfo("extra_data_length = " << length);
+ LoggerI("extra_data_length = " << length);
data->setKey(key);
for (index = 0; index < length; index++)
{
- LogInfo("Value=" << value[index]);
+ LoggerI("Value=" << value[index]);
keyValue.push_back(value[index]);
}
return true;
}
+#if 0
static bool service_extra_data_delete_cb(service_h service, const char *key, void *user_data)
{
- LogInfo("OK");
+ LoggerI("OK");
if (key != NULL)
{
- LogInfo("del key = " << key);
+ LoggerI("del key = " << key);
if (service_remove_extra_data(service, key) != SERVICE_ERROR_NONE)
{
- LogWarning("remove extra data failed");
+ LoggerW("remove extra data failed");
return false;
}
}
return true;
}
+#endif
StatusNotification::StatusNotification(NotificationType statusType) :
m_notiType(NOTI_TYPE_NONE),
m_notiUpdated(false),
m_launchFlag(false)
{
- LogInfo("statusType =" << statusType);
+ LoggerI("statusType =" << statusType);
notification_type_e type = NOTIFICATION_TYPE_NONE;
setNotiType(statusType);
}
else
{
- LogInfo(" invalide noti type");
+ LoggerI(" invalide noti type");
throw TypeMismatchException("value is not notification type");
}
setProgressType(NOTI_PROGRESS_TYPE_PERCENTAGE); //default
- LogInfo("Notification Type : " << type);
+ LoggerI("Notification Type : " << type);
notification_h noti = notification_create(type); //create notificatin.
if ( noti )
{
- LogInfo("noti =" << noti);
+ LoggerI("noti =" << noti);
setNotificationHandle((void*)noti);
if (NOTIFICATION_TYPE_ONGOING == type)
{ //ongoing no ticker.
- LogInfo("ongoing type");
+ LoggerI("ongoing type");
notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY |NOTIFICATION_DISPLAY_APP_INDICATOR );
}
}
m_notiUpdated(false),
m_launchFlag(false)
{
- LogInfo("noti : " << noti);
+ LoggerI("noti : " << noti);
notification_h notification = (notification_h)noti;
}
}
- LogInfo(" notification type =" << type);
+ LoggerI(" notification type =" << type);
setNotiType(type);
setProgressType(NOTI_PROGRESS_TYPE_PERCENTAGE); //default.
bundle *bSvc = NULL;
int ret = notification_get_execute_option(notification, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, &bSvc);
- LogInfo("ret = " << ret);
+ LoggerI("ret = " << ret);
if (ret == NOTIFICATION_ERROR_NONE)
{
- LogInfo(" bundle = " << bSvc);
+ LoggerI(" bundle = " << bSvc);
if (bSvc)
{
- LogInfo("bundle is valid");
+ LoggerI("bundle is valid");
int ret = service_create_event(bSvc, &m_service);
if (ret != SERVICE_ERROR_NONE)
{
- LogInfo("Service Create Event Error");
+ LoggerI("Service Create Event Error");
throw UnknownException("can't make service object");
}
}
m_notiUpdated(false),
m_launchFlag(false)
{
- LogInfo("priv ID : " << privID);
+ LoggerI("priv ID : " << privID);
notification_h notification = notification_load( NULL, privID); //load notification.
- LogInfo(" notification " << notification);
+ LoggerI(" notification " << notification);
if ( notification )
{
}
}
- LogInfo(" notification type =" << type);
+ LoggerI(" notification type =" << type);
setNotiType(type);
setProgressType(NOTI_PROGRESS_TYPE_PERCENTAGE); //default.
setNotificationHandle((void*)notification);
bundle *bSvc = NULL;
int ret = notification_get_execute_option(notification, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, &bSvc);
- LogInfo("ret = " << ret);
+ LoggerI("ret = " << ret);
if (ret == NOTIFICATION_ERROR_NONE)
{
- LogInfo(" bundle = " << bSvc);
+ LoggerI(" bundle = " << bSvc);
if (bSvc)
{
- LogInfo("bundle is valid");
+ LoggerI("bundle is valid");
int ret = service_create_event(bSvc, &m_service);
if (ret != SERVICE_ERROR_NONE)
{
- LogInfo("Service Create Event Error");
+ LoggerI("Service Create Event Error");
throw UnknownException("can't make service object");
}
}
StatusNotification::~StatusNotification()
{
- LogInfo(" notification = " << m_notiHandle);
+ LoggerI(" notification = " << m_notiHandle);
//clear thumbnail.
//clearDetailInfos();
if (m_notiHandle)
{
#if 0
- LogInfo(" service = " << m_service);
+ LoggerI(" service = " << m_service);
if (m_service != NULL)
{
service_destroy(m_service);
void StatusNotification::setStatusType(std::string type)
{
- LogInfo("type = " << type);
+ LoggerI("type = " << type);
NotificationType notiType = NOTI_TYPE_NONE;
else
throw InvalidValuesException("Invalid Status Type.");
- LogInfo("Notification type = " << notiType);
+ LoggerI("Notification type = " << notiType);
setNotiType(notiType);
}
time_t StatusNotification::getPostedTime()
{
- LogInfo("get m_notiHandle = " << m_notiHandle);
+ LoggerI("get m_notiHandle = " << m_notiHandle);
time_t postedTime = 0;
}
}
- LogInfo("posted Time =" << ctime(&postedTime));
+ LoggerI("posted Time =" << ctime(&postedTime));
return postedTime;
}
void StatusNotification::setTitle(std::string title)
{
- LogInfo("Title : " << title);
+ LoggerI("Title : " << title);
if (m_notiHandle)
{
- LogInfo("get Title : " << getTitle());
+ LoggerI("get Title : " << getTitle());
if((getTitle()).compare(title)) //different value.
{
if (notification_set_text(m_notiHandle, NOTIFICATION_TEXT_TYPE_TITLE, title.c_str(),
}
else
{
- LogInfo(" title = " << title << " getTitle = " << getTitle());
+ LoggerI(" title = " << title << " getTitle = " << getTitle());
}
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
std::string StatusNotification::getContent()
{
- LogInfo("get Content handle: " << m_notiHandle);
+ LoggerI("get Content handle: " << m_notiHandle);
if (m_notiHandle)
{
char *content = NULL;
throw UnknownException("get notification Content error");
}
- LogInfo(" get Content : " << content);
+ LoggerI(" get Content : " << content);
std::string notiContent;
char* StatusNotification::getStrContent()
{
- LogInfo("get Content handle: " << m_notiHandle);
+ LoggerI("get Content handle: " << m_notiHandle);
if (m_notiHandle)
{
char *content = NULL;
void StatusNotification::setContent(std::string content)
{
- LogInfo("Content : " << content);
+ LoggerI("Content : " << content);
if (m_notiHandle)
{
if((getContent()).compare(content)) //different value.
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
std::string StatusNotification::getIconPath()
{
- LogInfo("m_notiHandle = " << m_notiHandle);
+ LoggerI("m_notiHandle = " << m_notiHandle);
if (m_notiHandle)
{
char *iconPath = NULL;
}
std::string notiIconPath(iconPath);
- LogInfo("icon Path = " << iconPath);
+ LoggerI("icon Path = " << iconPath);
//if icon path invalid, return empty string.
if ( notiIconPath.find(DEFAULT_ICON_PATH,0) == std::string::npos)
{
if (m_notiHandle)
{
- LogInfo("icon path = " << iconPath << " origin icon path = " << getIconPath());
+ LoggerI("icon path = " << iconPath << " origin icon path = " << getIconPath());
if( getIconPath().compare(iconPath))
{
if (notification_set_image(m_notiHandle,NOTIFICATION_IMAGE_TYPE_ICON, iconPath.c_str()) != NOTIFICATION_ERROR_NONE)
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
std::string StatusNotification::getSoundPath()
{
- LogInfo("Handle = " << m_notiHandle);
+ LoggerI("Handle = " << m_notiHandle);
if (m_notiHandle)
{
throw UnknownException("get notification sound error");
}
- LogInfo(" sound type = " << type << " path = " << soundPath);
+ LoggerI(" sound type = " << type << " path = " << soundPath);
if ( type == NOTIFICATION_SOUND_TYPE_USER_DATA )
{
- LogInfo("soundPath = " << soundPath);
+ LoggerI("soundPath = " << soundPath);
return std::string(soundPath);
}
else
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
{
if (m_notiHandle)
{
- LogInfo("sound path = " << sound << " origin sound path = " << getSoundPath());
+ LoggerI("sound path = " << sound << " origin sound path = " << getSoundPath());
if( getSoundPath().compare(sound))
{
if (sound.empty())
{
- LogInfo("sound path is NULL");
+ LoggerI("sound path is NULL");
if ( NOTI_TYPE_ONGOING == getNotiType() || NOTI_TYPE_PROGRESS == getNotiType())
{
- LogInfo("Ongoing Type" );
+ LoggerI("Ongoing Type" );
if (notification_set_sound(m_notiHandle,NOTIFICATION_SOUND_TYPE_NONE, NULL) != NOTIFICATION_ERROR_NONE)
{
throw UnknownException("set notification sound error");
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
bool StatusNotification::getDefaultVibration()
{
- LogInfo("getDefaultVibration");
+ LoggerI("getDefaultVibration");
if (m_notiHandle)
{
notification_vibration_type_e vib_type;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
void StatusNotification::setDefaultVibration(const bool& vibration)
{
- LogInfo("vibration = " << vibration);
+ LoggerI("vibration = " << vibration);
if (m_notiHandle)
{
notification_vibration_type_e vib_type = NOTIFICATION_VIBRATION_TYPE_NONE;
- LogInfo("old vibration = " << getDefaultVibration());
+ LoggerI("old vibration = " << getDefaultVibration());
if (getDefaultVibration() != vibration)
{
if (vibration)
{
vib_type = NOTIFICATION_VIBRATION_TYPE_NONE;
}
- LogInfo("type vibration type= " << vib_type);
+ LoggerI("type vibration type= " << vib_type);
if (notification_set_vibration(m_notiHandle, vib_type , NULL) != NOTIFICATION_ERROR_NONE)
{
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
// mandatory
if(service_get_operation(m_service, &tempStr) == SERVICE_ERROR_NONE)
{
- LogDebug("Operation Str = " << tempStr);
+ LoggerD("Operation Str = " << tempStr);
if (tempStr)
{
appControl->setOperation(tempStr);
// optional
if (service_get_mime(m_service, &tempStr) == SERVICE_ERROR_NONE)
{
- LogDebug("Mime Str = " << tempStr);
+ LoggerD("Mime Str = " << tempStr);
if (tempStr)
{
appControl->setMime(tempStr);
// optional
if (service_get_uri(m_service, &tempStr) == SERVICE_ERROR_NONE)
{
- LogDebug("Uri Str = " << tempStr);
+ LoggerD("Uri Str = " << tempStr);
if (tempStr)
{
appControl->setUri(tempStr);
if (service_get_category(m_service, &tempStr) == SERVICE_ERROR_NONE)
{
- LogDebug("Category Str = " << tempStr);
+ LoggerD("Category Str = " << tempStr);
if (tempStr)
{
appControl->setCategory(tempStr);
service = NULL;
}
- LogWarning(_rethrown_exception.GetMessage());
+ LoggerW(_rethrown_exception.GetMessage());
}
return appControl;
void StatusNotification::setApplicationControl(DeviceAPI::Application::ApplicationControlPtr control)
{
- LogInfo("Entered m_service : " << m_service << " control : " << control);
+ LoggerI("Entered m_service : " << m_service << " control : " << control);
//delete old service.
if (m_service)
}
else
{
- LogInfo("getOperation : " << control->getOperation().c_str());
+ LoggerI("getOperation : " << control->getOperation().c_str());
if (control->getOperation().size() != 0)
{
m_launchFlag = true; //default attribute
}
// optional
- LogInfo("getUri : " << control->getUri().c_str());
+ LoggerI("getUri : " << control->getUri().c_str());
if (control->getUri().size() != 0)
{
if (service_set_uri(m_service, control->getUri().c_str() ) != SERVICE_ERROR_NONE)
}
// optional
- LogInfo("getMime : " << control->getMime().c_str());
+ LoggerI("getMime : " << control->getMime().c_str());
if (control->getMime().size() != 0)
{
if (service_set_mime(m_service, control->getMime().c_str() ) != SERVICE_ERROR_NONE)
}
}
- LogInfo("Category : " << control->getCategory().c_str());
+ LoggerI("Category : " << control->getCategory().c_str());
if (control->getCategory().size() != 0)
{
if (service_set_category(m_service, control->getCategory().c_str() ) != SERVICE_ERROR_NONE)
throw UnknownException("service set mime error");
}
}
-
+#if 0
//remove key
- //if ( service_foreach_extra_data(m_service, service_extra_data_delete_cb, NULL) != SERVICE_ERROR_NONE)
- //{
- // throw UnknownException("get notification service uri error");
- //}
-
+ if ( service_foreach_extra_data(m_service, service_extra_data_delete_cb, NULL) != SERVICE_ERROR_NONE)
+ {
+ throw UnknownException("get notification service uri error");
+ }
+#endif
std::vector<DeviceAPI::Application::ApplicationControlDataPtr> appControlDataArray = control->getAppControlDataArray();
size_t index = 0;
- LogInfo (" App Control Datas Count : " << appControlDataArray.size());
+ LoggerI (" App Control Datas Count : " << appControlDataArray.size());
DeviceAPI::Application::ApplicationControlDataArray::iterator iter;
{
DeviceAPI::Application::ApplicationControlDataPtr appControlData = *iter;
std::string key = appControlData->getKey();
- LogInfo(" key : " << key);
+ LoggerI(" key : " << key);
if (key.empty())
continue;
for (size_t indexArray = 0; indexArray < value.size(); indexArray++)
{
arrayValue[indexArray] = (char*)value[indexArray].c_str();
- LogInfo( " value : " << arrayValue[indexArray]);
+ LoggerI( " value : " << arrayValue[indexArray]);
}
const char* strKey = key.c_str();
- LogInfo( " value size: " << value.size());
+ LoggerI( " value size: " << value.size());
if (service_add_extra_data_array(m_service, strKey, arrayValue, value.size()) != SERVICE_ERROR_NONE)
{
throw UnknownException("service set extra data error");
throw UnknownException("service get bundle");
}
- LogDebug("bundle_data : " << bundle_data);
+ LoggerD("bundle_data : " << bundle_data);
if (bundle_data)
{
void StatusNotification::setApplicationId(const std::string& appId)
{
- LogInfo("m_service = " << m_service << " appId = " << appId);
+ LoggerI("m_service = " << m_service << " appId = " << appId);
if (!m_service)
{
if (service_create(&m_service) != SERVICE_ERROR_NONE)
{
- LogWarning("Create Service Failed..");
+ LoggerW("Create Service Failed..");
throw UnknownException("service creation error");
}
}
{
if (retcode == SERVICE_ERROR_OUT_OF_MEMORY)
{
- LogWarning("SERVICE_ERROR_OUT_OF_MEMORY");
+ LoggerW("SERVICE_ERROR_OUT_OF_MEMORY");
}
else
{
- LogWarning("UI_NOTIFICATION_ERROR_INVALID_PARAMETER");
+ LoggerW("UI_NOTIFICATION_ERROR_INVALID_PARAMETER");
}
throw UnknownException ("get notification service error ");
}
free(appIdStr);
}
}
- LogInfo(retString);
+ LoggerI(retString);
return retString;
{
throw UnknownException("get notification size error");
}
- LogInfo("Size Val = " << value);
+ LoggerI("Size Val = " << value);
}
else if ( progressType == NOTI_PROGRESS_TYPE_PERCENTAGE )
{
{
throw UnknownException("get notification percentage error");
}
- LogInfo("Percentage Val = " << value);
+ LoggerI("Percentage Val = " << value);
}
else
{
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
}
- LogInfo("value = " << value);
+ LoggerI("value = " << value);
return value;
}
if (m_notiHandle)
{
NotificationProgressType progressType = getProgressType();
- LogInfo("Progress Type : " << progressType);
+ LoggerI("Progress Type : " << progressType);
double val = getProgressValue();
- LogInfo("Progress value = " << progressValue << " origin Progress Value =" << val);
+ LoggerI("Progress value = " << progressValue << " origin Progress Value =" << val);
if (progressType == NOTI_PROGRESS_TYPE_SIZE)
{
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
std::string StatusNotification::getSubIconPath()
{
- LogInfo("Handle = " << m_notiHandle);
+ LoggerI("Handle = " << m_notiHandle);
if (m_notiHandle)
{
char *subIconPath = NULL;
{
if (m_notiHandle)
{
- LogInfo(" subIconPath = " << subIconPath << " origin SubIconPath = " << getSubIconPath());
+ LoggerI(" subIconPath = " << subIconPath << " origin SubIconPath = " << getSubIconPath());
if( getSubIconPath().compare(subIconPath))
{
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
std::string strInfo;
if (info)
strInfo = info;
- LogDebug(" info " << strInfo);
+ LoggerD(" info " << strInfo);
return strInfo;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
if (m_notiHandle)
{
int idx = index;
- LogDebug(" index : " << idx);
- LogDebug(" log : " << info);
+ LoggerD(" index : " << idx);
+ LoggerD(" log : " << info);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
std::string strSubInfo;
if (subInfo)
strSubInfo = subInfo;
- LogDebug(" subInfo " << strSubInfo);
+ LoggerD(" subInfo " << strSubInfo);
return strSubInfo;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
if (m_notiHandle)
{
int idx = index;
- LogDebug(" index : " << idx);
- LogDebug(" log : " << subInfo);
+ LoggerD(" index : " << idx);
+ LoggerD(" log : " << subInfo);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
std::vector<std::string> StatusNotification::getThumbnails()
{
- LogInfo(" thumbnail Size : " << m_thumbs.size());
+ LoggerI(" thumbnail Size : " << m_thumbs.size());
return m_thumbs;
}
{
if (m_notiHandle)
{
- LogInfo(" index : " << index);
+ LoggerI(" index : " << index);
notification_image_type_e type = NOTIFICATION_IMAGE_TYPE_NONE;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
#if 0
void StatusNotification::setThumbnails(std::vector<std::string> thumbs)
{
- LogInfo("set thumbnails");
+ LoggerI("set thumbnails");
if (m_notiHandle)
{
std::vector<std::string>::iterator it;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
{
if (m_notiHandle)
{
- LogInfo(" index : " << index);
- LogInfo(" thumb : " << thumb);
+ LoggerI(" index : " << index);
+ LoggerI(" thumb : " << thumb);
notification_image_type_e type = NOTIFICATION_IMAGE_TYPE_NONE;
switch (index)
std::string StatusNotification::getBackground()
{
- LogInfo(" Handle : " << m_notiHandle);
+ LoggerI(" Handle : " << m_notiHandle);
if (m_notiHandle)
{
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
void StatusNotification::setBackground(const std::string imagePath)
{
- LogInfo(" imagePath : " << imagePath);
+ LoggerI(" imagePath : " << imagePath);
if (m_notiHandle)
{
if (getBackground().compare(imagePath))
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
long StatusNotification::getNumber()
{
- LogInfo("Handle = " << m_notiHandle);
+ LoggerI("Handle = " << m_notiHandle);
if (m_notiHandle)
{
long number = 0;
if (strNumber)
std::istringstream(strNumber) >> number;
else
- LogInfo("Number Is NULL");
+ LoggerI("Number Is NULL");
- LogInfo("number = " << number);
+ LoggerI("number = " << number);
return number;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
return 0;
}
}
const char* StatusNotification::getStrNumber()
{
- LogInfo("Handle = " << m_notiHandle);
+ LoggerI("Handle = " << m_notiHandle);
if (m_notiHandle)
{
char *strNumber = NULL;
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
return NULL;
}
}
void StatusNotification::setNumber(const long number)
{
- LogInfo("Number = " << number);
+ LoggerI("Number = " << number);
if (m_notiHandle)
{
if(number!=getNumber())
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
}
{
throw UnknownException( "notification handle null error");
}
- LogInfo("handle = " << handle << " m_notiHandle = " << m_notiHandle);
+ LoggerI("handle = " << handle << " m_notiHandle = " << m_notiHandle);
if (m_notiHandle != NULL)
{
//Detail Info
void StatusNotification::loadDetailInfos()
{
- LogInfo("noti Handle = " << m_notiHandle);
+ LoggerI("noti Handle = " << m_notiHandle);
if (m_notiHandle)
{
{
std::string main = getInformation(idx);
std::string sub = getSubInformation(idx);
- LogInfo("Main : " << main << " Sub : " << sub);
+ LoggerI("Main : " << main << " Sub : " << sub);
NotificationDetailInfo *info = new NotificationDetailInfo(m_notiHandle, idx, main, sub);
m_detailInfos.push_back(info);
}
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
void StatusNotification::setDetailInfos(const std::vector<NotificationDetailInfo*> value)
{
- LogInfo("DetailInfos = " << value.size());
+ LoggerI("DetailInfos = " << value.size());
if (m_notiHandle)
{
NotificationDetailInfo* info = *it;
if ( idx < MAX_NOTIFICATION_DETAIL_INFO_LENGTH )
{
- LogInfo("main " << info->getMainText() << " sub " << info->getSubText() );
+ LoggerI("main " << info->getMainText() << " sub " << info->getSubText() );
setInformation(info->getMainText(), idx);
setSubInformation(info->getSubText(), idx);
}
}
else
{
- LogDebug("noti Handle is NULL");
+ LoggerD("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
for (it = m_detailInfos.begin(); it < m_detailInfos.end(); ++it)
{
NotificationDetailInfo* info = *it;
- LogInfo("Delete Detail Info : " << info);
+ LoggerI("Delete Detail Info : " << info);
if (info)
delete info;
idx ++;
std::string strInfo;
if (info)
strInfo = info;
- LogInfo(" info " << strInfo);
+ LoggerI(" info " << strInfo);
return strInfo;
}
else
{
- LogWarning("noti Handle is NULL");
+ LoggerW("noti Handle is NULL");
throw UnknownException( "notification handle is null");
}
std::string strSubInfo;
if (subInfo)
strSubInfo = subInfo;
- LogInfo(" subInfo " << strSubInfo);
+ LoggerI(" subInfo " << strSubInfo);
return strSubInfo;
}
else
{
- LogWarning("noti Handle is NULL");
+ LoggerW("noti Handle is NULL");
throw UnknownException ("notification handle is null");
}
if (m_notiHandle)
{
int idx = index;
- LogDebug(" index : " << idx);
- LogDebug(" log : " << info);
+ LoggerD(" index : " << idx);
+ LoggerD(" log : " << info);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
}
else
{
- LogWarning("noti Handle is NULL");
+ LoggerW("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
else
{
- LogWarning("noti Handle is NULL");
+ LoggerW("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
if (m_notiHandle)
{
int idx = index;
- LogDebug(" index : " << idx);
- LogDebug(" log : " << subInfo);
+ LoggerD(" index : " << idx);
+ LoggerD(" log : " << subInfo);
notification_text_type_e type = NOTIFICATION_TEXT_TYPE_NONE;
switch (idx)
}
else
{
- LogWarning("noti Handle is NULL");
+ LoggerW("noti Handle is NULL");
throw UnknownException("notification handle is null");
}
}
void setUpdatedFlag(bool value)
{
if (value)
- LogDebug("set True");
+ LoggerD("set True");
m_notiUpdated = value;
}
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Notification] on_widget_start_callback (%d)" << widgetId);
+ LoggerD("[Tizen\\Notification] on_widget_start_callback (%d)" << widgetId);
TIME_TRACER_INIT();
try {
WrtAccessSingleton::Instance().initialize(widgetId);
} catch (...) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Notification] on_widget_stop_callback (%d)" << widgetId);
+ LoggerD("[Tizen\\Notification] on_widget_stop_callback (%d)" << widgetId);
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Notification");
TIME_TRACER_RELEASE();
try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} catch (...) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Notification] on_frame_load_callback (%p)" << context);
+ LoggerD("[Tizen\\Notification] on_frame_load_callback (%p)" << context);
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Notification] on_frame_unload_callback (%p)" << context);
+ LoggerD("[Tizen\\Notification] on_frame_unload_callback (%p)" << context);
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
//
#include <JSWebAPIException.h>
-
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/JSUtils.h>
#include <CommonsJavaScript/Utils.h>
#include <JSUtil.h>
-
-#include <dlog.h>
-
#include "JSPackageInformation.h"
#include "PackageInformation.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Package {
JSValueRef JSPackageInformation::createJSObject(JSContextRef context, PackageInformation *pkgInfo)
{
- //LogError("createJSObject enter");
+ //LoggerE("createJSObject enter");
JSObjectRef jsValueRef = JSObjectMake(context, getClassRef(), static_cast<void*>(pkgInfo));
if (NULL == jsValueRef) {
- LogError("object creation error");
+ LoggerE("object creation error");
return JSValueMakeUndefined(context);
}
void JSPackageInformation::initialize(JSContextRef context, JSObjectRef object)
{
- LOGI(">> initialize");
+ LoggerD(">> initialize");
}
void JSPackageInformation::finalize(JSObjectRef object)
{
- LOGI(">> finalize");
+ LoggerD(">> finalize");
}
bool JSPackageInformation::isObjectOfClass(JSContextRef context, JSValueRef value)
#include <JSUtil.h>
#include <GlobalContextManager.h>
#include <TimeTracer.h>
-#include <dlog.h>
#include "JSPackageManager.h"
#include "JSPackageInformation.h"
#include "PackageManager.h"
#include "PackageInformation.h"
#include "plugin_config.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Package {
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_INSTALL);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_INSTALL);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_GET_PACKAGES_INFO);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_GET_PACKAGE_INFO);
try {
ArgumentValidator validator(context, argumentCount, arguments);
string id = validator.toString(0, true);
- //LogDebug("id = " << id);
+ //LoggerD("id = " << id);
PackageInformation* pkgInfo = PackageManager::getInstance()->getPackageInfo(id);
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_SET_PACKAGE_INFO_EVENT_LISTENER);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_UNSET_PACKAGE_INFO_EVENT_LISTENER);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
//AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_MOVE);
//TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
PackageManager::getInstance()->move(id, storage, pkgInstallEventCB);
} Catch (NotFoundException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
} Catch (ConversionException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
//AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_IS_INSTALLED);
//TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
return converter.toJSValueRef(PackageManager::getInstance()->isInstalled(id));
} Catch (NotFoundException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
} Catch (ConversionException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
//AceSecurityStatus status = PACKAGE_CHECK_ACCESS(PACKAGE_FUNCTION_API_GET_PACKAGE_ID_FROM_APP_ID);
//TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
return converter.toJSValueRef(PackageManager::getInstance()->getPackageIdFromAppId(id));
} Catch (NotFoundException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_FOUND_ERROR, _rethrown_exception.GetMessage());
} Catch (ConversionException) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, _rethrown_exception.GetMessage());
} Catch (Exception) {
- LogWarning("Exception: "<<_rethrown_exception.GetMessage());
+ LoggerW("Exception: "<<_rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, _rethrown_exception.GetMessage());
}
#define _TIZEN_PACKAGE_INFORMATION_H_
#include <string>
-#include <dpl/log/log.h>
+#include <vector>
namespace DeviceAPI {
namespace Package {
// limitations under the License.
//
-#include <dlog.h>
#include <glib.h>
#include <JSTizenExceptionFactory.h>
#include "PackageManager.h"
#include "PackageInformation.h"
#include "JSPackageInformation.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
m_oninstalled = oninstalled;
m_onupdated = onupdated;
m_onuninstalled = onuninstalled;
+ m_handle_p = NULL;
}
PackageInfoEventCallback::~PackageInfoEventCallback()
return m_onuninstalled;
}
+pkgmgr_client** PackageInfoEventCallback::getEventHandler()
+{
+ return m_handle_p;
+}
+
+void PackageInfoEventCallback::setEventHandler(pkgmgr_client **handler)
+{
+ m_handle_p = handler;
+}
PackageInstallEventCallback::PackageInstallEventCallback(JSContextRef globalCtx, CallbackUserData* onprogress, CallbackUserData* oncomplete, CallbackUserData* onerror)
{
PackageInstallEventCallback::~PackageInstallEventCallback()
{
if (m_request_handle != NULL) {
- LogDebug("destroy client handle");
+ LoggerD("destroy client handle");
//package_manager_request_destroy(m_request_handle);
package_manager_client_destroy(m_request_handle);
}
static int get_current_pkg_id(char** pkg_id)
{
- LogDebug("get_current_pkg_id enter");
+ LoggerD("get_current_pkg_id enter");
int parent_pid = getppid();
- LogDebug("parent pid : " << parent_pid);
+ LoggerD("parent pid : " << parent_pid);
char* app_id = NULL;
app_info_h handle;
int ret = app_manager_get_app_id(parent_pid, &app_id);
if ((ret != APP_MANAGER_ERROR_NONE) || (app_id == NULL)) {
- LogDebug("Cannot get app id from pid : " << parent_pid);
+ LoggerD("Cannot get app id from pid : " << parent_pid);
return ret;
} else {
- LogDebug("app_id : " << app_id);
+ LoggerD("app_id : " << app_id);
}
ret = app_manager_get_app_info(app_id, &handle);
if (ret != APP_MANAGER_ERROR_NONE) {
- LogDebug("Fail to get appinfo by " << app_id);
+ LoggerD("Fail to get appinfo by " << app_id);
return ret;
}
ret = app_info_get_package(handle, pkg_id);
if ((ret != APP_MANAGER_ERROR_NONE) || (*pkg_id == NULL)) {
- LogDebug("Fail to get pkg_id by " << app_id);
+ LoggerD("Fail to get pkg_id by " << app_id);
return ret;
}
ret = app_info_destroy(handle);
if (ret != APP_MANAGER_ERROR_NONE) {
- LogDebug("Fail to get destory appinfo");
+ LoggerD("Fail to get destory appinfo");
return ret;
}
static bool app_callback(package_info_app_component_type_e comp_type, const char *app_id, void *user_data)
{
- //LogDebug("app_callback enter : " << app_id);
+ //LoggerD("app_callback enter : " << app_id);
PackageInformation* pkgInfo = (PackageInformation*)user_data;
pkgInfo->m_appIds.push_back(app_id);
return true;
static PackageInformation* create_pkg_info(pkgmgrinfo_pkginfo_h handle)
{
- //LogDebug("enter");
+ //LoggerD("enter");
PackageInformation *pkgInfo = new PackageInformation();
ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &id);
if ((ret != PMINFO_R_OK) || (id == NULL)) {
- LogDebug("Fail to get id. return NULL.");
+ LoggerD("Fail to get id. return NULL.");
delete pkgInfo;
return NULL;
} else {
ret = pkgmgrinfo_pkginfo_get_label(handle, &name);
if ((ret != PMINFO_R_OK) || (name == NULL)) {
- LogDebug("Fail to get labe");
+ LoggerD("Fail to get labe");
} else {
pkgInfo->m_name = name;
}
ret = pkgmgrinfo_pkginfo_get_icon(handle, &iconPath);
if ((ret != PMINFO_R_OK) || (iconPath == NULL)) {
- LogDebug("Fail to get iconPath");
+ LoggerD("Fail to get iconPath");
} else {
pkgInfo->m_iconPath = iconPath;
}
ret = pkgmgrinfo_pkginfo_get_version(handle, &version);
if ((ret != PMINFO_R_OK) || (version == NULL)) {
- LogDebug("Fail to get version");
+ LoggerD("Fail to get version");
} else {
pkgInfo->m_version = version;
}
ret = pkgmgrinfo_pkginfo_get_total_size(handle, &totalSize);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get totalSize");
+ LoggerD("Fail to get totalSize");
} else {
pkgInfo->m_totalSize = totalSize;
}
ret = pkgmgrinfo_pkginfo_get_data_size(handle, &dataSize);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get dataSize");
+ LoggerD("Fail to get dataSize");
} else {
pkgInfo->m_dataSize = dataSize;
}
ret = pkgmgrinfo_pkginfo_get_installed_time(handle, &lastModified);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get lastModified");
+ LoggerD("Fail to get lastModified");
} else {
pkgInfo->m_lastModified = lastModified;
}
ret = pkgmgrinfo_pkginfo_get_type(handle, &type);
if ((ret != PMINFO_R_OK) || (type == NULL)) {
- LogDebug("Fail to get type");
+ LoggerD("Fail to get type");
} else {
pkgInfo->m_type = type;
}
ret = pkgmgrinfo_pkginfo_get_author_name(handle, &author);
if ((ret != PMINFO_R_OK) || (author == NULL)) {
- LogDebug("Fail to get author");
+ LoggerD("Fail to get author");
} else {
pkgInfo->m_author = author;
}
ret = pkgmgrinfo_pkginfo_get_description(handle, &description);
if ((ret != PMINFO_R_OK) || (description == NULL)) {
- LogDebug("Fail to get description");
+ LoggerD("Fail to get description");
} else {
pkgInfo->m_description = description;
}
ret = package_manager_get_package_info(id, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot create package info by : " << id);
+ LoggerD("Cannot create package info by : " << id);
delete pkgInfo;
return NULL;
}
ret = package_info_foreach_app_from_package(package_info, PACKAGE_INFO_ALLAPP, app_callback, (void*)pkgInfo);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("failed while getting appids");
+ LoggerD("failed while getting appids");
}
ret = package_info_destroy(package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("Cannot destroy package info");
+ LoggerD("Cannot destroy package info");
}
// REMARK: do not destroy handle. because handle is comes from outside!!
static gboolean getCompleteCB(void *data)
{
- LogDebug("entered");
+ LoggerD("entered");
PackageInfoCallbackData *callback = (PackageInfoCallbackData *)data;
JSContextRef context = callback->getContext();
callback->callSuccessCallback(jsResult);
} else {
- LogDebug("Fail!!");
+ LoggerD("Fail!!");
JSValueRef error = JSTizenExceptionFactory::makeErrorObject(callback->getContext(), JSTizenException::UNKNOWN_ERROR, "platform exception");
callback->callErrorCallback(error);
}
static int get_package_list_cb(pkgmgrinfo_pkginfo_h handle, void *user_data)
{
- //LogDebug("entered");
+ //LoggerD("entered");
PackageInfoCallbackData *callback = (PackageInfoCallbackData *)user_data;
PackageInformation* pkgInfo = create_pkg_info(handle);
if (pkgInfo != NULL) {
callback->addPackageInfo(*pkgInfo);
delete pkgInfo;
} else {
- LogError("Fail to get pkgInfo");
+ LoggerE("Fail to get pkgInfo");
}
return 0;
}
static void getThreadCB(void *data, Ecore_Thread *thread)
{
- LogDebug("entered");
+ LoggerD("entered");
PackageInfoCallbackData *callback = (PackageInfoCallbackData *)data;
int ret = pkgmgrinfo_pkginfo_get_list(get_package_list_cb, data);
if (ret != PMINFO_R_OK) {
- LogDebug("Fail to get package info");
+ LoggerD("Fail to get package info");
callback->setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::PlatformException);
}
pkgmgrinfo_pkginfo_h handle;
int ret = pkgmgrinfo_pkginfo_get_pkginfo(package, &handle);
if (ret != PMINFO_R_OK) {
- LogDebug("fail to find pkg info with given pkg : " << package);
+ LoggerD("fail to find pkg info with given pkg : " << package);
// Do not throw exception. No one can handle exception because this code is called from async callback.
//throw NotFoundException("Can't find given package");
break;
pkgmgrinfo_appinfo_destroy_appinfo(handle);
if (pkgInfo == NULL) {
- LogDebug("Fail to get pkg info. skip callback call for pkgid " << package);
+ LoggerD("Fail to get pkg info. skip callback call for pkgid " << package);
} else {
CallbackUserData *callback = eventCB->getOnInstalled();
if (callback) {
break;
}
case APP_MANAGER_EVENT_UNINSTALLED: {
- LogDebug("uninstall : " << package);
+ LoggerD("uninstall : " << package);
CallbackUserData *callback = eventCB->getOnUninstalled();
if (callback) {
Converter converter(callback->getContext());
pkgmgrinfo_appinfo_destroy_appinfo(handle);
if (pkgInfo == NULL) {
- LogDebug("Fail to get pkg info. skip callback call for pkgid " << package);
+ LoggerD("Fail to get pkg info. skip callback call for pkgid " << package);
} else {
CallbackUserData *callback = eventCB->getOnUpdated();
if (callback) {
break;
}
default:
- LogDebug("Fail!! Unknown event type is entered : " << event_type);
+ LoggerD("Fail!! Unknown event type is entered : " << event_type);
break;
}
if (!strcasecmp(key, "start"))
{
+ LoggerD("start ");
if (!strcasecmp(val, "install"))
{
event_type = APP_MANAGER_EVENT_INSTALLED;
}
else if (!strcasecmp(key, "end") && !strcasecmp(val, "ok"))
{
+ LoggerD("end ");
if (event_type >= 0)
{
package_event_cb(event_type, package, data);
+
+ // Check whether handler is freed in the callback function or not.
+ // if freed, return error code to avoid iteration of callback function. (core platform side)
+ PackageInfoEventCallback * callback = (PackageInfoEventCallback *)data;
+ pkgmgr_client ** handler_p = callback->getEventHandler();
+ if (*handler_p == NULL) {
+ LoggerD("handler is NULL");
+ return -1;
+ }
+ LoggerD("handler is not NULL");
}
}
- return APP_MANAGER_ERROR_NONE;
+ return 0;
}
package_manager_error_e error,
void *user_data)
{
- LogDebug("install_request_cb ");
+ LoggerD("install_request_cb ");
PackageInstallEventCallback *callback = (PackageInstallEventCallback *)user_data;
JSContextRef context = callback->getContext();;
callback->getOnComplete()->callSuccessCallback(converter.toJSValueRef(package));
}
- LogDebug("destroy client handle");
+ LoggerD("destroy client handle");
// this api is not supported from platform.
//package_manager_request_destroy(callback->getHandle());
package_manager_client_destroy(callback->getHandle());
callback->getOnError()->callSuccessCallback(jsError);
}
- LogDebug("destroy client handle");
+ LoggerD("destroy client handle");
// this api is not supported from platform.
//package_manager_request_destroy(callback->getHandle());
package_manager_client_destroy(callback->getHandle());
if (callback->getOnError()) {
callback->getOnError()->callSuccessCallback(error);
}
- LogDebug("destroy client handle");
+ LoggerD("destroy client handle");
// this api is not supported from platform.
//package_manager_request_destroy(callback->getHandle());
package_manager_client_destroy(callback->getHandle());
void PackageManager::install(string pkgPath, PackageInstallEventCallback* callback)
{
- LogDebug("install");
+ LoggerD("install");
int ret = 0;
int id = 0;
package_manager_request_h request_h;
ret = package_manager_request_install(request_h, pkgPath.c_str(), &id);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("error : " << pkgPath);
+ LoggerD("error : " << pkgPath);
if (errCallback) {
JSValueRef error =
JSTizenExceptionFactory::makeErrorObject(globalCtx, JSTizenException::NOT_FOUND_ERROR, "Not proper file");
void PackageManager::uninstall(string pkgPath, PackageInstallEventCallback* callback)
{
- LogDebug("uninstall");
+ LoggerD("uninstall");
int ret = 0;
int id = 0;
package_manager_request_h request_h;
ret = package_manager_request_uninstall(request_h, pkgPath.c_str(), &id);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogDebug("error : " << pkgPath);
+ LoggerD("error : " << pkgPath);
if (errCallback) {
JSValueRef error =
JSTizenExceptionFactory::makeErrorObject(globalCtx, JSTizenException::NOT_FOUND_ERROR, "Not proper file");
int ret = get_current_pkg_id(&pkg_id);
if((ret != APP_MANAGER_ERROR_NONE) || (pkg_id == NULL)) {
- LogError("Can not get app id from current pid (" << ret << ")");
+ LoggerE("Can not get app id from current pid (" << ret << ")");
throw NotFoundException("Can't find given package");
}
pkgId = pkg_id;
void PackageManager::getPackagesInfo(PackageInfoCallbackData *user_data)
{
- LogDebug("entered");
+ LoggerD("entered");
// getting info of all package from other thread. the result callback will be called on main thread
ecore_thread_run(getThreadCB, NULL, NULL, user_data);
void PackageManager::setPackageInfoEventListener(PackageInfoEventCallback * eventCB)
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_manager_handle == NULL) {
m_manager_handle = pkgmgr_client_new(PC_LISTENING);
}
}
+ eventCB->setEventHandler(&m_manager_handle);
+
pkgmgr_client_listen_status(m_manager_handle, app_list_changed_cb_broker, eventCB);
}
void PackageManager::unsetPackageInfoEventListener()
{
- LogDebug("enter");
+ LoggerD("enter");
if (m_manager_handle == NULL) {
- LogDebug("no package manager handle registered");
+ LoggerD("no package manager handle registered");
return;
}
}
PackageManager* PackageManager::getInstance(){
- LogDebug("enter to getInstance()");
+ LoggerD("enter to getInstance()");
static PackageManager instance;
return &instance;
}
PackageManager::PackageManager()
{
- LogDebug("Create PackageManager");
+ LoggerD("Create PackageManager");
}
PackageManager::~PackageManager()
{
- LogDebug("Destroy PackageManager");
+ LoggerD("Destroy PackageManager");
if (m_manager_handle != NULL) {
pkgmgr_client_free(m_manager_handle);
#if 0
void PackageManager::move(string pkgPath, string target, PackageInstallEventCallback* callback)
{
- LogDebug("entered : " << pkgPath);
+ LoggerD("entered : " << pkgPath);
int ret = 0;
package_manager_move_type_e type = PACAKGE_MANAGER_REQUEST_MOVE_TO_INTERNAL;
bool PackageManager::isInstalled(string pkgId)
{
- LogDebug("pkgId = " << pkgId);
+ LoggerD("pkgId = " << pkgId);
package_info_h handle;
int ret = 0;
ret = package_manager_get_package_info(pkgId.c_str(), &handle);
if (ret == PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE) {
- LogError("No patched package: " << pkgId);
+ LoggerE("No patched package: " << pkgId);
return false;
} else if (ret == PACKAGE_MANAGER_ERROR_NONE) {
// TODO: Should I exception handling while destory handle? what should I do for that time?
string PackageManager::getPackageIdFromAppId(string appId)
{
- LogDebug("appId = " << appId);
+ LoggerD("appId = " << appId);
char *pkg_id = NULL;
string pkgId;
int ret = 0;
ret = package_manager_get_package_id_by_app_id(appId.c_str(), &pkg_id);
if (ret != PACKAGE_MANAGER_ERROR_NONE) {
- LogError("Error on get pkgId from appId : " << appId);
+ LoggerE("Error on get pkgId from appId : " << appId);
ThrowMsg(NotFoundException, "Not found pkg");
}
CallbackUserData* getOnInstalled();
CallbackUserData* getOnUpdated();
CallbackUserData* getOnUninstalled();
+ pkgmgr_client ** getEventHandler();
+ void setEventHandler(pkgmgr_client **handle_p);
private:
CallbackUserData* m_oninstalled;
CallbackUserData* m_onupdated;
CallbackUserData* m_onuninstalled;
+ pkgmgr_client **m_handle_p;
};
class PackageInstallEventCallback
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <GlobalContextManager.h>
#include <TimeTracer.h>
#include "JSPackageManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
namespace Package {
void on_widget_start_callback(int widgetId) {
- LogDebug("[Tizen2_1\\Package] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen2_1\\Package] on_widget_start_callback ("<<widgetId<<")");
TIME_TRACER_INIT();
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId) {
- LogDebug("[Tizen2_1\\Package] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen2_1\\Package] on_widget_stop_callback ("<<widgetId<<")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Package");
TIME_TRACER_RELEASE();
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Package] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\Package] on_frame_load_callback (" << context << ")");
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Package] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\Package] on_frame_unload_callback (" << context << ")");
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
#include <SecurityExceptions.h>
#include <CallbackUserData.h>
#include <GlobalContextManager.h>
-#include <Logger.h>
#include <JSUtil.h>
#include <JSWebAPIException.h>
#include <ArgumentValidator.h>
#include "JSPowerManager.h"
#include "plugin_config.h"
#include "PowerManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis::Commons;
using namespace WrtDeviceApis::CommonsJavaScript;
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = POWER_CHECK_ACCESS(POWER_FUNCTION_API_REQUEST);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try{
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try{
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
CallbackUserData *callback = static_cast<CallbackUserData*>(JSObjectGetPrivate(thisObject));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try{
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = POWER_CHECK_ACCESS(POWER_FUNCTION_API_RELEASE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try{
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
try{
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = POWER_CHECK_ACCESS(POWER_FUNCTION_API_RELEASE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TIME_TRACER_ITEM_BEGIN(__FUNCTION__, 0);
AceSecurityStatus status = POWER_CHECK_ACCESS(POWER_FUNCTION_API_RELEASE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
#include <power.h>
#include <pmapi.h>
#include <device.h>
-#include <dlog.h>
#include <algorithm>
#include <PlatformException.h>
-#include <Logger.h>
#include <JSUtil.h>
#include <vconf.h>
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace std;
void PowerManager::onPlatformStateChangedCB(power_state_e state, void *user_data){
PowerManager* object = static_cast<PowerManager*>(user_data);
if(object == NULL){
- LOGE("User data is NULL");
+ LoggerE("User data is NULL");
return;
}
PowerState current(PowerState::SCREENOFF);
ret = power_lock_state( (power_state_e)native_state , 0);
if( POWER_ERROR_NONE!=ret ){
- LOGE("power_lock_state(%d) error %d",native_state, ret);
+ LoggerE("power_lock_state(%d) error %d",native_state, ret);
throw UnknownException("power_lock_state error");
}
break;
int maxBrightness;
ret = device_get_max_brightness(0, &maxBrightness);
if( DEVICE_ERROR_NONE!=ret) {
- LOGE("Platform error while getting max brightness: %d", ret);
+ LoggerE("Platform error while getting max brightness: %d", ret);
throw UnknownException("Platform error while getting max brightness");
}
LOGI("Succeeded setting the brightness to a max level: %d", maxBrightness);
ret = power_lock_state(POWER_STATE_NORMAL, 0);
if( POWER_ERROR_NONE!=ret ){
- LOGE("Platform error while locking state %d", ret);
+ LoggerE("Platform error while locking state %d", ret);
throw UnknownException("Platform error while locking state");
}
break;
}
case PowerState::SCREENOFF:
- LOGE("SCREEN_OFF state cannot be requested");
+ LoggerE("SCREEN_OFF state cannot be requested");
throw InvalidValuesException("SCREEN_OFF state cannot be requested");
default :
if( mBrightStateEnable ){
ret = device_set_brightness_from_settings(0);
if( DEVICE_ERROR_NONE!=ret){
- LOGE("Platform error while setting restore brightness %d", ret);
+ LoggerE("Platform error while setting restore brightness %d", ret);
throw UnknownException("Platform error while setting restore brightness");
}
}
int maxBrightness;
ret = device_get_max_brightness(0, &maxBrightness);
if( ret != 0 ){
- LOGE("Platform error while setting restore brightness: %d", ret);
+ LoggerE("Platform error while setting restore brightness: %d", ret);
throw UnknownException("Platform error while getting max brightness");
}
int nativeBrightness = (int)(brightness*maxBrightness);
ret = pm_change_state(LCD_OFF);
if( ret<0 ){
- LOGE("Platform error while changing screen state %d", ret);
+ LoggerE("Platform error while changing screen state %d", ret);
throw UnknownException("Platform error while changing screen state");
}
}
int ret;
ret = device_set_brightness_from_settings(0);
if( DEVICE_ERROR_NONE!=ret){
- LOGE("Platform error while restoring brightness %d", ret);
+ LoggerE("Platform error while restoring brightness %d", ret);
throw UnknownException("Platform error while restoring brightness");
}
}
int ret = device_set_brightness(0, brightness);
if( ret != 0){
- LOGE("Platform error while setting %d brightness: %d", brightness, ret);
+ LoggerE("Platform error while setting %d brightness: %d", brightness, ret);
throw UnknownException("Platform error while setting brightness.");
}
mCurrentBrightness = brightness;
ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &brightness);
if( ret != 0 ){
- LOGE("Platform error while getting brightness: %d", ret);
+ LoggerE("Platform error while getting brightness: %d", ret);
throw UnknownException("Platform error while getting brightness");
}
- LOGE("VCONFKEY_SETAPPL_LCD_BRIGHTNESS %d", brightness);
+ LoggerE("VCONFKEY_SETAPPL_LCD_BRIGHTNESS %d", brightness);
return brightness;
}
restoreSettedBrightness();
}
catch( const BasePlatformException& err){
- LOGE("Error restore custom brightness %s", err.getMessage().c_str());
+ LoggerE("Error restore custom brightness %s", err.getMessage().c_str());
}
}
if( mCurrentState.mState == PowerState::SCREENNORMAL && PreviousState.mState == PowerState::SCREENOFF){
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Power] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Power] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try {
WrtAccessSingleton::Instance().initialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Power] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Power] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Power");
TIME_TRACER_RELEASE();
Try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} Catch (Exception) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Power] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\Power] on_frame_load_callback (" << context << ")");
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Power] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\Power] on_frame_unload_callback (" << context << ")");
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
DPL::Log::LogSystemSingleton::Instance().SetTag("STANDALONE");
//DPL::Event::GetMainEventDispatcherInstance().ResetCrossEventCallHandler();
- WrtAccessSingleton::Instance().initialize(0);
+ try{
+ WrtAccessSingleton::Instance().initialize(0);
+ }catch(...){
+ printf("ERROR: Cannot init WrtAccessSingleton\n");
+ return -1;
+ }
StandaloneConsole console;
console.registModule("power", JSPowerManager::getClassRef(), NULL);
if( argc > 1 ){
- for(unsigned int i = 1 ; i< argc; i++){
+ for(unsigned int i = 1 ; i< (unsigned int)argc; i++){
console.RunScript(argv[i]);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in PushManager.registerService().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in PushManager.unregisterService().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in PushManager.connectService().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
TIME_TRACER_ITEM_END(__FUNCTION__, 0);
return JSValueMakeUndefined(context);
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in PushManager.disconnectService().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
return JSUtil::toJSValueRef(context, ret);
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
} catch (...) {
DeviceAPI::Common::UnknownException err("Unknown Error in PushManager.getRegistrationId().");
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
}
}
if (!success) {
- LogError("Platform error %d <%s>", err, msg.c_str());
+ LoggerE("Platform error %d <%s>", err, msg.c_str());
}
return msg;
static int get_current_app_id_and_pkg_id(char **app_id, char **pkg_id)
{
- LogDebug("get_current_pkg_id enter");
+ LoggerD("get_current_pkg_id enter");
int parent_pid = getppid();
- LogDebug("parent pid : " << parent_pid);
+ LoggerD("parent pid : " << parent_pid);
char *_app_id = NULL;
char *_pkg_id = NULL;
int ret = app_manager_get_app_id(parent_pid, &_app_id);
if ((ret != APP_MANAGER_ERROR_NONE) || (_app_id == NULL)) {
- LogDebug("Cannot get app id from pid : " << parent_pid);
+ LoggerD("Cannot get app id from pid : " << parent_pid);
return ret;
} else {
- LogDebug("app_id : " << _app_id);
+ LoggerD("app_id : " << _app_id);
}
ret = app_manager_get_app_info(_app_id, &handle);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogDebug("Fail to get appinfo by " << _app_id);
+ LoggerD("Fail to get appinfo by " << _app_id);
return ret;
}
ret = app_info_get_package(handle, &_pkg_id);
if ((ret != APP_MANAGER_ERROR_NONE) || (_pkg_id == NULL))
{
- LogDebug("Fail to get pkg_id by " << _app_id);
+ LoggerD("Fail to get pkg_id by " << _app_id);
}
ret = app_info_destroy(handle);
if (ret != APP_MANAGER_ERROR_NONE)
{
- LogDebug("Fail to get destory appinfo");
+ LoggerD("Fail to get destory appinfo");
return ret;
}
static void push_connection_state_cb(push_state_e state, const char *err, void *user_data)
{
- LogInfo("Push connection state cb with state: "<< state <<", err: "<< err);
+ LoggerI("Push connection state cb with state: "<< state <<", err: "<< err);
PushManager *thisPushManager = static_cast<PushManager*>(user_data);
if (!thisPushManager) {
- LogError("user_data of push_connection_state_cb() is NULL.");
+ LoggerE("user_data of push_connection_state_cb() is NULL.");
} else {
thisPushManager->m_connectionState = state;
}
char *alertMessage = NULL;
long long int date = -1;
- LogInfo("Push notification cb");
+ LoggerI("Push notification cb");
try {
PushManager *thisPushManager = static_cast<PushManager*>(user_data);
MultiCallbackUserDataPtr callback = thisPushManager->m_notificationCallback;
if (!callback) {
- LogWarning("notification callback is not set. ignored.");
+ LoggerW("notification callback is not set. ignored.");
return;
}
ret = push_get_notification_time(noti, &date);
if (ret != PUSH_ERROR_NONE) {
- LogError("Platform error while getting notification date/time. " << _get_internal_error(ret));
+ LoggerE("Platform error while getting notification date/time. " << _get_internal_error(ret));
}
PushMessage *pushMessage = new PushMessage();
callback->invokeCallback("onsuccess", pushMessageObj);
} catch (const BasePlatformException &err) {
- LogError(err.getMessage());
+ LoggerE(err.getMessage());
}
}
int ret;
char *tmp = NULL;
- LogInfo("Push registration cb");
+ LoggerI("Push registration cb");
try {
PushManager *thisPushManager = static_cast<PushManager*>(user_data);
callback->invokeCallback("onerror", errorObj);
}
} catch (const BasePlatformException &err) {
- LogError(err.getMessage());
+ LoggerE(err.getMessage());
}
}
static void push_unregistration_result_cb(push_result_e result, const char *msg, void *user_data)
{
- LogInfo("Push unregistration cb");
+ LoggerI("Push unregistration cb");
try {
PushManager *thisPushManager = static_cast<PushManager*>(user_data);
callback->invokeCallback("onerror", errorObj);
}
} catch (const BasePlatformException &err) {
- LogError(err.getMessage());
+ LoggerE(err.getMessage());
}
}
m_connectionState(PUSH_STATE_UNREGISTERED),
m_connectionHandle(NULL)
{
- LogInfo("Connecting to the push service...");
+ LoggerI("Connecting to the push service...");
int ret;
ret = get_current_app_id_and_pkg_id(&m_appId, &m_pkgId);
if (APP_ERROR_NONE != ret) {
- LogError("Error while getting app id: "<<ret);
+ LoggerE("Error while getting app id: "<<ret);
return;
}
- LogInfo("Push App id: " << m_appId);
- LogInfo("Push Package id: " << m_pkgId);
+ LoggerI("Push App id: " << m_appId);
+ LoggerI("Push Package id: " << m_pkgId);
ret = push_connect(m_pkgId, push_connection_state_cb, push_notify_cb, this, &m_connectionHandle);
if (PUSH_ERROR_NONE!=ret) {
- LogError("Error while connecting to the push service: "<< ret);
+ LoggerE("Error while connecting to the push service: "<< ret);
return;
}
}
PushManager::~PushManager()
{
- LogInfo("Disconnecting to the push service...");
+ LoggerI("Disconnecting to the push service...");
if(m_appId) {
free(m_appId);
}
PushManager *PushManager::getInstance() {
- LogInfo("Getting instance of PushManager...");
+ LoggerI("Getting instance of PushManager...");
static PushManager instance;
return &instance;
}
if (appControl->getUri().compare("") != 0) {
ret = service_set_uri(service, appControl->getUri().c_str());
if (ret != SERVICE_ERROR_NONE) {
- LogWarning("Platform error while setting uri to appControl. " << _get_internal_error(ret));
+ LoggerW("Platform error while setting uri to appControl. " << _get_internal_error(ret));
}
}
if (appControl->getMime().compare("") != 0) {
ret = service_set_mime(service, appControl->getMime().c_str());
if (ret != SERVICE_ERROR_NONE) {
- LogWarning("Platform error while setting mime to appControl. " << _get_internal_error(ret));
+ LoggerW("Platform error while setting mime to appControl. " << _get_internal_error(ret));
}
}
for (size_t i = 0; i < controlDataArray.size(); i++) {
key = controlDataArray.at(i)->getKey();
if (key.empty()) {
- LogWarning("Invalid key for " << i << " in ApplicationControl's data array.");
+ LoggerW("Invalid key for " << i << " in ApplicationControl's data array.");
} else {
std::vector<std::string> valueArray = controlDataArray.at(i)->getValue();
size_t size = valueArray.size();
if (size == 1) {
ret = service_add_extra_data(service, (const char*)key.c_str(), arr[0]);
if (ret != SERVICE_ERROR_NONE) {
- LogWarning("Platform error while adding extra data to appControl. " << _get_internal_error(ret));
+ LoggerW("Platform error while adding extra data to appControl. " << _get_internal_error(ret));
}
} else {
ret = service_add_extra_data_array(service, (const char*)key.c_str(), arr, size);
if (ret != SERVICE_ERROR_NONE) {
- LogWarning("Platform error while adding extra data array to appControl. " << _get_internal_error(ret));
+ LoggerW("Platform error while adding extra data array to appControl. " << _get_internal_error(ret));
}
}
ret = push_get_registration_id(m_connectionHandle, ®Id);
if (ret != PUSH_ERROR_NONE) {
- LogWarning("Platform error while getting registration id. " << _get_internal_error(ret));
+ LoggerW("Platform error while getting registration id. " << _get_internal_error(ret));
} else {
if (regId) {
str = regId;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Push] on_widget_start_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Push] on_widget_start_callback (%d)", widgetId);
TIME_TRACER_INIT();
try {
WrtAccessSingleton::Instance().initialize(widgetId);
} catch (...) {
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Push] on_widget_stop_callback (%d)", widgetId);
+ LoggerD("[Tizen\\Push] on_widget_stop_callback (%d)", widgetId);
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"Push");
TIME_TRACER_RELEASE();
try {
WrtAccessSingleton::Instance().deinitialize(widgetId);
} catch (...) {
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\Push] on_frame_load_callback (%p)", context);
+ LoggerD("[Tizen\\Push] on_frame_load_callback (%p)", context);
GlobalContextManager::getInstance()->addGlobalContext(static_cast<JSContextRef>(context));
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\Push] on_frame_unload_callback (%p)", context);
+ LoggerD("[Tizen\\Push] on_frame_unload_callback (%p)", context);
GlobalContextManager::getInstance()->removeGlobalContext(static_cast<JSContextRef>(context));
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "SEAsyncCallbackManager.h"
#include "SEConverter.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSValueRef JSSEChannel::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
SEChannelPrivObject* privateObject = static_cast<SEChannelPrivObject*>(JSObjectGetPrivate(object));
return convert.toJSValueRef(channel->isBasicChannel());
}
} 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);
}
JSObjectRef JSSEChannel::createJSObject(JSContextRef context, void *channel) {
- LogDebug("entered");
+ LoggerD("entered");
ISEChannelPtr seChannel = SEFactory::getInstance().createSEChannelObject(channel);
void JSSEChannel::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
}
void JSSEChannel::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
SEChannelPrivObject *priv = static_cast<SEChannelPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SecureElement object");
+ LoggerD("Deleting SecureElement object");
delete priv;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
SEChannelPrivObject* privateObject = static_cast<SEChannelPrivObject*>(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");
}
seChannel->close();
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if ((argumentCount < 2) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSIsArrayValue(context, arguments[0])) {
/* 1st argument is mandatory. And 1st argument must be Array */
- LogError("data TypeMismatchException!");
+ LoggerE("data TypeMismatchException!");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
onErrorForCbm = arguments[2];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SEChannelPrivObject* privateObject = static_cast<SEChannelPrivObject*>(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 (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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"));
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include "JSSEReader.h"
#include "SEAsyncCallbackManager.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSValueRef JSSEReader::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
Converter convert(context);
return convert.toJSValueRef(reader->isPresent());
}
} 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);
}
JSObjectRef JSSEReader::createJSObject(JSContextRef context, void *reader) {
- LogDebug("entered");
+ LoggerD("entered");
ISEReaderPtr seReader = SEFactory::getInstance().createSEReaderObject(reader);
void JSSEReader::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
SEReaderPrivObject *priv = static_cast<SEReaderPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SecureElement object");
+ LoggerD("Deleting SecureElement object");
delete priv;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(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");
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
onErrorForCbm = arguments[1];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(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 (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
SEReaderPrivObject* privateObject = static_cast<SEReaderPrivObject*>(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");
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
-
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/Converter.h>
#include <Commons/Exception.h>
#include "SEListenerManager.h"
#include "SEConverter.h"
#include "plugin_config.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
ISEServicePtr seService( SEFactory::getInstance().createSEServiceObject() );
priv = new SEServicePrivObject(context, seService);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
} 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());
}
}
}
void JSSEService::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
SEServicePrivObject *priv = static_cast<SEServicePrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SEService object");
+ LoggerD("Deleting SEService object");
delete priv;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
onErrorForCbm = arguments[1];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SEServicePrivObject* privateObject = static_cast<SEServicePrivObject*>(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");
}
SEAsyncCallbackManagerSingleton::Instance().registerCallbackManager(callbackManager, privateObject->getContext());
return JSValueMakeUndefined(context);
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
seListener = convert.toSEListener(arguments[0]);
} else {
/* 1st argument must be SEListener. */
- LogError("SEListener must has onSEReady and onSENotReady");
+ LoggerE("SEListener must has onSEReady and onSENotReady");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
SEServicePrivObject* privateObject = static_cast<SEServicePrivObject*>(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 convert.toJSValueRefLong(static_cast<long>(emitter->getId()));
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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 JSSEService::unregisterSEListener(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) {
- LogDebug("Enter");
+ LoggerD("Enter");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
SEServicePrivObject* privateObject = static_cast<SEServicePrivObject*>(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 (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
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 (WrtDeviceApis::Commons::NotFoundException) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Not Found ID");
} 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 = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
SEServicePrivObject* privateObject = static_cast<SEServicePrivObject*>(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");
}
seService->shutdown();
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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");
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/Validator.h>
#include <Commons/Exception.h>
#include "SEConverter.h"
#include "SEAsyncCallbackManager.h"
#include "plugin_config.h"
-
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSValueRef JSSESession::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
Converter convert(context);
return convert.toJSValueRef(seSession->isClosed());
}
} 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);
}
JSObjectRef JSSESession::createJSObject(JSContextRef context, void *session) {
- LogDebug("entered");
+ LoggerD("entered");
ISESessionPtr seSession = SEFactory::getInstance().createSESessionObject(session);
void JSSESession::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
SESessionPrivObject *priv = static_cast<SESessionPrivObject*>( JSObjectGetPrivate( object ) ) ;
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SecureElement object");
+ LoggerD("Deleting SecureElement object");
delete priv;
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(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");
}
SEConverter convert(context);
return convert.toJSValueRef(seSession->getATR());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(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");
}
seSession->close();
return JSValueMakeUndefined(context);
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
Try {
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(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");
}
seSession->closeChannels();
return JSValueMakeUndefined(context);
} 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 = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if ((argumentCount < 2) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSIsArrayValue(context, arguments[0])) {
/* 1st argument is mandatory. And 1st argument must be Array. */
- LogError("AID TypeMismatchException!");
+ LoggerE("AID TypeMismatchException!");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
onErrorForCbm = arguments[2];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(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");
}
Try {
std::vector<unsigned char> aid = convert.toVectorOfUChars(arguments[0]);
if ((aid.size() < 5) || (aid.size() > 16)) {
- LogError("wrong aid length : " << aid.size());
+ LoggerE("wrong aid length : " << aid.size());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Wrong AID length");
}
EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, true));
return JSValueMakeUndefined(context);
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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"));
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
AceSecurityStatus status = SECURE_ELEMENT_CHECK_ACCESS(SECUREELEMENT_FUNCTION_API_FUNCS);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
if ((argumentCount < 2) || JSValueIsNull(context, arguments[0]) || JSValueIsUndefined(context, arguments[0]) || !JSIsArrayValue(context, arguments[0])) {
/* 1st argument is mandatory. And 1st argument must be Array. */
- LogError("AID TypeMismatchException!");
+ LoggerE("AID TypeMismatchException!");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
onErrorForCbm = arguments[2];
}
} catch (const BasePlatformException &err) {
- LogError(err.getName() << ": " << err.getMessage());
+ LoggerE(err.getName() << ": " << err.getMessage());
return JSWebAPIException::throwException(context, exception, err);
}
SESessionPrivObject* privateObject = static_cast<SESessionPrivObject*>(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");
}
Try {
std::vector<unsigned char> aid = convert.toVectorOfUChars(arguments[0]);
if ((aid.size() < 5) || (aid.size() > 16)) {
- LogError("wrong aid length : " << aid.size());
+ LoggerE("wrong aid length : " << aid.size());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Wrong AID length");
}
EventSEOpenChannelPtr event(new EventSEOpenChannel(aid, false));
return JSValueMakeUndefined(context);
} Catch (ConversionException) {
- LogError("ConversionException");
+ LoggerE("ConversionException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} 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"));
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include <JSTizenException.h>
#include <ByteArray.h>
#include "SEChannel.h"
#include "SEUtil.h"
-
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace smartcard_service_api;
namespace SecureElement {
namespace {
static void transmitCallback(unsigned char *buffer, unsigned int length, int error, void *userParam) {
- LogDebug("Callback transmitCallback.");
+ LoggerD("Callback transmitCallback.");
if (userParam) {
SEChannel *seChannelPtr = (SEChannel *)((EventSEPtrs<EventSEChannelTransmit> *)userParam)->getThisPtr();
seChannelPtr->transmitManualAnswer(buffer, length, error, event);
}
} else {
- LogError("Callback private data is NULL.");
+ LoggerE("Callback private data is NULL.");
}
}
}
SEChannel::SEChannel(void *channel)
{
- LogDebug("entered");
+ LoggerD("entered");
if (channel == NULL)
ThrowMsg(UnknownException, "SEChannel Handler is Null Pointer.");
SEChannel::~SEChannel()
{
- LogDebug("entered");
+ LoggerD("entered");
if (!m_channel->isClosed())
close();
m_channel = NULL;
}
void SEChannel::transmit(const EventSEChannelTransmitPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
EventRequestReceiver<EventSEChannelTransmit>::PostRequest(event);
}
for (it = EventSEChannelTransmits.begin(); it != EventSEChannelTransmits.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
EventSEChannelTransmits.erase(it);
- LogDebug("event is removed. (" << EventSEChannelTransmits.size() << ")");
+ LoggerD("event is removed. (" << EventSEChannelTransmits.size() << ")");
break;
}
}
}
void SEChannel::OnRequestReceived(const EventSEChannelTransmitPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
event->switchToManualAnswer();
free(chrTransmitData);
m_channel->transmit(transmitData, transmitCallback, eventData.Get());
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setResult(false);
event->setError(DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
event->setErrorMessage("Unknown Error");
// limitations under the License.
//
-
-
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/JSUtils.h>
#include "SEConverter.h"
#include <JSWebAPIError.h>
#include <TizenExceptionData.h>
+#include <Logger.h>
using namespace std;
using namespace WrtDeviceApis::CommonsJavaScript;
SEConverter::SEConverter(JSContextRef context) : Converter(context)
{
- LogDebug("entered");
+ LoggerD("entered");
}
SEConverter::~SEConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
}
SEListener SEConverter::toSEListener(const JSValueRef& arg) {
- LogDebug("Entered");
+ LoggerD("Entered");
JSObjectRef object = toJSObjectRef(arg);
SEListener result;
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSSEService.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace SecureElement {
{
SEServicePrivObject* privateObject = static_cast<SEServicePrivObject*>(JSObjectGetPrivate(m_object));
if (NULL == privateObject) {
- LogError("private object is null");
+ LoggerE("private object is null");
return;
}
seService->unregisterSEListener(static_cast<unsigned long>(m_watchId));
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
// limitations under the License.
//
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
#include <JSTizenException.h>
#include "SEReader.h"
#include "SEUtil.h"
-
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace smartcard_service_api;
namespace
{
static void openSessionCallback(SessionHelper *session, int error, void *userData) {
- LogDebug("Callback openSessionCallback.");
+ LoggerD("Callback openSessionCallback.");
if (userData) {
SEReader *sePtr = (SEReader *)((EventSEPtrs<EventSEOpenSession> *)userData)->getThisPtr();
if (sePtr) {
sePtr->openSessionManualAnswer((void *)session, error, event);
}
} else {
- LogError("Callback private data is NULL.");
+ LoggerE("Callback private data is NULL.");
}
}
SEReader::SEReader(void *reader)
{
- LogDebug("entered");
+ LoggerD("entered");
if (reader == NULL)
ThrowMsg(Commons::UnknownException, "SecureElement Handler is Null Pointer.");
SEReader::~SEReader()
{
- LogDebug("entered");
+ LoggerD("entered");
m_reader->closeSessions();
m_reader = NULL;
}
std::string SEReader::getName() {
- LogDebug("Enter" << m_reader->getName());
+ LoggerD("Enter" << m_reader->getName());
return m_reader->getName();
}
bool SEReader::isPresent() {
- LogDebug("Enter" << m_reader->isSecureElementPresent());
+ LoggerD("Enter" << m_reader->isSecureElementPresent());
return m_reader->isSecureElementPresent();
}
void SEReader::openSession(const EventSEOpenSessionPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
EventRequestReceiver<EventSEOpenSession>::PostRequest(event);
}
void SEReader::closeSessions() {
- LogDebug("Enter");
+ LoggerD("Enter");
m_reader->closeSessions();
}
for (it = EventSEOpenSessions.begin(); it != EventSEOpenSessions.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
EventSEOpenSessions.erase(it);
- LogDebug("event is removed. (" << EventSEOpenSessions.size() << ")");
+ LoggerD("event is removed. (" << EventSEOpenSessions.size() << ")");
break;
}
}
}
void SEReader::OnRequestReceived(const EventSEOpenSessionPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
event->switchToManualAnswer();
m_reader->openSession(openSessionCallback, data.Get());
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setResult(false);
event->setError(DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
event->setErrorMessage("Unknown Error");
//
#include <vector>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSTizenExceptionFactory.h>
#include "SEConverter.h"
#include "SEResponseDispatcher.h"
#include "SEAsyncCallbackManager.h"
-
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
SEOpenChannelAnswerReceiver(ThreadEnum::NULL_THREAD),
SEChannelTransmitAnswerReceiver(ThreadEnum::NULL_THREAD)
{
- LogDebug("entered");
+ LoggerD("entered");
}
SEResponseDispatcher::~SEResponseDispatcher()
{
- LogDebug("entered");
+ LoggerD("entered");
}
void SEResponseDispatcher::onAnswerReceived(const EventSEStateChangedPtr& event) {
- LogDebug("onAnswerReceived Enter");
+ LoggerD("onAnswerReceived Enter");
JSCallbackManagerPtr cbm =
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
else if (event->getSEState() == SE_REMOVED)
cbm->callOnError(JSSEReader::createJSObject(cbm->getContext(), event->getReader()));
else
- LogDebug("not correct state");
+ LoggerD("not correct state");
}
void SEResponseDispatcher::OnAnswerReceived(const EventListSEsPtr &event)
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
JSContextRef context = cbm->getContext();
SEConverter convert(context);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
std::vector<void *> readers = event->getListSEs();
std::vector<JSValueRef> ListSes;
for (std::size_t i = 0; i < readers.size(); i++)
cbm->callOnSuccess(convert.toJSValueRef(ListSes));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
cbm->callOnError(convert.makeSeErrorObject(event->getError(), event->getErrorMessage()));
}
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
SEConverter convert(context);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(convert.toJSValueRef(JSSESession::createJSObject(context, event->getSession())));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
cbm->callOnError(convert.makeSeErrorObject(event->getError(), event->getErrorMessage()));
}
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
SEConverter convert(context);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(convert.toJSValueRef(JSSEChannel::createJSObject(context, event->getChannel())));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
cbm->callOnError(convert.makeSeErrorObject(event->getError(), event->getErrorMessage()));
}
DPL::StaticPointerCast<JSCallbackManager>(event->getPrivateData());
if (!cbm) {
- LogDebug("no callback manager");
+ LoggerD("no callback manager");
return;
}
SEConverter convert(context);
if (event->getResult()) {
- LogDebug("result success");
+ LoggerD("result success");
cbm->callOnSuccess(convert.toJSValueRef(event->getResponse()));
return;
}
- LogDebug("result fail");
+ LoggerD("result fail");
cbm->callOnError(convert.makeSeErrorObject(event->getError(), event->getErrorMessage()));
}
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
-
#include "SEService.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace SecureElement {
{
void serviceConnected(smartcard_service_api::SEServiceHelper *service, void *context)
{
- LogDebug("entered");
+ LoggerD("entered");
if (context)
(static_cast<SEService*>(context))->getSEServiceCompleted();
}
void eventHandler(smartcard_service_api::SEServiceHelper *service, char *seName, int event, void *context)
{
- LogDebug("entered");
+ LoggerD("entered");
(static_cast<SEService*>(context))->eventChanged(seName, event);
}
void errorHandler(smartcard_service_api::SEServiceHelper *service, int error, void *context)
{
- LogDebug("entered");
+ LoggerD("entered");
}
};
static SEServiceEventHandler SEEventHandler;
SEService::SEService()
{
- LogDebug("entered");
+ LoggerD("entered");
bInitialized = false;
bReqShutDown = false;
m_EventListSEsPtr.Reset();
SEService::~SEService()
{
- LogDebug("entered");
+ LoggerD("entered");
if (m_seService) {
m_seService->shutdownSync();
}
void SEService::getSEServiceCompleted() {
- LogDebug("getSEServiceCompleted");
+ LoggerD("getSEServiceCompleted");
if (bReqShutDown)
m_seService->shutdownSync();
}
void SEService::getReaders(const EventListSEsPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
if (bInitialized)
EventRequestReceiver<EventListSEs>::PostRequest(event);
else
for (it = m_EventSEStateChangedEmitterPtrs.begin(); it != m_EventSEStateChangedEmitterPtrs.end(); ++it) {
if (id == static_cast<long>((*it)->getId())) {
m_EventSEStateChangedEmitterPtrs.erase(it);
- LogDebug("m_EventSEStateChangedEmitterPtrs is removed. (" << m_EventSEStateChangedEmitterPtrs.size() << ")");
+ LoggerD("m_EventSEStateChangedEmitterPtrs is removed. (" << m_EventSEStateChangedEmitterPtrs.size() << ")");
return;
}
}
eventState->setSEState(SE_REMOVED);
break;
default:
- LogDebug("Not correct event");
+ LoggerD("Not correct event");
return;
}
std::vector<smartcard_service_api::ReaderHelper *> readers = m_seService->getReaders();
}
}
if (i == 0) {
- LogError("Not found reader");
+ LoggerE("Not found reader");
return;
}
void SEService::OnRequestReceived(const EventListSEsPtr& event) {
std::vector<smartcard_service_api::ReaderHelper *> readers = m_seService->getReaders();
- LogDebug("readers.size() : " << readers.size());
+ LoggerD("readers.size() : " << readers.size());
event->setResult(true);
for (std::size_t i = 0; i < readers.size(); i++) {
if (readers[i]->isSecureElementPresent())
#include <Ecore.h>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <JSTizenException.h>
#include "SESession.h"
#include "SEUtil.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
namespace
{
static void openChannelCallback(Channel *channel, int error, void *userData) {
- LogDebug("Callback openChannelCallback.");
+ LoggerD("Callback openChannelCallback.");
if (userData) {
SESession *seSessionPtr = (SESession *)((EventSEPtrs<EventSEOpenChannel> *)userData)->getThisPtr();
if (seSessionPtr) {
seSessionPtr->openChannelManualAnswer((void *)channel, error, event);
}
} else {
- LogError("Callback private data is NULL.");
+ LoggerE("Callback private data is NULL.");
}
}
}//private namespace
SESession::SESession(void *session)
{
- LogDebug("entered");
+ LoggerD("entered");
if (session == NULL)
ThrowMsg(Commons::UnknownException, "SecureElement Handler is Null Pointer.");
SESession::~SESession()
{
- LogDebug("entered");
+ LoggerD("entered");
if (!isClosed())
close();
m_session = NULL;
}
bool SESession::isClosed() {
- LogDebug("Enter" << m_session->isClosed());
+ LoggerD("Enter" << m_session->isClosed());
return m_session->isClosed();
}
std::vector<unsigned char> SESession::getATR() {
- LogDebug("Enter");
+ LoggerD("Enter");
ByteArray atrByteArray = m_session->getATRSync();
SEUtil util;
return util.toVector(atrByteArray.getBuffer(), atrByteArray.getLength());
}
void SESession::close() {
- LogDebug("Enter");
+ LoggerD("Enter");
m_session->closeSync();
}
void SESession::closeChannels() {
- LogDebug("Enter");
+ LoggerD("Enter");
m_session->closeChannels();
}
void SESession::openChannel(const EventSEOpenChannelPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
EventRequestReceiver<EventSEOpenChannel>::PostRequest(event);
}
for (it = EventSEOpenChannels.begin(); it != EventSEOpenChannels.end(); ++it) {
if ((*it)->getEventPtrs() == event) {
EventSEOpenChannels.erase(it);
- LogDebug("event is removed. (" << EventSEOpenChannels.size() << ")");
+ LoggerD("event is removed. (" << EventSEOpenChannels.size() << ")");
break;
}
}
}
void SESession::OnRequestReceived(const EventSEOpenChannelPtr& event) {
- LogDebug("Enter");
+ LoggerD("Enter");
try {
event->switchToManualAnswer();
if (channelAid)
free(channelAid);
} catch (const WrtDeviceApis::Commons::Exception& ex) {
- LogError("Exception: " << ex.GetMessage());
+ LoggerE("Exception: " << ex.GetMessage());
event->setResult(false);
event->setError(DeviceAPI::Common::JSTizenException::UNKNOWN_ERROR);
event->setErrorMessage("Unknown Error");
#include "SEUtil.h"
-#include <dpl/log/log.h>
#include <JSTizenException.h>
#include <smartcard-types.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace SecureElement {
}
std::string SEUtil::getErrorString(const int errorCode) {
- LogDebug ("Errorcode : " << errorCode);
+ LoggerD ("Errorcode : " << errorCode);
switch(errorCode) {
case SCARD_ERROR_OK:
return "";
}
std::string SEUtil::getErrorMessage(const int errorCode) {
- LogDebug ("Errorcode : " << errorCode);
+ LoggerD ("Errorcode : " << errorCode);
switch(errorCode) {
case SCARD_ERROR_OK:
return "";
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include "JSSEService.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace SecureElement {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[TIZEN\\SE] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[TIZEN\\SE] on_widget_start_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[TIZEN\\SE ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[TIZEN\\SE ] on_widget_stop_callback (" << widgetId << ")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void JSSecureStorageManager::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("JSSecureStorageManager::initialize ");
+ LoggerD("JSSecureStorageManager::initialize ");
JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(object));
if (priv == NULL)
priv = new JSSecureStorageManagerPriv( context, secureStorage);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv)))
{
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
}
else
{
- LogDebug("JSSecureStorageManager::already exist ");
+ LoggerD("JSSecureStorageManager::already exist ");
}
}
{
JSSecureStorageManagerPriv* priv = static_cast<JSSecureStorageManagerPriv*>(JSObjectGetPrivate(object));
- LogDebug("JSSecureStorageManager::Finalrize");
+ LoggerD("JSSecureStorageManager::Finalrize");
if (priv != NULL)
{
{
if (priv == NULL)
{
- LogError("priv null");
+ LoggerE("priv null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogDebug("Error message" << ex.GetMessage());
+ LoggerD("Error message" << ex.GetMessage());
switch(ex.getCode())
{
case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
{
if (priv == NULL)
{
- LogError("priv null");
+ LoggerE("priv null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogDebug("Error message" << ex.GetMessage());
+ LoggerD("Error message" << ex.GetMessage());
switch(ex.getCode())
{
case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
{
if (priv == NULL)
{
- LogError("priv null");
+ LoggerE("priv null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogDebug("Error message" << ex.GetMessage());
+ LoggerD("Error message" << ex.GetMessage());
switch(ex.getCode())
{
case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
{
if (priv == NULL)
{
- LogError("priv null");
+ LoggerE("priv null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogDebug("Error message" << ex.GetMessage());
+ LoggerD("Error message" << ex.GetMessage());
switch(ex.getCode())
{
case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
{
if (priv == NULL)
{
- LogError("priv null");
+ LoggerE("priv null");
Throw(WrtDeviceApis::Commons::ConversionException);
}
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogDebug("Error message" << ex.GetMessage());
+ LoggerD("Error message" << ex.GetMessage());
switch(ex.getCode())
{
case WrtDeviceApis::Commons::ExceptionCodes::NotFoundException:
SecureStorageManager::SecureStorageManager()
{
- LogDebug("OK");
+ LoggerD("OK");
try
{
}
catch (const WrtDeviceApis::Commons::Exception& ex)
{
- LogError("Exception: " << ex.GetMessage());
- LogDebug("there is no file");
+ LoggerE("Exception: " << ex.GetMessage());
+ LoggerD("there is no file");
}
- LogDebug("initial map size : " << m_securePairData.size());
+ LoggerD("initial map size : " << m_securePairData.size());
}
SecureStorageManager::~SecureStorageManager()
{
- LogDebug("OK");
+ LoggerD("OK");
}
std::string SecureStorageManager::get(std::string key)
{
- LogDebug("OK");
+ LoggerD("OK");
std::map<std::string,std::string>::iterator it = m_securePairData.find(key);
std::vector<std::string> vector;
std::map<std::string,std::string>::iterator it;
- LogDebug("OK");
+ LoggerD("OK");
for (it = m_securePairData.begin(); it != m_securePairData.end(); ++it)
{
{
m_securePairData[key] = value;
- LogDebug("Save current data");
+ LoggerD("Save current data");
saveSecurePairData();
}
void SecureStorageManager::remove(std::string key)
{
- LogDebug("OK");
+ LoggerD("OK");
std::map<std::string,std::string>::iterator it = m_securePairData.find(key);
ThrowMsg(WrtDeviceApis::Commons::NotFoundException, "not found key");
}
m_securePairData.erase(it);
- LogDebug("Save current data");
+ LoggerD("Save current data");
saveSecurePairData();
}
void SecureStorageManager::removeAll()
{
- LogDebug("OK");
+ LoggerD("OK");
ssm_flag flag = SSM_FLAG_SECRET_OPERATION;
void SecureStorageManager::saveSecurePairData()
{
- LogDebug("OK");
+ LoggerD("OK");
std::map<std::string,std::string>::iterator it;
size_t dataSize = 0;
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "ssm write buf error");
}
- LogDebug("save result : " << ret);
+ LoggerD("save result : " << ret);
}
std::string SecureStorageManager::readStringFromMemory(const char *saveBuf, size_t ¤t, size_t dataSize)
void SecureStorageManager::loadSecurePairData()
{
- LogDebug("OK");
+ LoggerD("OK");
int ret = -1;
size_t num = 0;
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "read buf error");
}
- LogDebug("read result : " << ret << ", length:" << readlen);
+ LoggerD("read result : " << ret << ", length:" << readlen);
memcpy(&num, &saveBuf[index], sizeof(size_t));
index += sizeof(size_t);
memcpy(&dataSize, &saveBuf[index], sizeof(size_t));
index += sizeof(size_t);
- LogDebug("dataSize" << dataSize << "-" << num);
+ LoggerD("dataSize" << dataSize << "-" << num);
for (i = 0; i < num; i++)
{
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "read buf error");
}
m_securePairData[key] = value;
- LogDebug("contents:" << key << "-" << m_securePairData[key]);
+ LoggerD("contents:" << key << "-" << m_securePairData[key]);
}
}
* limitations under the License.
*/
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
-
-
#include "JSSecureStorageManager.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Bluetooth ] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\Bluetooth ] on_widget_start_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Bluetooth] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\Bluetooth] on_widget_stop_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
#include <CommonsJavaScript/JSDOMExceptionFactory.h>
#include "ConverterSystemSetting.h"
#include <CommonsJavaScript/ScopedJSStringRef.h>
+#include <Logger.h>
//#include "JSMessageAttachment.h"
//#include "JSConversation.h"
//#include "JSMessageFolder.h"
SettingType ConverterSystemSetting::toSettingType(JSValueRef arg)
{
- LogDebug("Enter");
+ LoggerD("Enter");
return toSettingType(toJSObjectRef(arg));
}
{
// convert JSvalue to message type enum
std::string strSettingType = toString(arg);
- LogDebug("Setting Type : " << strSettingType);
+ LoggerD("Setting Type : " << strSettingType);
if ( strSettingType.compare("HOME_SCREEN") == 0 )
{
/*
std::string ConverterMessage::toMessageType( long msgtype )
{
- LogDebug("Messasge Type : " << msgtype);
+ LoggerD("Messasge Type : " << msgtype);
switch (msgtype)
{
std::string ConverterMessage::toMessageStatusType( long msgstatus )
{
- LogDebug("Messasge Status : " << msgstatus);
+ LoggerD("Messasge Status : " << msgstatus);
switch (msgstatus)
{
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/Converter.h>
#include "ISystemSettingType.h"
//#include <JSFile.h>
//#include <EventGetNodeData.h>
#include <FilesystemUtils.h>
-
#include "plugin_config.h"
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#define LOG_TAG "TIZEN_N_SYSTEMSETTING"
-#endif
+#include <Logger.h>
using namespace std;
using namespace DPL;
if (priv != NULL)
{
- LogDebug("JSSystemSetting::initialize already");
+ LoggerD("JSSystemSetting::initialize already");
return;
}
Try {
priv = new JSSystemSettingPriv(context, SystemSettings);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
} Catch (UnsupportedException) {
- LogError("UnsupportedException: " << _rethrown_exception.GetMessage());
+ LoggerE("UnsupportedException: " << _rethrown_exception.GetMessage());
} Catch (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());
}
- LogDebug("JSSystemSetting::initialize ");
+ LoggerD("JSSystemSetting::initialize ");
}
JSSystemSettingPriv* priv = static_cast<JSSystemSettingPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting gallery");
+ LoggerD("Deleting gallery");
delete priv;
}
JSValueRef JSSystemSetting::setProperty(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
SettingType settingType;
std::string settingValue;
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 3) {
- LogDebug("Argument is too few");
+ LoggerD("Argument is too few");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
if (!check.isCallback(arguments[2])) {
if (argumentCount > 3) {
if (check.isCallback(arguments[3])) {
onErrorForCbm = arguments[3];
- } else if (!JSValueIsNull(context, arguments[3]) && !JSValueIsUndefined(context, arguments[3])) {
+ } else if (!JSValueIsNull(context, arguments[3])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
else
settingValue = ""; //set empty string.
- LogDebug("real path = " << settingValue);
+ LoggerD("real path = " << settingValue);
}
Catch(WrtDeviceApis::Commons::Exception) {
- LogDebug("settingValue is not Virtual Path");
+ LoggerD("settingValue is not Virtual Path");
}
- LogDebug("settingValue = " << settingValue);
+ LoggerD("settingValue = " << settingValue);
ISystemSettingPtr SystemSettings(priv->getObject());
EventSetSettingPtr dplEvent(new EventSetSetting());
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "invalid value error");
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "platform error");
}
Catch(WrtDeviceApis::Commons::Exception) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown error");
}
- LogDebug("end");
+ LoggerD("end");
TIME_TRACER_ITEM_END(strSettingType.c_str(), 0);
return JSValueMakeUndefined(context);
}
JSValueRef JSSystemSetting::getProperty(JSContextRef context, JSObjectRef object, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("enter");
+ LoggerD("enter");
JSSystemSettingPriv *priv = static_cast<JSSystemSettingPriv*>(JSObjectGetPrivate(thisObject));
ConverterSystemSettingFactory::ConverterType converter = ConverterSystemSettingFactory::getConverter(context);
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 2) {
- LogDebug("Argument is too few");
+ LoggerD("Argument is too few");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
if (!check.isCallback(arguments[1])) {
if (argumentCount > 2) {
if (check.isCallback(arguments[2])) {
onErrorForCbm = arguments[2];
- } else if (!JSValueIsNull(context, arguments[2]) && !JSValueIsUndefined(context, arguments[2])) {
+ } else if (!JSValueIsNull(context, arguments[2])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "invalid value error");
}
Catch(WrtDeviceApis::Commons::PlatformException) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "platform error");
}
Catch(WrtDeviceApis::Commons::Exception) {
- LogDebug("Exception");
+ LoggerD("Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown error");
}
- LogDebug("end");
+ LoggerD("end");
TIME_TRACER_ITEM_BEGIN(strGettingType.c_str(), 0);
return JSValueMakeUndefined(context);
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <string.h>
-
-
#include <system_settings.h>
+#include <Logger.h>
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis::Commons;
void SystemSetting::setWallpaper(const EventSetWallpaperPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventRequestReceiver<EventSetWallpaper>::PostRequest(event);
}
void SystemSetting::setRingtone(const EventSetRingtonePtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventRequestReceiver<EventSetRingtone>::PostRequest(event);
}
void SystemSetting::setProperty(const EventSetSettingPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventRequestReceiver<EventSetSetting>::PostRequest(event);
}
void SystemSetting::getProperty(const EventGetSettingPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
EventRequestReceiver<EventGetSetting>::PostRequest(event);
}
std::string SystemSetting::getProperty(const SettingType settingType)
{
- LogDebug("enter");
+ LoggerD("enter");
int ret = SYSTEM_SETTINGS_ERROR_NONE;
char *value = NULL;
if(settingType == HOME_SCREEN )
{
- LogDebug("home screen");
+ LoggerD("home screen");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &value);
- LogDebug("result : " << ret << " value: "<< value);
+ LoggerD("result : " << ret << " value: "<< value);
}
else if(settingType == LOCK_SCREEN )
{
- LogDebug("lock screen");
+ LoggerD("lock screen");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &value);
- LogDebug("result : " << ret << " value: "<< value);
+ LoggerD("result : " << ret << " value: "<< value);
}else if(settingType == INCOMMING_CALL )
{
- LogDebug("call");
+ LoggerD("call");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &value);
- LogDebug("result : " << ret << " value: "<< value);
+ LoggerD("result : " << ret << " value: "<< value);
}
else if(settingType == NOTIFICATION_EMAIL )
{
- LogDebug("email");
+ LoggerD("email");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &value);
- LogDebug("result : " << ret << " value: "<< value);
+ LoggerD("result : " << ret << " value: "<< value);
}
if(ret == SYSTEM_SETTINGS_ERROR_NONE)
{
- LogDebug("success");
+ LoggerD("success");
gettingValue = value;
return value;
}
else
{
- LogDebug("PlatformException");
+ LoggerD("PlatformException");
ThrowMsg(WrtDeviceApis::Commons::PlatformException, "PlatformException");
}
}
void SystemSetting::OnRequestReceived(const EventSetWallpaperPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
int ret = SYSTEM_SETTINGS_ERROR_NONE;
std::string wallpaperUri = event->getWallpaperURI();
if(strcmp(wallpaperType.c_str(), "HOME_SCREEN") == 0 )
{
- LogDebug("home screen : " << wallpaperUri.c_str());
+ LoggerD("home screen : " << wallpaperUri.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, wallpaperUri.c_str());
}
else if(strcmp(wallpaperType.c_str(), "LOCK_SCREEN") == 0 )
{
- LogDebug("lock screen : " << wallpaperUri.c_str());
+ LoggerD("lock screen : " << wallpaperUri.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, wallpaperUri.c_str());
}
if(ret == SYSTEM_SETTINGS_ERROR_NONE)
{
- LogDebug("success");
+ LoggerD("success");
event->setExceptionCode(ExceptionCodes::None);
}
else
{
- LogDebug("PlatformException");
+ LoggerD("PlatformException");
event->setExceptionCode(ExceptionCodes::PlatformException);
}
- LogDebug("end");
+ LoggerD("end");
}
void SystemSetting::OnRequestReceived(const EventSetRingtonePtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
int ret = SYSTEM_SETTINGS_ERROR_NONE;
std::string ringtoneUri = event->getRingtoneURI();
if(strcmp(ringtoneType.c_str(), "INCOMING_CALL") == 0 )
{
- LogDebug("call : " << ringtoneUri.c_str());
+ LoggerD("call : " << ringtoneUri.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, ringtoneUri.c_str());
}
else if(strcmp(ringtoneType.c_str(), "NOTIFICATION_EMAIL") == 0 )
{
// TODO need manage-api
- LogDebug("email : " << ringtoneUri.c_str());
+ LoggerD("email : " << ringtoneUri.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, ringtoneUri.c_str());
}
if(ret == SYSTEM_SETTINGS_ERROR_NONE)
{
- LogDebug("success");
+ LoggerD("success");
event->setExceptionCode(ExceptionCodes::None);
}
else
{
- LogDebug("PlatformException");
+ LoggerD("PlatformException");
event->setExceptionCode(ExceptionCodes::PlatformException);
}
- LogDebug("end");
+ LoggerD("end");
}
void SystemSetting::OnRequestReceived(const EventSetSettingPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
int ret = SYSTEM_SETTINGS_ERROR_NONE;
std::string settingValue = event->getSettingValue();
if(settingType == HOME_SCREEN )
{
- LogDebug("home screen : " << settingValue.c_str());
+ LoggerD("home screen : " << settingValue.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, settingValue.c_str());
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
else if(settingType == LOCK_SCREEN )
{
- LogDebug("lock screen : " << settingValue.c_str());
+ LoggerD("lock screen : " << settingValue.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, settingValue.c_str());
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}else if(settingType == INCOMMING_CALL )
{
- LogDebug("call : " << settingValue.c_str());
+ LoggerD("call : " << settingValue.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, settingValue.c_str());
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
else if(settingType == NOTIFICATION_EMAIL )
{
- LogDebug("email : " << settingValue.c_str());
+ LoggerD("email : " << settingValue.c_str());
ret = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, settingValue.c_str());
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
if(ret == SYSTEM_SETTINGS_ERROR_NONE)
{
- LogDebug("success");
+ LoggerD("success");
event->setExceptionCode(ExceptionCodes::None);
}
else
{
- LogDebug("PlatformException");
+ LoggerD("PlatformException");
event->setExceptionCode(ExceptionCodes::PlatformException);
}
- LogDebug("end");
+ LoggerD("end");
}
void SystemSetting::OnRequestReceived(const EventGetSettingPtr &event)
{
- LogDebug("enter");
+ LoggerD("enter");
int ret = SYSTEM_SETTINGS_ERROR_NONE;
std::string settingValue;
if(settingType == HOME_SCREEN )
{
- LogDebug("home screen");
+ LoggerD("home screen");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, &value);
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
else if(settingType == LOCK_SCREEN )
{
- LogDebug("lock screen");
+ LoggerD("lock screen");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, &value);
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}else if(settingType == INCOMMING_CALL )
{
- LogDebug("call");
+ LoggerD("call");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_INCOMING_CALL_RINGTONE, &value);
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
else if(settingType == NOTIFICATION_EMAIL )
{
- LogDebug("email");
+ LoggerD("email");
ret = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_EMAIL_ALERT_RINGTONE, &value);
- LogDebug("result : " << ret);
+ LoggerD("result : " << ret);
}
if(ret == SYSTEM_SETTINGS_ERROR_NONE)
{
- LogDebug("success");
+ LoggerD("success");
event->setExceptionCode(ExceptionCodes::None);
}
else
{
- LogDebug("PlatformException");
+ LoggerD("PlatformException");
event->setExceptionCode(ExceptionCodes::PlatformException);
}
settingValue = value;
event->setSettingValue(settingValue);
- LogDebug("end");
+ LoggerD("end");
}
//
#include "SystemSettingResponseDispatcher.h"
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenException.h>
#include <JSTizenExceptionFactory.h>
-
#include <FilesystemUtils.h>
-
#include "SystemSettingAsyncCallbackManager.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
void SystemSettingResponseDispatcher::OnAnswerReceived(const EventSetWallpaperPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
error = JSTizenExceptionFactory::makeErrorObject(gContext, JSTizenException::UNKNOWN_ERROR, "Unknown error");
break;
}
- LogDebug("callOnError");
+ LoggerD("callOnError");
callbackManager->callOnError(error);
return;
}
- LogDebug("callOnSuccess");
+ LoggerD("callOnSuccess");
callbackManager->callOnSuccess();
}
void SystemSettingResponseDispatcher::OnAnswerReceived(const EventSetRingtonePtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
void SystemSettingResponseDispatcher::OnAnswerReceived(const EventSetSettingPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
void SystemSettingResponseDispatcher::OnAnswerReceived(const EventGetSettingPtr &event)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<JSCallbackManager >(event->getPrivateData());
if (!callbackManager) {
- LogError("No listener callback!");
+ LoggerE("No listener callback!");
return;
}
callbackManager->callOnError(error);
return;
}
- LogDebug("gettingValue : " << event->getSettingValue());
+ LoggerD("gettingValue : " << event->getSettingValue());
std::string settingPath = event->getSettingValue();
- LogDebug("RealSettingPath : " << settingPath);
+ LoggerD("RealSettingPath : " << settingPath);
Try
{
settingPath = DeviceAPI::Filesystem::Utils::toVirtualPath(gContext, settingPath);
- LogDebug("VirtualSettingPath : " << settingPath);
+ LoggerD("VirtualSettingPath : " << settingPath);
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- LogDebug("not the virtual path");
- LogDebug("RealSettingSettingPath : " << settingPath);
+ LoggerD("not the virtual path");
+ LoggerD("RealSettingSettingPath : " << settingPath);
}
if (settingPath.size() == 0)
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <TimeTracer.h>
#include "JSSystemSetting.h"
#include "SystemSettingAsyncCallbackManager.h"
+#include <Logger.h>
//#include "MessageListenerManager.h"
namespace DeviceAPI {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\SystemSetting ] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\SystemSetting ] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try
{
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\SystemSetting ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\SystemSetting ] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"SystemSetting");
TIME_TRACER_RELEASE();
Try
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\contact] on_frame_unload_callback (" << context << ")");
DeviceAPI::SystemSetting::SystemSettingAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
// TizenApis::Tizen1_0::MessageListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
#include <JavaScriptCore/JavaScript.h>
#include <dpl/shared_ptr.h>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include "JSNetworkInfo.h"
#include "JSBuildInfo.h"
#include "JSLocaleInfo.h"
#include "JSPeripheralInfo.h"
-
#include "SysteminfoPropertyInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void EventGetSysteminfo::processGetValue(void* handle)
{
- LogDebug("enter");
+ LoggerD("enter");
if (!m_BaseProperty) {
- LogError("property is not set");
+ LoggerE("property is not set");
setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::ConversionException);
} else {
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr m_callbackManager = DPL::StaticPointerCast<WrtDeviceApis::CommonsJavaScript::JSCallbackManager >(getPrivateData());
if (!m_callbackManager) {
- LogError("property is not set");
+ LoggerE("property is not set");
setExceptionCode(WrtDeviceApis::Commons::ExceptionCodes::NullPointerException);
} else {
JSContextRef context = m_callbackManager->getContext();
static Eina_Bool timeout_timer_cb(void* data)
{
- LogDebug("enter");
+ LoggerD("enter");
EventWatchSysteminfo *event = static_cast<EventWatchSysteminfo *> (data);
event->timeoutWatch();
return ECORE_CALLBACK_RENEW;
#define MAX_STORAGE_CNT 3
DPL::Atomic EventWatchSysteminfo::m_uniqId = 1;
-EventWatchSysteminfo::EventWatchSysteminfo() :
- m_initTimer(NULL),
- m_id(m_uniqId),
- m_canceled(false),
- m_lastValue(NULL),
- m_storageCnt(0),
- m_tmpStorageCnt(0),
- m_Systeminfo(NULL)
+EventWatchSysteminfo::EventWatchSysteminfo() : m_id(m_uniqId)
{
+ m_initTimer = NULL;
+ m_canceled = false;
+ m_lastValue = NULL;
+ m_storageCnt = 0;
+ m_tmpStorageCnt = 0;
+ m_Systeminfo = NULL;
++m_uniqId;
}
JSCallbackManagerPtr m_cbm = DPL::StaticPointerCast< JSCallbackManager >(getPrivateData());
JSValueUnprotect(m_cbm->getContext(), m_lastValue);
}
- LogDebug("destroy event data, id=" << m_id);
+ LoggerD("destroy event data, id=" << m_id);
removeTimer();
}
void EventWatchSysteminfo::getWatchValue(int cnt)
{
- LogDebug("enter");
+ LoggerD("enter");
m_tmpStorageCnt = cnt;
processGetValue();
}
void EventWatchSysteminfo::processGetValue()
{
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
if(m_canceled) {
- LogDebug("Watch event is cancelled aleardy.");
+ LoggerD("Watch event is cancelled aleardy.");
return;
}
if (m_Systeminfo == NULL) {
- LogError("systeminfo pointer is not set");
+ LoggerE("systeminfo pointer is not set");
return;
}
if (!tmpValue) {
return;
}
- LogDebug("watchType : " << m_BaseProperty->getWatchType());
+ LoggerD("watchType : " << m_BaseProperty->getWatchType());
if (m_BaseProperty->getWatchType() == WATCH_TYPE_BATTERY) {
std::string key = "level";
}
if (m_tmpStorageCnt == m_storageCnt) {
- LogDebug("enter");
+ LoggerD("enter");
for (int i=0; i<m_tmpStorageCnt; i++) {
- LogDebug("enter");
+ LoggerD("enter");
std::string key = "type";
JSValueRef propertyType = getPropertyValue(context, tmpValueList[i], key);
JSStringRef type = JSValueToStringCopy(context, propertyType, exception);
double capacity = JSValueToNumber(context, propertyCapacity, exception);
propertyCapacity = getPropertyValue(context, lastValueList[i], key);
double prevCapacity = JSValueToNumber(context, propertyCapacity, exception);
- LogDebug("capacity : " << capacity << "prevCapacity : " << prevCapacity);
+ LoggerD("capacity : " << capacity << "prevCapacity : " << prevCapacity);
key = "availableCapacity";
JSValueRef propertyAvailableCapacity = getPropertyValue(context, tmpValueList[i], key);
double availableCapacity = JSValueToNumber(context, propertyAvailableCapacity, exception);
propertyAvailableCapacity = getPropertyValue(context, lastValueList[i], key);
double prevAvailableCapacity = JSValueToNumber(context, propertyAvailableCapacity, exception);
- LogDebug("availableCapacity : " << availableCapacity << "prevAvailableCapacity : " << prevAvailableCapacity);
+ LoggerD("availableCapacity : " << availableCapacity << "prevAvailableCapacity : " << prevAvailableCapacity);
key = "isRemoveable";
JSValueRef propertyIsRemoveable = getPropertyValue(context, tmpValueList[i], key);
bool isRemoveable = JSValueToBoolean(context, propertyIsRemoveable);
propertyIsRemoveable = getPropertyValue(context, lastValueList[i], key);
double prevIsRemoveable = JSValueToBoolean(context, propertyIsRemoveable);
- LogDebug("isRemoveable : " << propertyIsRemoveable << "prevIsRemoveable : " << prevIsRemoveable);
+ LoggerD("isRemoveable : " << propertyIsRemoveable << "prevIsRemoveable : " << prevIsRemoveable);
if (!JSStringIsEqual(type, prevType) || capacity != prevCapacity || availableCapacity != prevAvailableCapacity
|| isRemoveable != prevIsRemoveable) {
- LogDebug("make callback");
+ LoggerD("make callback");
m_cbm->callOnSuccess(tmpValue);
setTimer();
}
m_lastValue = tmpValue;
}
} else {
- LogDebug("enter");
+ LoggerD("enter");
m_cbm->callOnSuccess(tmpValue);
m_storageCnt = m_tmpStorageCnt;
m_lastValue = tmpValue;
double status = JSValueToNumber(context, propertyStatus, exception);
propertyStatus = getPropertyValue(context, m_lastValue, key);
double prevStatus = JSValueToNumber(context, propertyStatus, exception);
- LogDebug("status : " << status << "prevStatus : " << prevStatus);
+ LoggerD("status : " << status << "prevStatus : " << prevStatus);
if (status != prevStatus) {
- LogDebug("make callback");
+ LoggerD("make callback");
m_cbm->callOnSuccess(tmpValue);
setTimer();
}
JSStringRef networkType = JSValueToStringCopy(context, propertyNetworkType, exception);
propertyNetworkType = getPropertyValue(context, m_lastValue, key);
JSStringRef prevNetworkType = JSValueToStringCopy(context, propertyNetworkType, exception);
- LogDebug("networkType : " << networkType << "prevNetworkType : " << prevNetworkType);
+ LoggerD("networkType : " << networkType << "prevNetworkType : " << prevNetworkType);
if (!JSStringIsEqual(networkType ,prevNetworkType)) {
- LogDebug("make callback");
+ LoggerD("make callback");
m_cbm->callOnSuccess(tmpValue);
setTimer();
}
JSStringRef country = JSValueToStringCopy(context, propertyCountry, exception);
propertyCountry = getPropertyValue(context, m_lastValue, key);
JSStringRef prevCountry = JSValueToStringCopy(context, propertyCountry, exception);
- LogDebug("country : " << country << " prevCountry : " << prevCountry);
+ LoggerD("country : " << country << " prevCountry : " << prevCountry);
key = "language";
JSValueRef propertyLanguage = getPropertyValue(context, tmpValue, key);
JSStringRef language = JSValueToStringCopy(context, propertyLanguage, exception);
propertyLanguage = getPropertyValue(context, m_lastValue, key);
JSStringRef prevLanguage = JSValueToStringCopy(context, propertyLanguage, exception);
- LogDebug("language : " << language << " prevLanguage : " << prevLanguage);
+ LoggerD("language : " << language << " prevLanguage : " << prevLanguage);
if (!JSStringIsEqual(language, prevLanguage) || !JSStringIsEqual(country, prevCountry)) {
- LogDebug("make callback");
+ LoggerD("make callback");
m_cbm->callOnSuccess(tmpValue);
setTimer();
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSBatteryInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSBatteryInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSBatteryPriv* priv = static_cast<JSBatteryPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting batteryInfo object");
+ LoggerD("Deleting batteryInfo object");
delete priv;
}
JSObjectRef JSBatteryInfo::createJSObject(JSContextRef context, const BatteryPropertiesPtr batteryInfo)
{
- LogDebug("test");
+ LoggerD("test");
JSBatteryPriv *priv = new JSBatteryPriv(context, batteryInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSBatteryInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSBatteryPriv *priv = static_cast<JSBatteryPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSBuildInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSBuildInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSBuildPriv* priv = static_cast<JSBuildPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting buildInfo object");
+ LoggerD("Deleting buildInfo object");
delete priv;
}
JSValueRef JSBuildInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSBuildPriv *priv = static_cast<JSBuildPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include <SecurityExceptions.h>
#include "JSCellularNetworkInfo.h"
#include "plugin_config.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSCellularNetworkInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSCellularNetworkPriv* priv = static_cast<JSCellularNetworkPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting CellularNetworkInfo object");
+ LoggerD("Deleting CellularNetworkInfo object");
delete priv;
}
JSObjectRef JSCellularNetworkInfo::createJSObject(JSContextRef context, const CellularNetworkPropertiesPtr cellularNetworkInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSCellularNetworkPriv *priv = new JSCellularNetworkPriv(context, cellularNetworkInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSCellularNetworkInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSCellularNetworkPriv *priv = static_cast<JSCellularNetworkPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSCpuInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSCpuInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSCpuPriv* priv = static_cast<JSCpuPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting CpuInfo object");
+ LoggerD("Deleting CpuInfo object");
delete priv;
}
JSObjectRef JSCpuInfo::createJSObject(JSContextRef context, const CpuPropertiesPtr cpuInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSCpuPriv *priv = new JSCpuPriv(context, cpuInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSCpuInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSCpuPriv *priv = static_cast<JSCpuPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
#include <fstream>
#include <pcrecpp.h>
#include <memory>
-#include <dpl/log/log.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include <SecurityExceptions.h>
#include <system_info.h>
#include "JSDeviceCapabilitiesInfo.h"
#include "plugin_config.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSDeviceCapabilitiesInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSDeviceCapabilitiesPriv* priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting DeviceCapabilitiesInfo object");
+ LoggerD("Deleting DeviceCapabilitiesInfo object");
delete priv;
}
JSObjectRef JSDeviceCapabilitiesInfo::createJSObject(JSContextRef context, const DeviceCapabilitiesPropertiesPtr deviceCapabilitiesInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSDeviceCapabilitiesPriv *priv = new JSDeviceCapabilitiesPriv(context, deviceCapabilitiesInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSDeviceCapabilitiesInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSDeviceCapabilitiesPriv *priv = static_cast<JSDeviceCapabilitiesPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BLUETOOTH)) {
bool bluetooth = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_BLUETOOTH_SUPPORTED, &bluetooth) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("bluetooth : " << bluetooth);
+ LoggerD("bluetooth : " << bluetooth);
deviceCapabilitiesInfo->bluetooth = bluetooth;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->bluetooth);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_NFC)) {
bool nfc = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_NFC_SUPPORTED, &nfc) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("nfc : " << nfc);
+ LoggerD("nfc : " << nfc);
deviceCapabilitiesInfo->nfc = nfc;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->nfc);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MULTITOUCHCOUNT)) {
int multiTouchCount = 0;
if (system_info_get_value_int(SYSTEM_INFO_KEY_MULTI_POINT_TOUCH_COUNT, &multiTouchCount) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("multiTouchCount : " << multiTouchCount);
+ LoggerD("multiTouchCount : " << multiTouchCount);
deviceCapabilitiesInfo->multiTouchCount = multiTouchCount;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->multiTouchCount);
char* inputKeyboard = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_KEYBOARD_TYPE, &inputKeyboard) == SYSTEM_INFO_ERROR_NONE) {
if (inputKeyboard != NULL) {
- LogDebug("inputKeyboard : " << inputKeyboard);
- deviceCapabilitiesInfo->inputKeyboard = inputKeyboard;
+ LoggerD("inputKeyboard : " << inputKeyboard);
+ if (strcmp(inputKeyboard, "NULL") == 0) {
+ deviceCapabilitiesInfo->inputKeyboard = false;
+ } else {
+ deviceCapabilitiesInfo->inputKeyboard = true;
+ }
free(inputKeyboard);
}
}
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFI)) {
bool wifi = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_WIFI_SUPPORTED, &wifi) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("wifi : " << wifi);
+ LoggerD("wifi : " << wifi);
deviceCapabilitiesInfo->wifi = wifi;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->wifi);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_WIFIDIRECT)) {
bool wifiDirect = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_WIFI_DIRECT_SUPPORTED, &wifiDirect) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("wifiDirect : " << wifiDirect);
+ LoggerD("wifiDirect : " << wifiDirect);
deviceCapabilitiesInfo->wifiDirect = wifiDirect;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->wifiDirect);
char* openglesVersion = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_OPENGLES_VERSION, &openglesVersion) == SYSTEM_INFO_ERROR_NONE) {
if (openglesVersion!= NULL) {
- LogDebug("openglesVersion : " << openglesVersion);
+ LoggerD("openglesVersion : " << openglesVersion);
if (strcmp(openglesVersion, "1.0") == 0) {
deviceCapabilitiesInfo->openglesVersion1_1 = true;
} else if (strcmp(openglesVersion, "1.0/2.0") == 0) {
char* openglesVersion = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_OPENGLES_VERSION, &openglesVersion) == SYSTEM_INFO_ERROR_NONE) {
if (openglesVersion!= NULL) {
- LogDebug("openglesVersion : " << openglesVersion);
+ LoggerD("openglesVersion : " << openglesVersion);
if (strcmp(openglesVersion, "2.0") == 0) {
deviceCapabilitiesInfo->openglesVersion2_0 = true;
} else if (strcmp(openglesVersion, "1.0/2.0") == 0) {
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_FMRADIO)) {
bool fmRadio = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_FMRADIO_SUPPORTED, &fmRadio) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("fmRadio : " << fmRadio);
+ LoggerD("fmRadio : " << fmRadio);
deviceCapabilitiesInfo->fmRadio = fmRadio;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->fmRadio);
char* platformVersion = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_TIZEN_VERSION, &platformVersion) == SYSTEM_INFO_ERROR_NONE) {
if (platformVersion) {
- LogDebug("platformVersion : " << platformVersion);
+ LoggerD("platformVersion : " << platformVersion);
deviceCapabilitiesInfo->platformVersion = platformVersion;
free(platformVersion);
}
char* platformName = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_PLATFORM_NAME, &platformName) == SYSTEM_INFO_ERROR_NONE) {
if (platformName) {
- LogDebug("platformName : " << platformName);
+ LoggerD("platformName : " << platformName);
deviceCapabilitiesInfo->platformName = platformName;
free(platformName);
}
std::string webApiVersionMinor = "";
if(!file) {
- LogDebug("api/native version info file not found");
+ LoggerD("api/native version info file not found");
} else {
while ((std::getline(file, line).rdstate() & (std::ifstream::failbit | std::ifstream::eofbit)) == 0) {
if (pcrecpp::RE("platform.web.api.version=(\\w+).(\\w+)").PartialMatch(line, &webApiVersionMajor, &webApiVersionMinor)) {
deviceCapabilitiesInfo->webApiVersion = webApiVersionMajor;
deviceCapabilitiesInfo->webApiVersion += ".";
deviceCapabilitiesInfo->webApiVersion += webApiVersionMinor;
- LogDebug("web api version : " << deviceCapabilitiesInfo->webApiVersion);
+ LoggerD("web api version : " << deviceCapabilitiesInfo->webApiVersion);
break;
}
}
std::string nativeApiVersionMinor = "";
if(!file) {
- LogDebug("api/native version info file not found");
+ LoggerD("api/native version info file not found");
} else {
while ((std::getline(file, line).rdstate() & (std::ifstream::failbit | std::ifstream::eofbit)) == 0) {
if (pcrecpp::RE("platform.native.api.version=(\\w+).(\\w+)").PartialMatch(line, &nativeApiVersionMajor, &nativeApiVersionMinor )) {
deviceCapabilitiesInfo->nativeApiVersion = nativeApiVersionMajor;
deviceCapabilitiesInfo->nativeApiVersion += ".";
deviceCapabilitiesInfo->nativeApiVersion += nativeApiVersionMinor;
- LogDebug("native api version : " << deviceCapabilitiesInfo->nativeApiVersion);
+ LoggerD("native api version : " << deviceCapabilitiesInfo->nativeApiVersion);
break;
}
}
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONT)) {
bool cameraFront = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_FRONT_CAMERA_SUPPORTED, &cameraFront) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("cameraFront : " << cameraFront);
+ LoggerD("cameraFront : " << cameraFront);
deviceCapabilitiesInfo->cameraFront = cameraFront;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFront);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERAFRONTFLASH)) {
bool cameraFrontFlash = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_FRONT_CAMERA_FLASH_SUPPORTED, &cameraFrontFlash) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("cameraFrontFlash : " << cameraFrontFlash);
+ LoggerD("cameraFrontFlash : " << cameraFrontFlash);
deviceCapabilitiesInfo->cameraFrontFlash = cameraFrontFlash;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->cameraFrontFlash);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACK)) {
bool cameraBack = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_BACK_CAMERA_SUPPORTED, &cameraBack) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("cameraBack : " << cameraBack);
+ LoggerD("cameraBack : " << cameraBack);
deviceCapabilitiesInfo->cameraBack = cameraBack;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBack);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_CAMERABACKFLASH)) {
bool cameraBackFlash = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_BACK_CAMERA_FLASH_SUPPORTED, &cameraBackFlash) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("cameraBackFlash : " << cameraBackFlash);
+ LoggerD("cameraBackFlash : " << cameraBackFlash);
deviceCapabilitiesInfo->cameraBackFlash = cameraBackFlash;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->cameraBackFlash);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATION)) {
bool location = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_CPS_SUPPORTED, &location) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("location : " << location);
+ LoggerD("location : " << location);
deviceCapabilitiesInfo->location = location;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->location);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONGPS)) {
bool locationGps = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_GPS_SUPPORTED, &locationGps) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("locationGps : " << locationGps);
+ LoggerD("locationGps : " << locationGps);
deviceCapabilitiesInfo->locationGps = locationGps;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->locationGps);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_LOCATIONWPS)) {
bool locationWps = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_WPS_SUPPORTED, &locationWps) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("locationWps : " << locationWps);
+ LoggerD("locationWps : " << locationWps);
deviceCapabilitiesInfo->locationWps = locationWps;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->locationWps);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MICROPHONE)) {
bool microphone = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_MICROPHONE_SUPPORTED, µphone) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("microphone : " << microphone);
+ LoggerD("microphone : " << microphone);
deviceCapabilitiesInfo->microphone = microphone;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->microphone);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBHOST)) {
bool usbHost = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_USB_HOST_SUPPORTED, &usbHost) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("usbHost : " << usbHost);
+ LoggerD("usbHost : " << usbHost);
deviceCapabilitiesInfo->usbHost = usbHost;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->usbHost);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_USBACCESSORY)) {
bool usbAccessory = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_USB_ACCESSORY_SUPPORTED, &usbAccessory) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("usbAccessory : " << usbAccessory);
+ LoggerD("usbAccessory : " << usbAccessory);
deviceCapabilitiesInfo->usbAccessory = usbAccessory;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->usbAccessory);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTRCA)) {
bool screenOutputRca = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_RCA_SUPPORTED, &screenOutputRca) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("screenOutputRca : " << screenOutputRca);
+ LoggerD("screenOutputRca : " << screenOutputRca);
deviceCapabilitiesInfo->screenOutputRca = screenOutputRca;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputRca);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SCREENOUTPUTHDMI)) {
bool screenOutputHdmi = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_HDMI_SUPPORTED, &screenOutputHdmi) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("screenOutputHdmi : " << screenOutputHdmi);
+ LoggerD("screenOutputHdmi : " << screenOutputHdmi);
deviceCapabilitiesInfo->screenOutputHdmi = screenOutputHdmi;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->screenOutputHdmi);
char* platformCoreCpuArch = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_CORE_CPU_ARCH, &platformCoreCpuArch) == SYSTEM_INFO_ERROR_NONE) {
if (platformCoreCpuArch) {
- LogDebug("platformCoreCpuArch : " << platformCoreCpuArch);
+ LoggerD("platformCoreCpuArch : " << platformCoreCpuArch);
deviceCapabilitiesInfo->platformCoreCpuArch = platformCoreCpuArch;
free(platformCoreCpuArch);
}
char* platformCoreFpuArch = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_CORE_FPU_ARCH, &platformCoreFpuArch) == SYSTEM_INFO_ERROR_NONE) {
if (platformCoreFpuArch) {
- LogDebug("platformCoreFpuArch : " << platformCoreFpuArch);
+ LoggerD("platformCoreFpuArch : " << platformCoreFpuArch);
deviceCapabilitiesInfo->platformCoreFpuArch = platformCoreFpuArch;
free(platformCoreFpuArch);
}
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SIPVOIP)) {
bool sipVoip = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_SIP_VOIP_SUPPORTED, &sipVoip) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("sipVoip : " << sipVoip);
+ LoggerD("sipVoip : " << sipVoip);
deviceCapabilitiesInfo->sipVoip = sipVoip;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
char* duid = NULL;
if (system_info_get_value_string(SYSTEM_INFO_KEY_DEVICE_UUID, &duid) == SYSTEM_INFO_ERROR_NONE) {
if (duid) {
- LogDebug("duid : " << duid);
+ LoggerD("duid : " << duid);
deviceCapabilitiesInfo->duid = duid;
free(duid);
}
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) {
bool speechRecognition = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_SPEECH_RECOGNITION_SUPPORTED, &speechRecognition) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("speechRecognition : " << speechRecognition);
+ LoggerD("speechRecognition : " << speechRecognition);
deviceCapabilitiesInfo->speechRecognition = speechRecognition;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->speechRecognition);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_ACCELEROMETER)) {
bool isAccelerometer = false;
if (sensor_is_supported(SENSOR_ACCELEROMETER, &isAccelerometer) == SENSOR_ERROR_NONE) {
- LogDebug("accelerometer : " << isAccelerometer);
+ LoggerD("accelerometer : " << isAccelerometer);
deviceCapabilitiesInfo->accelerometer = isAccelerometer;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->accelerometer);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_BAROMETER)) {
bool isBarometer = false;
if (system_info_get_value_bool(SYSTEM_INFO_KEY_BAROMETER_SENSOR_SUPPORTED, &isBarometer) == SYSTEM_INFO_ERROR_NONE) {
- LogDebug("barometer : " << isBarometer);
+ LoggerD("barometer : " << isBarometer);
deviceCapabilitiesInfo->barometer = isBarometer;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->barometer);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_GYROSCOPE)) {
bool isGyroscope = false;
if (sensor_is_supported(SENSOR_GYROSCOPE, &isGyroscope) == SENSOR_ERROR_NONE) {
- LogDebug("gyroscope : " << isGyroscope);
+ LoggerD("gyroscope : " << isGyroscope);
deviceCapabilitiesInfo->gyroscope = isGyroscope;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->gyroscope);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_MAGNETOMETER)) {
bool isMagnetometer = false;
if (sensor_is_supported(SENSOR_MAGNETIC, &isMagnetometer) == SENSOR_ERROR_NONE) {
- LogDebug("magnetometer : " << isMagnetometer);
+ LoggerD("magnetometer : " << isMagnetometer);
deviceCapabilitiesInfo->magnetometer = isMagnetometer;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->magnetometer);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_PROXIMITY)) {
bool isProximity = false;
if (sensor_is_supported(SENSOR_PROXIMITY, &isProximity) == SENSOR_ERROR_NONE) {
- LogDebug("proximity : " << isProximity);
+ LoggerD("proximity : " << isProximity);
deviceCapabilitiesInfo->proximity = isProximity;
}
return convert.toJSValueRef(deviceCapabilitiesInfo->proximity);
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSDeviceOrientationInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSDeviceOrientationInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSDeviceOrientationPriv* priv = static_cast<JSDeviceOrientationPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting deviceOrientationInfo object");
+ LoggerD("Deleting deviceOrientationInfo object");
delete priv;
}
JSValueRef JSDeviceOrientationInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSDeviceOrientationPriv *priv = static_cast<JSDeviceOrientationPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSDisplayInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSDisplayInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSDisplayPriv* priv = static_cast<JSDisplayPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting DisplayInfo object");
+ LoggerD("Deleting DisplayInfo object");
delete priv;
}
JSValueRef JSDisplayInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSDisplayPriv *priv = static_cast<JSDisplayPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSLocaleInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSLocaleInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSLocalePriv* priv = static_cast<JSLocalePriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting localeInfo object");
+ LoggerD("Deleting localeInfo object");
delete priv;
}
JSValueRef JSLocaleInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSLocalePriv *priv = static_cast<JSLocalePriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSNetworkInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSNetworkInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSNetworkPriv* priv = static_cast<JSNetworkPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting networkInfo object");
+ LoggerD("Deleting networkInfo object");
delete priv;
}
JSValueRef JSNetworkInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSNetworkPriv *priv = static_cast<JSNetworkPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSPeripheralInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSPeripheralInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSPeripheralPriv* priv = static_cast<JSPeripheralPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting peripheralInfo object");
+ LoggerD("Deleting peripheralInfo object");
delete priv;
}
JSValueRef JSPeripheralInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSPeripheralPriv *priv = static_cast<JSPeripheralPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
#include <SecurityExceptions.h>
#include <sim.h>
#include "JSSIMInfo.h"
#include "plugin_config.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
using namespace DeviceAPI::Common;
namespace {
+const char* SIM_STATE_PROPERTY = "state";
const char* SIM_OPERATORNAME_PROPERTY = "operatorName";
const char* SIM_MSISDN_PROPERTY = "msisdn";
const char* SIM_ICCID_PROPERTY = "iccid";
};
JSStaticValue JSSIMInfo::m_properties[] = {
+ { SIM_STATE_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ SIM_OPERATORNAME_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ SIM_MSISDN_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ SIM_ICCID_PROPERTY, getProperty, NULL, kJSPropertyAttributeReadOnly },
void JSSIMInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSSIMPriv* priv = static_cast<JSSIMPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting SIM Info object");
+ LoggerD("Deleting SIM Info object");
delete priv;
}
JSObjectRef JSSIMInfo::createJSObject(JSContextRef context, const SIMPropertiesPtr SIMInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSSIMPriv *priv = new JSSIMPriv(context, SIMInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSSIMInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSSIMPriv *priv = static_cast<JSSIMPriv*>(JSObjectGetPrivate(object));
int ret = SIM_ERROR_NONE;
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
{
SIMPropertiesPtr SIMInfo = priv->getObject();
Converter convert(context);
-
- if (JSStringIsEqualToUTF8CString(propertyName, SIM_OPERATORNAME_PROPERTY)) {
+ if (JSStringIsEqualToUTF8CString(propertyName, SIM_STATE_PROPERTY)) {
+ AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_PROPERTY_SIM_VALUE);
+ TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
+ sim_state_e state;
+ ret = sim_get_state(&state);
+ if (ret == SIM_ERROR_NONE) {
+ if (state == SIM_STATE_UNAVAILABLE) {
+ SIMInfo->state = "ABSENT";
+ } else if (state == SIM_STATE_LOCKED) {
+ SIMInfo->state = "PIN_REQUIRED";
+ } else if (state == SIM_STATE_AVAILABLE) {
+ SIMInfo->state = "READY";
+ } else if (state == SIM_STATE_UNKNOWN) {
+ SIMInfo->state = "INITIALIZING";
+ }
+ }
+ return convert.toJSValueRef(SIMInfo->state);
+ } else if (JSStringIsEqualToUTF8CString(propertyName, SIM_OPERATORNAME_PROPERTY)) {
AceSecurityStatus status = SYSTEMINFO_CHECK_ACCESS(SYSTEMINFO_FUNCTION_API_GET_PROPERTY_SIM_VALUE);
TIZEN_SYNC_ACCESS_HANDLER(status, context, exception);
char* fullName = NULL;
if (ret == SIM_ERROR_NONE) {
if (fullName) {
SIMInfo->operatorName = fullName;
- LogDebug("operatorName : " << SIMInfo->operatorName);
+ LoggerD("operatorName : " << SIMInfo->operatorName);
free(fullName);
} else if (shortName) {
SIMInfo->operatorName = shortName;
- LogDebug("operatorName : " << SIMInfo->operatorName);
+ LoggerD("operatorName : " << SIMInfo->operatorName);
free(shortName);
}
}
if (ret == SIM_ERROR_NONE) {
if (msisdn) {
SIMInfo->msisdn = msisdn;
- LogDebug("msisdn : " << SIMInfo->msisdn);
+ LoggerD("msisdn : " << SIMInfo->msisdn);
free(msisdn);
}
}
if (ret == SIM_ERROR_NONE) {
if (iccId) {
SIMInfo->iccid = iccId;
- LogDebug("iccid : " << SIMInfo->iccid);
+ LoggerD("iccid : " << SIMInfo->iccid);
free(iccId);
}
}
if (ret == SIM_ERROR_NONE) {
if (mcc) {
SIMInfo->mcc = atoi(mcc);
- LogDebug("mcc : " << SIMInfo->mcc);
+ LoggerD("mcc : " << SIMInfo->mcc);
free(mcc);
}
}
if (ret == SIM_ERROR_NONE) {
if (mnc) {
SIMInfo->mnc = atoi(mnc);
- LogDebug("mnc : " << SIMInfo->mnc);
+ LoggerD("mnc : " << SIMInfo->mnc);
free(mnc);
}
}
if (ret == SIM_ERROR_NONE) {
if (msin) {
SIMInfo->msin = msin;
- LogDebug("msin : " << SIMInfo->msin);
+ LoggerD("msin : " << SIMInfo->msin);
free(msin);
}
}
if (ret == SIM_ERROR_NONE) {
if (spn) {
SIMInfo->spn = spn;
- LogDebug("spn : " << SIMInfo->spn);
+ LoggerD("spn : " << SIMInfo->spn);
free(spn);
}
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSStorageInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSStorageInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSStoragePriv* priv = static_cast<JSStoragePriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting StorageInfo object");
+ LoggerD("Deleting StorageInfo object");
delete priv;
}
JSValueRef JSStorageInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSStoragePriv *priv = static_cast<JSStoragePriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
ISysteminfoPtr Systeminfos(SysteminfoFactory::getInstance().getSysteminfos());
JSSysteminfoPriv* priv = new JSSysteminfoPriv(context, Systeminfos);
if (!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
- LogDebug("JSSysteminfo::initialize ");
+ LoggerD("JSSysteminfo::initialize ");
} else {
- LogDebug("Private object already set.");
+ LoggerD("Private object already set.");
}
}
JSSysteminfoPriv* priv = static_cast<JSSysteminfoPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting gallery");
+ LoggerD("Deleting gallery");
delete priv;
}
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Try
std::string property;
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 2) {
if (argumentCount == 3) {
if (check.isCallback(arguments[2])) {
onErrorForCbm = arguments[2];
- } else if (!JSValueIsNull(context, arguments[2]) && !JSValueIsUndefined(context, arguments[2])) {
+ } else if (!JSValueIsNull(context, arguments[2])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
Try {
ISysteminfoPtr Systeminfos(priv->getObject());
+ BasePropertyPtr baseProperty = Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]);
EventGetSysteminfoPtr event(new EventGetSysteminfo());
- event->setBasePropertyPtr(Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]));
+ event->setBasePropertyPtr(baseProperty);
TIME_TRACER_ITEM_BEGIN(event->getProperty(), 0);
event->setPrivateData(StaticPointerCast<IEventPrivateData>(cbm));
return JSValueMakeUndefined(context);
}
- Catch(WrtDeviceApis::Commons::PendingOperationException) {
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown error"));
- }
Catch(WrtDeviceApis::Commons::ConversionException) {
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error"));
- }
- Catch(WrtDeviceApis::Commons::InvalidArgumentException){
- cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error"));
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::Exception) {
cbm->callOnError(JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown error"));
Validator check(context, exception);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 2) {
option.timeout = converter.toULong(JSUtils::getJSProperty(context, arguments[2], "timeout", exception));
option.highThreshold = converter.toDouble(JSUtils::getJSProperty(context, arguments[2], "highThreshold", exception));
option.lowThreshold = converter.toDouble(JSUtils::getJSProperty(context, arguments[2], "lowThreshold", exception));
- } else if (!JSValueIsNull(context, arguments[2]) && !JSValueIsUndefined(context, arguments[2])) {
+ } else if (!JSValueIsNull(context, arguments[2])) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
}
ISysteminfoPtr Systeminfos(priv->getObject());
+ BasePropertyPtr baseProperty = Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]);
EventWatchSysteminfoPtr event(new EventWatchSysteminfo);
event->setWatchOption(option);
- event->setBasePropertyPtr(Systeminfos->getBasePropertyPtr(priv->getContext(), arguments[0]));
+ event->setBasePropertyPtr(baseProperty);
event->setPrivateData(StaticPointerCast<IEventPrivateData>(cbm));
SysteminfoListener& listener = SysteminfoListener::getInstance();
event->setForAsynchronousCall(&listener);
Systeminfos->watch(event);
- LogDebug("event->getId()" << event->getId());
+ LoggerD("event->getId()" << event->getId());
SysteminfoListenerCancellerPtr canceller = SysteminfoListenerCancellerPtr(new SysteminfoListenerCanceller(priv->getContext(), thisObject, event->getId()));
DeviceAPI::Common::IListenerItemPtr listenerItem = DPL::StaticPointerCast<DeviceAPI::Common::IListenerItem>(canceller);
}
Catch(WrtDeviceApis::Commons::ConversionException) {
- return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error");
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type missmatch error");
}
Catch(WrtDeviceApis::Commons::InvalidArgumentException) {
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid values error");
Converter converter(context);
if (!priv) {
- LogError("private object is null");
+ LoggerE("private object is null");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Wrong Object");
}
if (argumentCount < 1) {
ISysteminfoPtr Systeminfos(priv->getObject());
id = static_cast<long>(converter.toLong(arguments[0]));
- LogDebug("clearWatch id = " << id );
+ LoggerD("clearWatch id = " << id );
Systeminfos->clearWatch(id);
SysteminfoListenerCancellerPtr canceller = SysteminfoListenerCancellerPtr(new SysteminfoListenerCanceller(priv->getContext(), thisObject, id));
//
#include <memory>
-#include <dpl/log/log.h>
#include "JSWifiNetworkInfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void JSWifiNetworkInfo::Finalize(JSObjectRef object)
{
- LogDebug("Entered");
+ LoggerD("Entered");
JSWifiNetworkPriv* priv = static_cast<JSWifiNetworkPriv*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting WifiNetworkInfo object");
+ LoggerD("Deleting WifiNetworkInfo object");
delete priv;
}
JSObjectRef JSWifiNetworkInfo::createJSObject(JSContextRef context, const WifiNetworkPropertiesPtr wifiNetworkInfo)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSWifiNetworkPriv *priv = new JSWifiNetworkPriv(context, wifiNetworkInfo);
return JSObjectMake(context, getClassRef(), priv);
}
JSValueRef JSWifiNetworkInfo::getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
JSWifiNetworkPriv *priv = static_cast<JSWifiNetworkPriv*>(JSObjectGetPrivate(object));
if (NULL == priv) {
- LogError("Private object not set.");
+ LoggerE("Private object not set.");
return JSValueMakeUndefined(context);
}
}
Catch(Exception)
{
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
#include <stddef.h>
#include <cassert>
-#include <dpl/log/log.h>
#include <math.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/Converter.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <TimeTracer.h>
#include "Systeminfo.h"
+#include <Logger.h>
using namespace WrtDeviceApis::CommonsJavaScript;
using namespace WrtDeviceApis::Commons;
void OrientationValueCallback(unsigned int event_type, sensor_event_data_t *event , void *event_ptr)
{
- LogDebug("enter");
+ LoggerD("enter");
if(event_ptr) {
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_DEVICE_ORIENTATION);
}
void localeChangedCallback(runtime_info_key_e key, void* event_ptr)
{
- LogDebug("enter");
+ LoggerD("enter");
if(event_ptr) {
((Systeminfo*)event_ptr)->getWatchValue(WATCH_TYPE_LOCALE);
}
int ret = connection_create(&m_connectionHandle);
if (CONNECTION_ERROR_NONE == ret) {
- LogDebug("Network Client registration success");
+ LoggerD("Network Client registration success");
} else {
- LogDebug("Network Client registration success");
+ LoggerD("Network Client registration success");
m_connectionHandle = NULL;
}
m_sensorHandle = sf_connect(ACCELEROMETER_SENSOR);
if (m_sensorHandle < 0) {
- LogDebug ("sensor attach fail");
+ LoggerD ("sensor attach fail");
} else {
- LogDebug("m_sensorHandle : " << m_sensorHandle);
+ LoggerD("m_sensorHandle : " << m_sensorHandle);
int state = sf_start(m_sensorHandle, 0);
if(state < 0) {
- LogDebug("failed");
+ LoggerD("failed");
}
}
}
m_EventMgrPtr->clearAllEvent();
if(m_connectionHandle != NULL) {
- LogDebug("Network Client deregistration success");
+ LoggerD("Network Client deregistration success");
connection_destroy(m_connectionHandle);
} else {
- LogDebug("Network Client deregistration failed");
+ LoggerD("Network Client deregistration failed");
}
state = sf_stop(m_sensorHandle);
- LogDebug("handle 1 state = " << state);
+ LoggerD("handle 1 state = " << state);
state = sf_disconnect(m_sensorHandle);
- LogDebug("handle state =" << state);
+ LoggerD("handle state =" << state);
}
DeviceCapabilitiesPropertiesPtr Systeminfo::getCapabilities()
{
- LogDebug("enter");
+ LoggerD("enter");
DeviceCapabilitiesPropertiesPtr deviceCapabilities(new DeviceCapabilitiesProperties());
return deviceCapabilities;
}
void Systeminfo::watch(const EventWatchSysteminfoPtr& event)
{
if(event->getWatchType() == WATCH_TYPE_UNKNOWN) {
- LogDebug("watch method is not supported");
+ LoggerD("watch method is not supported");
event->setId(-1);
return;
}
void Systeminfo::clearWatch(const long id)
{
if (id < 1) {
- Throw(InvalidArgumentException);
+ Throw(WrtDeviceApis::Commons::InvalidArgumentException);
} else {
int watchType = m_EventMgrPtr->getWatchType(id);
switch(watchType) {
if ((m_EventMgrPtr->getEventDeviceOrientationList()).size() == 1) {
int state = sf_unregister_event(m_sensorHandle, ACCELEROMETER_EVENT_ROTATION_CHECK);
if (state < 0) {
- LogDebug("sf_unregister_event fail to gather data\n");
+ LoggerD("sf_unregister_event fail to gather data\n");
}
}
break;
case WATCH_TYPE_LOCALE:
if ((m_EventMgrPtr->getEventLocaleList()).size() == 1) {
- runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_LANGUAGE);
- runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_REGION);
+ if (runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_LANGUAGE) != RUNTIME_INFO_ERROR_NONE) {
+ LoggerE("regist failed");
+ Throw(WrtDeviceApis::Commons::Exception);
+ }
+ if (runtime_info_unset_changed_cb(RUNTIME_INFO_KEY_REGION) != RUNTIME_INFO_ERROR_NONE) {
+ LoggerE("regist failed");
+ Throw(WrtDeviceApis::Commons::Exception);
+ }
}
break;
case WATCH_TYPE_PERIPHERAL:
}
break;
case WATCH_TYPE_UNKNOWN:
- Throw(InvalidArgumentException);
+ Throw(WrtDeviceApis::Commons::InvalidArgumentException);
break;
}
m_EventMgrPtr->removeEvent(id, watchType);
std::string l_property = converter.toString(property);
mapProperties::iterator it = (*m_Property).find(l_property);
if (it == (*m_Property).end()) {
- LogError("not existing property");
- Throw(InvalidArgumentException);
+ LoggerE("not existing property");
+ Throw(WrtDeviceApis::Commons::ConversionException);
return BasePropertyPtr(NULL);
}
storageCnt++;
}
}
- LogDebug("storage cnt : " << storageCnt);
+ LoggerD("storage cnt : " << storageCnt);
(*it)->getWatchValue(storageCnt);
}
}else if (watchType == WATCH_TYPE_DEVICE_ORIENTATION) {
JSValueRef Systeminfo::getCpuValue(JSContextRef context)
{
- LogDebug("enter");
+ LoggerD("enter");
Converter converter(context);
CpuPropertiesPtr cpuPtr(new CpuProperties());
FILE *fp = NULL;
- unsigned long long usr = 0, nice = 0, system = 0, idle = 0, cpuUsage = 0, diffIdle = 0, total = 0;
+ long long usr = 0, nice = 0, system = 0, idle = 0, cpuUsage = 0, diffIdle = 0, total = 0;
fp = fopen("/proc/stat", "r");
if(fp == NULL) {
if (fscanf(fp, "%*s %lld %lld %lld %lld", &usr, &system, &nice, &idle) > 0) {
total = usr + nice + system + idle - m_cpuInfo.usr - m_cpuInfo.nice - m_cpuInfo.system - m_cpuInfo.idle;
diffIdle = idle-m_cpuInfo.idle;
- if ((total > 0ULL) && (diffIdle > 0ULL)) {
- cpuUsage = diffIdle * 100ULL / total;
+ if ((total > 0LL) && (diffIdle > 0LL)) {
+ cpuUsage = diffIdle * 100LL / total;
cpuPtr->load = (double)cpuUsage / 100.0;
m_cpuInfo.usr = usr;
m_cpuInfo.system = system;
m_cpuInfo.nice = nice;
m_cpuInfo.idle = idle;
- LogDebug("cpu load : " << cpuPtr->load);
+ LoggerD("cpu load : " << cpuPtr->load);
}
}
void Systeminfo::OnRequestReceived(const EventGetSysteminfoPtr& event)
{
- LogDebug("enter");
+ LoggerD("enter");
event->processGetValue((void *)m_connectionHandle);
}
}
break;
case WATCH_TYPE_DEVICE_ORIENTATION:
- LogDebug("regist sensor");
+ LoggerD("regist sensor");
if ((m_EventMgrPtr->getEventDeviceOrientationList()).size() == 1) {
int state = sf_register_event(m_sensorHandle, ACCELEROMETER_EVENT_ROTATION_CHECK, NULL, OrientationValueCallback, (void *)this);
if (state < 0) {
- LogDebug("sensor_register_cb fail to gather data");
+ LoggerD("sensor_register_cb fail to gather data");
} else if (state == 0) {
- LogDebug("sensor_register_cb success to gather data");
+ LoggerD("sensor_register_cb success to gather data");
}
} else {
- LogDebug("already regist");
+ LoggerD("already regist");
}
break;
case WATCH_TYPE_LOCALE:
if ((m_EventMgrPtr->getEventLocaleList()).size() == 1) {
- runtime_info_set_changed_cb(RUNTIME_INFO_KEY_REGION, localeChangedCallback, (void *)this);
- runtime_info_set_changed_cb(RUNTIME_INFO_KEY_LANGUAGE, localeChangedCallback, (void *)this);
+ if (runtime_info_set_changed_cb(RUNTIME_INFO_KEY_REGION, localeChangedCallback, (void *)this) != RUNTIME_INFO_ERROR_NONE) {
+ LoggerE("regist failed");
+ Throw(WrtDeviceApis::Commons::Exception);
+ }
+ if (runtime_info_set_changed_cb(RUNTIME_INFO_KEY_LANGUAGE, localeChangedCallback, (void *)this) != RUNTIME_INFO_ERROR_NONE) {
+ LoggerE("regist failed");
+ Throw(WrtDeviceApis::Commons::Exception);
+ }
}
break;
case WATCH_TYPE_PERIPHERAL:
while (!m_eventBatteryList.empty()) {
EventWatchSysteminfoPtr event = m_eventBatteryList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventBatteryList.pop_front();
}
while (!m_eventDisplayList.empty()) {
EventWatchSysteminfoPtr event = m_eventDisplayList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventDisplayList.pop_front();
}
while (!m_eventWifiNetworkList.empty()) {
EventWatchSysteminfoPtr event = m_eventWifiNetworkList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventWifiNetworkList.pop_front();
}
while (!m_eventCelluarNetworkList.empty()) {
EventWatchSysteminfoPtr event = m_eventCelluarNetworkList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventCelluarNetworkList.pop_front();
}
while (!m_eventStorageList.empty()) {
EventWatchSysteminfoPtr event = m_eventStorageList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventStorageList.pop_front();
}
while (!m_eventCpuList.empty()) {
EventWatchSysteminfoPtr event = m_eventCpuList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventCpuList.pop_front();
}
while (!m_eventSimList.empty()) {
EventWatchSysteminfoPtr event = m_eventSimList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventSimList.pop_front();
}
while (!m_eventDeviceOrientationList.empty()) {
EventWatchSysteminfoPtr event = m_eventDeviceOrientationList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventDeviceOrientationList.pop_front();
}
while (!m_eventLocaleList.empty()) {
EventWatchSysteminfoPtr event = m_eventLocaleList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventLocaleList.pop_front();
}
while (!m_eventPeripheralList.empty()) {
EventWatchSysteminfoPtr event = m_eventPeripheralList.front();
- LogDebug("removing EventId=" << event->getId());
+ LoggerD("removing EventId=" << event->getId());
event->clearWatch();
m_eventPeripheralList.pop_front();
}
if (watchType == WATCH_TYPE_BATTERY){
m_eventBatteryList.push_back(arg);
- LogDebug("Event Battery list size=" << m_eventBatteryList.size());
+ LoggerD("Event Battery list size=" << m_eventBatteryList.size());
} else if (watchType == WATCH_TYPE_DISPLAY) {
m_eventDisplayList.push_back(arg);
- LogDebug("Event display list size=" << m_eventDisplayList.size());
+ LoggerD("Event display list size=" << m_eventDisplayList.size());
} else if (watchType == WATCH_TYPE_WIFINETWORK) {
m_eventWifiNetworkList.push_back(arg);
- LogDebug("Event wifi network list size=" << m_eventWifiNetworkList.size());
+ LoggerD("Event wifi network list size=" << m_eventWifiNetworkList.size());
} else if (watchType == WATCH_TYPE_CELLULARNETWORK) {
m_eventCelluarNetworkList.push_back(arg);
- LogDebug("Event cellular network list size=" << m_eventCelluarNetworkList.size());
+ LoggerD("Event cellular network list size=" << m_eventCelluarNetworkList.size());
} else if (watchType == WATCH_TYPE_STORAGE) {
m_eventStorageList.push_back(arg);
- LogDebug("Event storage list size=" << m_eventStorageList.size());
+ LoggerD("Event storage list size=" << m_eventStorageList.size());
} else if (watchType == WATCH_TYPE_CPU) {
m_eventCpuList.push_back(arg);
- LogDebug("Event cpu list size=" << m_eventCpuList.size());
+ LoggerD("Event cpu list size=" << m_eventCpuList.size());
} else if (watchType == WATCH_TYPE_SIM) {
m_eventSimList.push_back(arg);
- LogDebug("Event sim list size=" << m_eventSimList.size());
+ LoggerD("Event sim list size=" << m_eventSimList.size());
} else if (watchType == WATCH_TYPE_DEVICE_ORIENTATION) {
m_eventDeviceOrientationList.push_back(arg);
- LogDebug("Event device orientation list size=" << m_eventDeviceOrientationList.size());
+ LoggerD("Event device orientation list size=" << m_eventDeviceOrientationList.size());
} else if (watchType == WATCH_TYPE_NETWORK) {
m_eventNetworkList.push_back(arg);
- LogDebug("Event network list size=" << m_eventNetworkList.size());
+ LoggerD("Event network list size=" << m_eventNetworkList.size());
} else if (watchType == WATCH_TYPE_LOCALE) {
m_eventLocaleList.push_back(arg);
- LogDebug("Event Locale list size=" << m_eventLocaleList.size());
+ LoggerD("Event Locale list size=" << m_eventLocaleList.size());
} else if (watchType == WATCH_TYPE_PERIPHERAL) {
m_eventPeripheralList.push_back(arg);
- LogDebug("Event peripheral list size=" << m_eventPeripheralList.size());
+ LoggerD("Event peripheral list size=" << m_eventPeripheralList.size());
}
}
void Systeminfo::EventMgr::removeEvent(WatchId id, const int watchType)
{
DPL::Mutex::ScopedLock lock(&m_synchro);
- LogDebug("Event id : " << id);
+ LoggerD("Event id : " << id);
EventWatchSysteminfoPtr event(NULL);
- LogDebug("trying to delete event, id=" << id);
+ LoggerD("trying to delete event, id=" << id);
if (watchType == WATCH_TYPE_BATTERY) {
for (EventBatteryList::iterator it = m_eventBatteryList.begin(); it != m_eventBatteryList.end(); it++) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event Battery list size=" << m_eventBatteryList.size());
+ LoggerD("event Battery list size=" << m_eventBatteryList.size());
m_eventBatteryList.remove(event);
- LogDebug( "event removed, event Battery list size=" << m_eventBatteryList.size());
+ LoggerD( "event removed, event Battery list size=" << m_eventBatteryList.size());
} else if (watchType == WATCH_TYPE_DISPLAY) {
for (EventDisplayList::iterator it = m_eventDisplayList.begin(); it != m_eventDisplayList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event display list size=" << m_eventDisplayList.size());
+ LoggerD("event display list size=" << m_eventDisplayList.size());
m_eventDisplayList.remove(event);
- LogDebug( "event removed, event display list size=" << m_eventDisplayList.size());
+ LoggerD( "event removed, event display list size=" << m_eventDisplayList.size());
} else if (watchType == WATCH_TYPE_WIFINETWORK) {
for (EventWifiNetworkList::iterator it = m_eventWifiNetworkList.begin(); it != m_eventWifiNetworkList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event wifi network list size=" << m_eventWifiNetworkList.size());
+ LoggerD("event wifi network list size=" << m_eventWifiNetworkList.size());
m_eventWifiNetworkList.remove(event);
- LogDebug( "event removed, event wifi network list size=" << m_eventCelluarNetworkList.size());
+ LoggerD( "event removed, event wifi network list size=" << m_eventCelluarNetworkList.size());
} else if (watchType == WATCH_TYPE_CELLULARNETWORK) {
for (EventCellularNetworkList::iterator it = m_eventCelluarNetworkList.begin(); it != m_eventCelluarNetworkList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event cellular network list size=" << m_eventCelluarNetworkList.size());
+ LoggerD("event cellular network list size=" << m_eventCelluarNetworkList.size());
m_eventCelluarNetworkList.remove(event);
- LogDebug( "event removed, event cellular network list size=" << m_eventCelluarNetworkList.size());
+ LoggerD( "event removed, event cellular network list size=" << m_eventCelluarNetworkList.size());
} else if (watchType == WATCH_TYPE_STORAGE) {
for (EventStorageList::iterator it = m_eventStorageList.begin(); it != m_eventStorageList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event storage list size=" << m_eventStorageList.size());
+ LoggerD("event storage list size=" << m_eventStorageList.size());
m_eventStorageList.remove(event);
- LogDebug( "event removed, event storage list size=" << m_eventStorageList.size());
+ LoggerD( "event removed, event storage list size=" << m_eventStorageList.size());
} else if (watchType == WATCH_TYPE_CPU) {
for (EventCpuList::iterator it = m_eventCpuList.begin(); it != m_eventCpuList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event cpu list size=" << m_eventCpuList.size());
+ LoggerD("event cpu list size=" << m_eventCpuList.size());
m_eventCpuList.remove(event);
- LogDebug( "event removed, event cpu list size=" << m_eventCpuList.size());
+ LoggerD( "event removed, event cpu list size=" << m_eventCpuList.size());
} else if (watchType == WATCH_TYPE_SIM) {
for (EventSimList::iterator it = m_eventSimList.begin(); it != m_eventSimList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event sim list size=" << m_eventSimList.size());
+ LoggerD("event sim list size=" << m_eventSimList.size());
m_eventSimList.remove(event);
- LogDebug( "event removed, event sim list size=" << m_eventSimList.size());
+ LoggerD( "event removed, event sim list size=" << m_eventSimList.size());
} else if (watchType == WATCH_TYPE_DEVICE_ORIENTATION) {
for (EventDeviceOrientationList::iterator it = m_eventDeviceOrientationList.begin(); it != m_eventDeviceOrientationList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event device orientation list size=" << m_eventDeviceOrientationList.size());
+ LoggerD("event device orientation list size=" << m_eventDeviceOrientationList.size());
m_eventDeviceOrientationList.remove(event);
- LogDebug( "event removed, event device orientation list size=" << m_eventDeviceOrientationList.size());
+ LoggerD( "event removed, event device orientation list size=" << m_eventDeviceOrientationList.size());
} else if (watchType == WATCH_TYPE_NETWORK) {
for (EventNetworkList::iterator it = m_eventNetworkList.begin(); it != m_eventNetworkList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event network list size=" << m_eventNetworkList.size());
+ LoggerD("event network list size=" << m_eventNetworkList.size());
m_eventNetworkList.remove(event);
- LogDebug( "event removed, event network list size=" << m_eventNetworkList.size());
+ LoggerD( "event removed, event network list size=" << m_eventNetworkList.size());
} else if (watchType == WATCH_TYPE_LOCALE) {
for (EventLocaleList::iterator it = m_eventLocaleList.begin(); it != m_eventLocaleList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event Locale list size=" << m_eventLocaleList.size());
+ LoggerD("event Locale list size=" << m_eventLocaleList.size());
m_eventLocaleList.remove(event);
- LogDebug( "event removed, event Locale list size=" << m_eventLocaleList.size());
+ LoggerD( "event removed, event Locale list size=" << m_eventLocaleList.size());
} else if (watchType == WATCH_TYPE_PERIPHERAL) {
for (EventPeripheralList::iterator it = m_eventPeripheralList.begin(); it != m_eventPeripheralList.end(); it++) {
if (id == (*it)->getId()) {
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return;
}
- LogDebug("event peripheral list size=" << m_eventPeripheralList.size());
+ LoggerD("event peripheral list size=" << m_eventPeripheralList.size());
m_eventPeripheralList.remove(event);
- LogDebug( "event removed, event peripheral list size=" << m_eventPeripheralList.size());
+ LoggerD( "event removed, event peripheral list size=" << m_eventPeripheralList.size());
}
}
}
if (!event) {
- LogError("event id not in the list, nothing to do");
+ LoggerE("event id not in the list, nothing to do");
return WATCH_TYPE_UNKNOWN;
}
CpuPropertiesPtr cpuPtr(new CpuProperties());
FILE *fp = NULL;
- unsigned long long usr = 0, nice = 0, system = 0, idle = 0, total = 0, cpuUsage = 0;
+ long long usr = 0, nice = 0, system = 0, idle = 0, total = 0, cpuUsage = 0;
fp = fopen("/proc/stat", "r");
if(fp == NULL) {
if (fscanf(fp, "%*s %lld %lld %lld %lld", &usr, &system, &nice, &idle) > 0) {
total = usr + nice + system + idle;
- if ((total > 0ULL) && (idle > 0ULL)) {
- cpuUsage = idle * 100ULL / total;
+ if ((total > 0LL) && (idle > 0LL)) {
+ cpuUsage = idle * 100LL / total;
cpuPtr->load = (double)cpuUsage / 100.0;
- LogDebug("cpu load : " << cpuPtr->load);
+ LoggerD("cpu load : " << cpuPtr->load);
}
}
if(vconf_get_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, &brightness) == 0) {
display->brightness = (double)(brightness)/DISPLAY_BRIGHTNESS_DIVIDE_VALUE;
- LogDebug("brightness : " << display->brightness);
+ LoggerD("brightness : " << display->brightness);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_WIDTH, &resolutionW) == SYSTEM_INFO_ERROR_NONE) {
display->resolutionWidth = resolutionW;
- LogDebug("resolutionWidth : " << display->resolutionWidth);
+ LoggerD("resolutionWidth : " << display->resolutionWidth);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_HEIGHT, &resolutionH) == SYSTEM_INFO_ERROR_NONE) {
display->resolutionHeight = resolutionH;
- LogDebug("resolutionHeight : " << display->resolutionHeight);
+ LoggerD("resolutionHeight : " << display->resolutionHeight);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_DPI, &dotsPerInchX) == SYSTEM_INFO_ERROR_NONE) {
display->dotsPerInchWidth = dotsPerInchX;
- LogDebug("dotsPerInchWidth : " << display->dotsPerInchWidth);
+ LoggerD("dotsPerInchWidth : " << display->dotsPerInchWidth);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_SCREEN_DPI, &dotsPerInchY) == SYSTEM_INFO_ERROR_NONE) {
display->dotsPerInchHeight = dotsPerInchY;
- LogDebug("dotsPerInchHeight : " << display->dotsPerInchHeight);
+ LoggerD("dotsPerInchHeight : " << display->dotsPerInchHeight);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_HEIGHT, &physicalH) == SYSTEM_INFO_ERROR_NONE) {
display->physicalHeight = physicalH;
- LogDebug("physicalHeight : " << display->physicalHeight);
+ LoggerD("physicalHeight : " << display->physicalHeight);
}
if (system_info_get_value_int(SYSTEM_INFO_KEY_PHYSICAL_SCREEN_WIDTH, &physicalW) == SYSTEM_INFO_ERROR_NONE) {
display->physicalWidth = physicalW;
- LogDebug("physicalWidth : " << display->physicalWidth);
+ LoggerD("physicalWidth : " << display->physicalWidth);
}
return JSDisplayInfo::createJSObject(context, display);
}
PROPERTY_GET_SYSTEMINFO_DEFINITION(Network) {
- LogDebug("enter");
+ LoggerD("enter");
Converter converter(context);
NetworkPropertiesPtr Network(new NetworkProperties());
connection_h connectionHandle = (connection_h)handle;
int networkType = 0;
if (connection_get_type(connectionHandle, &connectionType) != CONNECTION_ERROR_NONE) {
- LogDebug("get connection type is failed");
+ LoggerD("get connection type is failed");
return JSNetworkInfo::createJSObject(context, Network);
}
if (connectionType == CONNECTION_TYPE_WIFI) {
- LogDebug("wifi network");
+ LoggerD("wifi network");
Network->networkType= "WIFI";
} else if (connectionType == CONNECTION_TYPE_CELLULAR) {
if (vconf_get_int(VCONFKEY_TELEPHONY_SVCTYPE, &networkType) == 0) {
TIME_TRACER_ITEM_BEGIN("(cellular)imei", 0);
if (system_info_get_value_string(SYSTEM_INFO_KEY_MOBILE_DEVICE_ID, &imei) == SYSTEM_INFO_ERROR_NONE) {
if (imei) {
- LogDebug("imei : " << imei);
+ LoggerD("imei : " << imei);
cellularNetwork->imei = imei;
free(imei);
}
}
PROPERTY_GET_SYSTEMINFO_DEFINITION(DeviceOrientation) {
- LogDebug("enter");
+ LoggerD("enter");
Converter converter(context);
DeviceOrientationPropertiesPtr deviceOrientation(new DeviceOrientationProperties());
int handleOrientaion = 0;
handleOrientaion = sf_connect(ACCELEROMETER_SENSOR);
- LogDebug("handleOrientaion : " << handleOrientaion);
+ LoggerD("handleOrientaion : " << handleOrientaion);
if (handleOrientaion < 0) {
- LogDebug ("sensor attach fail");
+ LoggerD ("sensor attach fail");
return JSDeviceOrientationInfo::createJSObject(context, deviceOrientation);
}
int state = sf_start(handleOrientaion, 0);
if(state < 0) {
- LogDebug("start failed");
+ LoggerD("start failed");
}
int ret_val = sf_check_rotation(&rotation);
if (ret_val < 0) {
- LogDebug("sf_check_rotation fail to gather data\n");
+ LoggerD("sf_check_rotation fail to gather data\n");
}
- LogDebug(" rotation value = " << rotation);
+ LoggerD(" rotation value = " << rotation);
switch (rotation) {
case 0:
case ROTATION_EVENT_0:
- LogDebug("my_callback_func received data (PORTRAIT_TOP|HEAD_CENTER)\n");
+ LoggerD("my_callback_func received data (PORTRAIT_TOP|HEAD_CENTER)\n");
deviceOrientation->status = "PORTRAIT_PRIMARY";
break;
case ROTATION_EVENT_90:
- LogDebug("my_callback_func received data (LANDSCAPE|HEAD_RIGHT)\n");
+ LoggerD("my_callback_func received data (LANDSCAPE|HEAD_RIGHT)\n");
deviceOrientation->status = "LANDSCAPE_PRIMARY";
break;
case ROTATION_EVENT_180:
- LogDebug("my_callback_func received data (PORTRAIT_BTM|HEAD_CENTER)\n");
+ LoggerD("my_callback_func received data (PORTRAIT_BTM|HEAD_CENTER)\n");
deviceOrientation->status = "PORTRAIT_SECONDARY";
break;
case ROTATION_EVENT_270:
- LogDebug("my_callback_func received data (LANDSCAPE|HEAD_LEFT)\n");
+ LoggerD("my_callback_func received data (LANDSCAPE|HEAD_LEFT)\n");
deviceOrientation->status = "LANDSCAPE_SECONDARY";
break;
default:
- LogDebug(" received data unexpected\n");
+ LoggerD(" received data unexpected\n");
break;
}
state = sf_stop(handleOrientaion);
- LogDebug("handleOrientaion 1 state = " << state);
+ LoggerD("handleOrientaion 1 state = " << state);
state = sf_disconnect(handleOrientaion);
- LogDebug("handleOrientaion state =" << state);
+ LoggerD("handleOrientaion state =" << state);
return JSDeviceOrientationInfo::createJSObject(context, deviceOrientation);
}
PROPERTY_GET_SYSTEMINFO_DEFINITION(Build) {
- LogDebug("enter");
+ LoggerD("enter");
Converter converter(context);
BuildPropertiesPtr Build(new BuildProperties());
if (system_info_get_value_string(SYSTEM_INFO_KEY_MODEL, &model) == SYSTEM_INFO_ERROR_NONE) {
if (model != NULL) {
- LogDebug("model : " << model);
+ LoggerD("model : " << model);
Build->model = model;
free(model);
}
if (system_info_get_value_string(SYSTEM_INFO_KEY_MANUFACTURER, &manufacturer) == SYSTEM_INFO_ERROR_NONE) {
if (manufacturer != NULL) {
- LogDebug("manufacturer : " << manufacturer);
+ LoggerD("manufacturer : " << manufacturer);
Build->manufacturer = manufacturer;
free(manufacturer);
}
}
PROPERTY_GET_SYSTEMINFO_DEFINITION(Locale) {
- LogDebug("enter");
+ LoggerD("enter");
Converter converter(context);
LocalePropertiesPtr Locale(new LocaleProperties());
if (runtime_info_get_value_string(RUNTIME_INFO_KEY_LANGUAGE, &language) == RUNTIME_INFO_ERROR_NONE) {
if (language != NULL) {
- LogDebug("language : " << language);
+ LoggerD("language : " << language);
Locale->language = language;
free(language);
}
}
if (runtime_info_get_value_string(RUNTIME_INFO_KEY_REGION, &country) == RUNTIME_INFO_ERROR_NONE) {
- LogDebug("country : " << country);
+ LoggerD("country : " << country);
char* token = NULL;
char* countryTemp = NULL;
token = strtok(country, ".");
peripheral->isVideoOutputOn = true;
break;
default:
- LogDebug("VideOutput status is off");
+ LoggerD("VideOutput status is off");
break;
}
}
peripheral->isVideoOutputOn = true;
break;
default:
- LogDebug("VideOutput status is off");
+ LoggerD("VideOutput status is off");
break;
}
}
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include "SysteminfoListener.h"
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include "SysteminfoAsyncCallbackManager.h"
#include <TimeTracer.h>
+#include <Logger.h>
using namespace std;
void SysteminfoListener::OnAnswerReceived(const EventGetSysteminfoPtr& event)
{
- LogDebug("Enter");
+ LoggerD("Enter");
WrtDeviceApis::CommonsJavaScript::JSCallbackManagerPtr callbackManager = DPL::StaticPointerCast<WrtDeviceApis::CommonsJavaScript::JSCallbackManager >(event->getPrivateData());
- LogDebug("thread=" << DPL::Thread::GetCurrentThread());
+ LoggerD("thread=" << DPL::Thread::GetCurrentThread());
SysteminfoAsyncCallbackManagerSingleton::Instance().unregisterCallbackManager(callbackManager);
#include <map>
#include <JavaScriptCore/JavaScript.h>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <dpl/singleton.h>
#include <IListenerManager.h>
#include "JSSysteminfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
JSSysteminfoPriv *priv = static_cast<JSSysteminfoPriv*>(JSObjectGetPrivate(m_object));
if (!priv) {
- LogWarning("Object has no private object");
+ LoggerW("Object has no private object");
return;
}
ISysteminfoPtr Systeminfos(priv->getObject());
Systeminfos->clearWatch(m_watchId);
} Catch(WrtDeviceApis::Commons::Exception) {
- LogError("Error on platform : " << _rethrown_exception.GetMessage());
+ LoggerE("Error on platform : " << _rethrown_exception.GetMessage());
}
}
};
bool nfc;
bool nfcReservedPush;
unsigned short multiTouchCount;
- std::string inputKeyboard;
+ bool inputKeyboard;
bool inputKeyboardLayout;
bool wifi;
bool wifiDirect;
nfc(false),
nfcReservedPush(false),
multiTouchCount(0),
- inputKeyboard(""),
+ inputKeyboard(false),
inputKeyboardLayout(false),
wifi(false),
wifiDirect(false),
struct SIMProperties
{
+ std::string state;
std::string operatorName;
std::string msisdn;
std::string iccid;
std::string spn;
SIMProperties() :
+ state(""),
operatorName(""),
msisdn(""),
iccid(""),
// limitations under the License.
//
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <TimeTracer.h>
-
#include "SysteminfoAsyncCallbackManager.h"
#include "SysteminfoListenerManager.h"
#include "JSSysteminfo.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Systeminfo {
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\Systeminfo ] on_widget_start_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Systeminfo ] on_widget_start_callback (" << widgetId << ")");
TIME_TRACER_INIT();
Try
{
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\Systeminfo ] on_widget_stop_callback (" << widgetId << ")");
+ LoggerD("[Tizen\\Systeminfo ] on_widget_stop_callback (" << widgetId << ")");
TIME_TRACER_EXPORT_REPORT_TO(TIME_TRACER_EXPORT_FILE,"SystemInfo");
TIME_TRACER_RELEASE();
Try
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
void on_frame_load_callback(const void * context)
{
- LogDebug("[Tizen\\systeminfo] on_frame_load_callback (" << context << ")");
+ LoggerD("[Tizen\\systeminfo] on_frame_load_callback (" << context << ")");
}
void on_frame_unload_callback(const void * context)
{
- LogDebug("[Tizen\\systeminfo] on_frame_unload_callback (" << context << ")");
+ LoggerD("[Tizen\\systeminfo] on_frame_unload_callback (" << context << ")");
DeviceAPI::Systeminfo::SysteminfoAsyncCallbackManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
DeviceAPI::Systeminfo::SysteminfoListenerManagerSingleton::Instance().unregisterContext(static_cast<JSContextRef>(context));
// limitations under the License.
//
-
-
-
#include <ctime>
#include <string>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/JSUtils.h>
#include <JSWebAPIException.h>
#include "DurationProperties.h"
-
#include "JSTZDate.h"
#include "TimeUtilConverter.h"
+#include <Logger.h>
using namespace DeviceAPI::Common;
using namespace WrtDeviceApis::Commons;
JSClassRef JSTZDate::m_jsClassRef = JSClassCreate(JSTZDate::getClassInfo());
JSObjectRef JSTZDate::createJSObject(JSContextRef context) {
- LogDebug("entered");
+ LoggerD("entered");
TZDatePtr tzDate(new TZDate());
TZDatePrivObject *priv = new TZDatePrivObject(context, tzDate);
if (!priv) {
}
JSObjectRef JSTZDate::createJSObject(JSContextRef context, const std::string &timezone) {
- LogDebug("entered");
+ LoggerD("entered");
if (timezone == "")
return createJSObject(context);
}
JSObjectRef JSTZDate::createJSObject(JSContextRef context, const double milliseconds, const std::string &timezone) {
- LogDebug("entered");
+ LoggerD("entered");
TZDatePtr tzDate;
if (timezone == "")
tzDate = TZDatePtr(new TZDate());
}
JSObjectRef JSTZDate::createJSObject(JSContextRef context, const TZDateProperties &properties) {
- LogDebug("entered");
+ LoggerD("entered");
TZDatePtr tzDate(new TZDate(properties));
TZDatePrivObject *priv = new TZDatePrivObject(context, tzDate);
}
JSObjectRef JSTZDate::createJSObject(JSContextRef context, const long year, const long month, const long day, const long hours, const long minutes, const long seconds, const long milliseconds, const std::string &timezone) {
- LogDebug("entered");
+ LoggerD("entered");
TZDateProperties props;
props.year = year;
void JSTZDate::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered Nothing to do.");
+ LoggerD("entered Nothing to do.");
}
void JSTZDate::finalize(JSObjectRef object)
{
- LogDebug( "entered" );
+ LoggerD( "entered" );
TZDatePrivObject *priv =
static_cast<TZDatePrivObject*>( JSObjectGetPrivate( object ) ) ;
delete priv;
JSObjectRef JSTZDate::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
TZDateProperties prop;
TimeUtilConverter converter(ctx);
tzDate = createJSObject(ctx, timezone);
} else {
struct tm date = converter.toDateTm(arguments[0]);
- LogDebug("date = " << date.tm_year << "." << date.tm_mon << "." << date.tm_mday);
- LogDebug(date.tm_hour << ":" << date.tm_min << ":" << date.tm_sec);
- LogDebug("isdst?" << date.tm_isdst);
+ LoggerD("date = " << date.tm_year << "." << date.tm_mon << "." << date.tm_mday);
+ LoggerD(date.tm_hour << ":" << date.tm_min << ":" << date.tm_sec);
+ LoggerD("isdst?" << date.tm_isdst);
prop.timezone = timezone;
prop.year = date.tm_year + 1900;
JSObjectRef function = JSValueToObject(ctx, getMiliSecFuction, exception);
JSValueRef result = JSObjectCallAsFunction(ctx, function, converter.toJSObjectRef(arguments[0]), 0, NULL, exception);
prop.milliseconds = converter.toLong(result);
- LogDebug("getMilliseconds = " << prop.milliseconds);
+ LoggerD("getMilliseconds = " << prop.milliseconds);
}
tzDate = createJSObject(ctx, prop);
}
return tzDate;
}
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
*exception = error;
return error;
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
*exception = error;
return error;
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 JSTZDate::getTimezone(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return converter.toJSValueRef(timezone);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toTimezone(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
try {
ArgumentValidator validator(context, argumentCount, arguments);
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::diffTZDate(JSContextRef context, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception, CompareType type) {
- LogDebug("entered");
+ LoggerD("entered");
ArgumentValidator validator(context, argumentCount, arguments);
if (!validator.toObject(0, JSTZDate::getClassRef(), false))
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
TimeUtilConverter converter(context);
JSValueRef JSTZDate::difference(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
return diffTZDate(context, thisObject, argumentCount, arguments, exception, DIFFERENCE);
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} Catch(InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::equalsTo(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
return diffTZDate(context, thisObject, argumentCount, arguments, exception, EQUALSTO);
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::earlierThan(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("earlierThan entered");
+ LoggerD("earlierThan entered");
Try {
return diffTZDate(context, thisObject, argumentCount, arguments, exception, EARLIERTHAN);
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::laterThan(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("laterThan entered");
+ LoggerD("laterThan entered");
Try {
return diffTZDate(context, thisObject, argumentCount, arguments, exception, LATERTHAN);
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::addDuration(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("addDuration entered");
+ LoggerD("addDuration entered");
Try {
TimeUtilConverter converter(context);
else
duration= converter.getDurationPropertis(arguments[0]);
- LogDebug("unit : " << duration.unit << " Length:" << duration.length);
+ LoggerD("unit : " << duration.unit << " Length:" << duration.length);
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return (static_cast<JSValueRef>(createJSObject(context, result)));
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (OutOfRangeException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "The result is beyond the scope that TZDate can handle.");
}
JSValueRef JSTZDate::toUTC(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("toUTC entered");
+ LoggerD("toUTC entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
TZDatePtr tzDate(privateObject->getObject());
return createJSObject(context, tzDate->getTime(), tzDate->getUTCTimezoneName());
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::toLocalTimezone(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("toLocalTimezone entered");
+ LoggerD("toLocalTimezone entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
TZDatePtr tzDate(privateObject->getObject());
return createJSObject(context, tzDate->getTime(), tzDate->getLocalTimezoneName());
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::toLocaleDateString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toDateString(true);
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toLocaleTimeString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toTimeString(true);
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toLocaleString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toString(true);
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toDateString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toDateString();
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toTimeString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toTimeString();
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::toString(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
std::string result = tzDate->toString();
return converter.toJSValueRef(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::getDate(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_DATE;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getDay(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_DAY_OF_WEEK;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getFullYear(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_YEAR;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getHours(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_HOUR_OF_DAY;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getMilliseconds(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MILLISECOND;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getMinutes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MINUTE;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
JSValueRef JSTZDate::getMonth(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MONTH;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
} //getMonth()
JSValueRef JSTZDate::getSeconds(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_SECOND;
return getTZDateValue(context, thisObject, argumentCount, arguments, exception, dateFields);
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*> (JSObjectGetPrivate(thisObject));
if (privateObject == NULL) {
- LogError(">>> NULL Exception");
+ LoggerE(">>> NULL Exception");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
long retVal = tzDate->get(dateFields);
TimeUtilConverter converter(context);
- LogDebug(">>> retVal:" << retVal);
+ LoggerD(">>> retVal:" << retVal);
return converter.toJSValueRef(static_cast<int> (retVal));
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::setDate(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_DATE;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setFullYear(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_YEAR;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setHours(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_HOUR_OF_DAY;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
}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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setMilliseconds(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MILLISECOND;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
}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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setMinutes(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MINUTE;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
}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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setMonth(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_MONTH;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
}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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::setSeconds(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
JSValueRef * exception) {
- LogDebug("<<<");
+ LoggerD("<<<");
TZDate::TZDateFields dateFields = TZDate::TZDATE_SECOND;
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
}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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*> (JSObjectGetPrivate(thisObject));
if (privateObject == NULL) {
- LogError(">>> NULL Exception");
+ LoggerE(">>> NULL Exception");
ThrowMsg(NullPointerException, "privateObject is NULL");
}
JSValueRef JSTZDate::getUTCDate(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_DATE, exception);
}
JSValueRef JSTZDate::getUTCDay(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_DAY_OF_WEEK, exception);
}
JSValueRef JSTZDate::getUTCFullYear(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_YEAR, exception);
}
JSValueRef JSTZDate::getUTCHours(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_HOUR_OF_DAY, exception);
}
JSValueRef JSTZDate::getUTCMilliseconds(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_MILLISECOND, exception);
}
JSValueRef JSTZDate::getUTCMinutes(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_MINUTE, exception);
}
JSValueRef JSTZDate::getUTCMonth(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_MONTH, exception);
}
JSValueRef JSTZDate::getUTCSeconds(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return getUTCTZDateValue(context, thisObject, argumentCount, TZDate::TZDATE_SECOND, exception);
}
JSValueRef JSTZDate::getUTCTZDateValue(JSContextRef context, JSObjectRef thisObject, size_t argumentCount, TZDate::TZDateFields DateFields, JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return converter.toJSValueRefLong(result);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
JSValueRef JSTZDate::setUTCDate(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_DATE, exception);
}
JSValueRef JSTZDate::setUTCFullYear(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_YEAR, exception);
}
JSValueRef JSTZDate::setUTCHours(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_HOUR_OF_DAY, exception);
}
JSValueRef JSTZDate::setUTCMilliseconds(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_MILLISECOND, exception);
}
JSValueRef JSTZDate::setUTCMinutes(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_MINUTE, exception);
}
JSValueRef JSTZDate::setUTCMonth(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_MONTH, exception);
}
JSValueRef JSTZDate::setUTCSeconds(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
return setUTCTZDateValue(context, thisObject, argumentCount, arguments, TZDate::TZDATE_SECOND, exception);
}
JSValueRef JSTZDate::setUTCTZDateValue(JSContextRef context, JSObjectRef thisObject,
size_t argumentCount, const JSValueRef arguments[], TZDate::TZDateFields dateFields, JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
TimeUtilConverter converter(context);
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return JSValueMakeNull(context);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::getTimezoneAbbreviation(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return converter.toJSValueRef(tzDate->getTimezoneAbbreviation());
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::secondsFromUTC(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return converter.toJSValueRefLong(tzDate->secondsFromUTC());
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::isDST(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return converter.toJSValueRef(tzDate->isDST());
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::getPreviousDSTTransition(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return createJSObject(context, resultDate);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
JSValueRef JSTZDate::getNextDSTTransition(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("entered");
+ LoggerD("entered");
Try {
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return createJSObject(context, resultDate);
} 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::UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
// limitations under the License.
//
-
#include <string>
#include <memory>
-#include <dpl/log/log.h>
#include <cmath>
#include <Commons/Exception.h>
#include <CommonsJavaScript/Utils.h>
#include <CommonsJavaScript/JSCallbackManager.h>
#include <JSTizenExceptionFactory.h>
#include <JSTizenException.h>
-
#include "JSTimeDuration.h"
#include "TimeUtilConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Time {
void JSTimeDuration::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered Nothing to do.");
+ LoggerD("entered Nothing to do.");
}
void JSTimeDuration::finalize(JSObjectRef object)
{
TimeDurationPrivObject* priv = static_cast<TimeDurationPrivObject*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting TimeDuration");
+ LoggerD("Deleting TimeDuration");
delete priv;
}
JSValueRef JSTimeDuration::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
TimeUtilConverter convert(context);
- LogDebug("propertyName : " << convert.toString(propertyName));
+ LoggerD("propertyName : " << convert.toString(propertyName));
if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_TIMEDURATION_LENGTH)) {
return convert.toJSValueRef(static_cast<double>(convert.getDurationLength(object)));
} else if (JSStringIsEqualToUTF8CString(propertyName, TIZEN_TIMEDURATION_UNIT)) {
return convert.toJSValueRef(strUnit);
}
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
}
return JSValueMakeUndefined(context);
}
bool JSTimeDuration::setProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
{
- LogDebug("Enter");
+ LoggerD("Enter");
Try {
TimeDurationPrivObject* privateObject = static_cast<TimeDurationPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(NullPointerException, "Private object not initialized");
}
return true;
} Catch (NullPointerException) {
- LogError("NullPointerException: " << _rethrown_exception.GetMessage());
+ LoggerE("NullPointerException: " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (ConversionException) {
- LogError("ConversionException: " << _rethrown_exception.GetMessage());
+ LoggerE("ConversionException: " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("InvalidArgumentException: " << _rethrown_exception.GetMessage());
+ LoggerE("InvalidArgumentException: " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
*exception = JSTizenExceptionFactory::makeErrorObject(context, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
}
return false;
}
JSObjectRef JSTimeDuration::constructor(JSContextRef ctx, JSObjectRef constructor, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) {
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilConverter convert(ctx);
Try {
DurationProperties duration;
return timeDuration;
}
} Catch(NullPointerException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
*exception = error;
return error;
} Catch(UnknownException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
*exception = error;
return error;
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
*exception = error;
return error;
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
*exception = error;
return error;
} Catch (WrtDeviceApis::Commons::Exception) {
- LogWarning("Trying to get incorrect value");
+ LoggerW("Trying to get incorrect value");
}
JSObjectRef error = JSTizenExceptionFactory::makeErrorObject(ctx, JSTizenException::UNKNOWN_ERROR, "Unknown Error");
*exception = error;
}
JSValueRef JSTimeDuration::diffTimeDuration(JSContextRef context, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception, CompareType type) {
- LogDebug("entered");
+ LoggerD("entered");
TimeDurationPrivObject* privateObject = static_cast<TimeDurationPrivObject*>(JSObjectGetPrivate(thisObject));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
}
JSValueRef JSTimeDuration::difference(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
return diffTimeDuration(context, thisObject, argumentCount, arguments, exception, DIFFERENCE);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 JSTimeDuration::equalsTo(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
return diffTimeDuration(context, thisObject, argumentCount, arguments, exception, EQUALSTO);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 JSTimeDuration::lessThan(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
return diffTimeDuration(context, thisObject, argumentCount, arguments, exception, LESSTHAN);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 JSTimeDuration::greaterThan(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
Try {
return diffTimeDuration(context, thisObject, argumentCount, arguments, exception, GREATERTHAN);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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");
}
// limitations under the License.
//
-
#include <string>
#include <ctime>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/Utils.h>
#include "JSTimeUtil.h"
#include "JSTZDate.h"
#include "TimeUtilConverter.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Time {
TimeUtilPtr timeutil(new TimeUtil());
priv = new TimeUtilPrivObject( context, timeutil);
if(!JSObjectSetPrivate(object, static_cast<void*>(priv))) {
- LogError("Object can't store private data.");
+ LoggerE("Object can't store private data.");
delete priv;
}
}
- LogDebug("JSTimeUtil::initialize ");
+ LoggerD("JSTimeUtil::initialize ");
}
void JSTimeUtil::finalize(JSObjectRef object)
{
TimeUtilPrivObject* priv = static_cast<TimeUtilPrivObject*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
- LogDebug("Deleting timeutil");
+ LoggerD("Deleting timeutil");
delete priv;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("Entered ");
+ LoggerD("Entered ");
Try {
TimeUtilPrivObject* privateObject = static_cast<TimeUtilPrivObject*>(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 JSTZDate::createJSObject(context);
} Catch (PlatformException) {
- 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 (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 {
TimeUtilPrivObject* privateObject =
static_cast<TimeUtilPrivObject*>(JSObjectGetPrivate(
return converter.toJSValueRef(localTimezone);
} 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("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 {
TimeUtilPrivObject* privateObject =
static_cast<TimeUtilPrivObject*>(JSObjectGetPrivate(
return converter.toJSValueRef(timezonesArray);
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");;
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} 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("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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
{
TimeUtilConverter converter(context);
} catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");;
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} 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("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 {
TimeUtilPrivObject* privateObject =
static_cast<TimeUtilPrivObject*>(JSObjectGetPrivate(
return converter.toJSValueRef(timeFormat);
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} 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("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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 JSTimeUtil::isLeapYear(JSContextRef context, JSObjectRef function,
JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef * exception) {
- LogDebug("Entered");
+ LoggerD("Entered");
try{
TimeUtilConverter converter(context);
ArgumentValidator validator(context, argumentCount, arguments);
}catch(const BasePlatformException& err){
return JSWebAPIException::throwException(context, exception, err);
} Catch(ConversionException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR, "Type Mismatch");
} Catch (InvalidArgumentException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _rethrown_exception.GetMessage());
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::INVALID_VALUES_ERROR, "Invalid Values");
} Catch (UnsupportedException) {
- LogError("JSTimeUtil::hasInstance NotSupportedException");
+ LoggerE("JSTimeUtil::hasInstance NotSupportedException");
return JSTizenExceptionFactory::postException(context, exception, JSTizenException::NOT_SUPPORTED_ERROR , "Not Support");
} Catch (PlatformException) {
- LogError("Exception: " << _rethrown_exception.GetMessage());
+ LoggerE("Exception: " << _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");
}
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
-
#include <Commons/Exception.h>
-
#include <unicode/timezone.h>
#include <unicode/vtzone.h>
#include <unicode/smpdtfmt.h>
-
#include "TZDate.h"
#include "TimeUtilTools.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
TZDate::TZDate(const bool isNotNull)
{
- LogDebug("entered");
+ LoggerD("entered");
if (isNotNull == FALSE) {
myCalendar = NULL;
TZDate::TZDate(const std::string &timezone)
{
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
TimeUtilTools util;
TZDate::TZDate(const TZDateProperties &properties)
{
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilTools util;
myCalendar = _makeCalendar(properties);
TZDate::~TZDate()
{
- LogDebug("entered");
+ LoggerD("entered");
if (myCalendar != NULL)
delete myCalendar;
Calendar *TZDate::_makeCalendar(const TZDateProperties &properties)
{
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
TimeUtilTools util;
cal->getTimeZone().getID(id);
std::string s_result = util.toString(id);
- LogDebug(s_result);
+ LoggerD(s_result);
return s_result;
}
long TZDate::_get(const TZDateFields field, Calendar *cal)
{
- LogDebug("<<<");
+ LoggerD("<<<");
if (_convertDateField(field) == UCAL_FIELD_COUNT){
- LogDebug(">>> UCAL_FIELD_COUNT");
+ LoggerD(">>> UCAL_FIELD_COUNT");
return -1;
}
if (U_SUCCESS(ec)) {
long result = util.tolong(value);
- LogDebug(">>> result:" << result);
+ LoggerD(">>> result:" << result);
return result;
}
ThrowMsg(Commons::PlatformException, "Can't get Calendar value");
}
long TZDate::get(const TZDateFields field)
{
- LogDebug("<<<");
+ LoggerD("<<<");
long result = _get(field, myCalendar);
if (field == TZDATE_DAY_OF_WEEK)
TimeUtilTools util;
myCalendar->set(_convertDateField(field), util.toint32_t(value));
- LogDebug("Field : " << field << " value : " << get(field));
+ LoggerD("Field : " << field << " value : " << get(field));
}
long TZDate::getUTC(const TZDateFields field)
long result = util.tolong(value);
if (field == TZDATE_DAY_OF_WEEK)
result--;
- LogDebug("result : " << result);
+ LoggerD("result : " << result);
return result;
}
}
long long TZDate::difference(const TZDateProperties &prop) {
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilTools util;
UErrorCode ec = U_ZERO_ERROR;
if (U_SUCCESS(ec)) {
UDate otherTime = otherCalendar->getTime(ec);
if (U_SUCCESS(ec)) {
- LogDebug("myCalendar");
+ LoggerD("myCalendar");
util.printDate(myCalendar);
- LogDebug("otherCalendar");
+ LoggerD("otherCalendar");
util.printDate(otherCalendar);
delete otherCalendar;
- LogDebug("myTime : " <<myTime);
- LogDebug("otherTime : " << otherTime);
+ LoggerD("myTime : " <<myTime);
+ LoggerD("otherTime : " << otherTime);
return static_cast<long long>(myTime - otherTime);
}
}
TZDateProperties TZDate::addDuration(const DurationProperties &duration) {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
TimeUtilTools util;
unit = DAYS_UNIT;
}
day = length;
- LogDebug("day:"<<day<<" hour:"<<hour<<" min:"<<min<<" sec:"<<sec<<" msec:"<<msec);
+ LoggerD("day:"<<day<<" hour:"<<hour<<" min:"<<min<<" sec:"<<sec<<" msec:"<<msec);
try {
if (msec != 0) {
cal->add(UCAL_MILLISECOND, util.toint32_t(msec), ec);
Throw(Commons::PlatformException);
while (day != 0) {
- LogDebug("1st day : " << day);
+ LoggerD("1st day : " << day);
int amount = 0;
if (day < INT_MIN)
amount = day;
day -= amount;
- LogDebug("amount : " << amount);
- LogDebug("2nd day : " << day);
+ LoggerD("amount : " << amount);
+ LoggerD("2nd day : " << day);
cal->add(UCAL_DATE, util.toint32_t(amount), ec);
if (!U_SUCCESS(ec))
Throw(Commons::PlatformException);
Throw(Commons::PlatformException);
int diff = static_cast<int>((newValue - oldValue) / 24 / 60 / 60 / 1000);
- LogDebug("diff : " << diff);
+ LoggerD("diff : " << diff);
if (diff != amount) {
Throw(Commons::OutOfRangeException);
}
TimeZone::getGMT()->getID(id);
std::string s_result = util.toString(id);
- LogDebug(s_result);
+ LoggerD(s_result);
return s_result;
}
TimeZone::createDefault()->getID(id);
std::string s_result = util.toString(id);
- LogDebug(s_result);
+ LoggerD(s_result);
return s_result;
}
double TZDate::getTime() {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
UDate date = myCalendar->getTime(ec);
}
bool TZDate::setTime(const double time) {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
myCalendar->setTime(static_cast<UDate>(time), ec);
std::string result = util.toString(str);
str.remove();
- LogDebug (result);
+ LoggerD (result);
return result;
}
}
if (U_SUCCESS(ec)) {
std::string result = util.toString(str);
str.remove();
- LogDebug (result);
+ LoggerD (result);
return result;
}
}
}
std::string TZDate::toString(bool bLocale) {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
UnicodeString str;
if (U_SUCCESS(ec)) {
std::string result = util.toString(str);
str.remove();
- LogDebug (result);
+ LoggerD (result);
return result;
}
}
}
std::string TZDate::getTimezoneAbbreviation() {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
UnicodeString str;
std::string result = util.toString(str);
str.remove();
- LogDebug (result);
+ LoggerD (result);
return result;
}
}
long TZDate::secondsFromUTC() {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
TimeUtilTools util;
long result = -((util.tolong(zoneOffset + dstOffset)) / MILLISTOSEC);
- LogDebug("result : " << result);
+ LoggerD("result : " << result);
return result;
}
bool TZDate::isDST() {
- LogDebug("entered");
+ LoggerD("entered");
UErrorCode ec = U_ZERO_ERROR;
TimeUtilTools util;
UBool result = myCalendar->inDaylightTime(ec);
}
TZDateProperties TZDate::getDSTTransition(DSTTransition trans) {
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilTools util;
UErrorCode ec = U_ZERO_ERROR;
TZDateProperties props;
else
result = vtz->getPreviousTransition(dstTransitionDate, FALSE, tzTrans);
if (result == TRUE) {
- LogDebug("result is TRUE");
+ LoggerD("result is TRUE");
dstTransitionDate = tzTrans.getTime();
}
}
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
#include <ctime>
#include <vconf.h>
-
#include <Commons/Exception.h>
-
#include <unicode/ustring.h>
#include <unicode/timezone.h>
#include <unicode/calendar.h>
#include <unicode/strenum.h>
#include <unicode/datefmt.h>
-
#include "TZDateProperties.h"
#include "TimeUtil.h"
#include "TimeUtilTools.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
namespace {
static void changedTimezoneCallback(keynode_t* node, void* user_data) {
- LogDebug("entered KeyName:" << vconf_keynode_get_name(node));
+ LoggerD("entered KeyName:" << vconf_keynode_get_name(node));
if (!strcmp(vconf_keynode_get_name(node), VCONFKEY_SETAPPL_TIMEZONE_ID) && (vconf_keynode_get_type(node) == VCONF_TYPE_STRING)) {
char *timezoneID = vconf_keynode_get_str(node);
if (timezoneID != NULL) {
- LogDebug("Changed Timezone : " << timezoneID);
+ LoggerD("Changed Timezone : " << timezoneID);
TimeUtilTools util;
UnicodeString *id = util.toUnicodeString(timezoneID);
TimeZone *tz = TimeZone::createTimeZone(*id);
TimeUtil::TimeUtil()
{
- LogDebug("entered");
+ LoggerD("entered");
bRegisteredChangedTimezone = false;
if (vconf_notify_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, changedTimezoneCallback, NULL) == 0) {
- LogDebug("Success to register changedTimezoneCallback");
+ LoggerD("Success to register changedTimezoneCallback");
bRegisteredChangedTimezone = true;
}
}
TimeUtil::~TimeUtil()
{
- LogDebug("entered");
+ LoggerD("entered");
if (bRegisteredChangedTimezone) {
vconf_ignore_key_changed(VCONFKEY_SETAPPL_TIMEZONE_ID, changedTimezoneCallback);
}
}
std::string TimeUtil::getLocalTimezone() {
- LogDebug("entered");
+ LoggerD("entered");
UnicodeString idResult;
TimeZone* zone = TimeZone::createDefault();
try {
TimeUtilTools util;
std::string s_result = util.toString(id);
- LogDebug("result : " << s_result);
+ LoggerD("result : " << s_result);
return s_result;
} catch (Commons::PlatformException) {
- LogError("can't get the local timezone's name");
+ LoggerE("can't get the local timezone's name");
}
ThrowMsg(Commons::PlatformException, "Can't get Local Timezone");
std::string TimeUtil::getUTCTimezone() {
- LogDebug("entered");
+ LoggerD("entered");
UnicodeString id;
const TimeZone *utcTimezone = TimeZone::getGMT();
TimeUtilTools util;
std::string s_result = util.toString(id);
- LogDebug("result : " << s_result);
+ LoggerD("result : " << s_result);
return s_result;
} catch(Commons::PlatformException) {
- LogError("can't get the UTC timezone's name");
+ LoggerE("can't get the UTC timezone's name");
}
ThrowMsg(Commons::PlatformException, "Can't get UTC Timezone");
int32_t count = tzen->count(ec);
std::vector<std::string> timezones;
- LogDebug("count: " << count);
+ LoggerD("count: " << count);
if (U_SUCCESS(ec)) {
int i = 0;
}
std::string TimeUtil::getDateFormat(const bool b_shortFormat) {
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilTools util;
UnicodeString timeFormat = util.getDateTimeFormat((b_shortFormat ? TimeUtilTools::DATE_SHORT_FORMAT : TimeUtilTools::DATE_FORMAT), true);
timeFormat = timeFormat.findAndReplace("E", "D");
else
i++;
}
- LogDebug("result : " << util.toString(timeFormat));
+ LoggerD("result : " << util.toString(timeFormat));
return util.toString(timeFormat);
}
std::string TimeUtil::getTimeFormat(){
- LogDebug("entered");
+ LoggerD("entered");
TimeUtilTools util;
UnicodeString timeFormat = util.getDateTimeFormat(TimeUtilTools::TIME_FORMAT, true);
timeFormat = timeFormat.findAndReplace("H", "h");
else
i++;
}
- LogDebug("result : " << util.toString(timeFormat));
+ LoggerD("result : " << util.toString(timeFormat));
return util.toString(timeFormat);
}
// limitations under the License.
//
-
-
-
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <CommonsJavaScript/PrivateObject.h>
#include "TimeUtilConverter.h"
#include "JSTZDate.h"
#include "JSTimeDuration.h"
+#include <Logger.h>
using namespace WrtDeviceApis;
TZDateProperties TimeUtilConverter::getPropertiesInTZDate(JSObjectRef arg) {
- LogDebug("TZDate object=" << arg);
+ LoggerD("TZDate object=" << arg);
if (!arg) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(arg));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
long long TimeUtilConverter::getDurationLength(JSObjectRef object) {
TimeDurationPrivObject* privateObject = static_cast<TimeDurationPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
short TimeUtilConverter::getDurationUnit(JSObjectRef object) {
TimeDurationPrivObject* privateObject = static_cast<TimeDurationPrivObject*>(JSObjectGetPrivate(object));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
double TimeUtilConverter::getTimeInMilliseconds(JSObjectRef arg) {
if (!arg) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(arg));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
tm TimeUtilConverter::toTZDateTime(JSObjectRef arg) {
if (!arg) {
- LogError("Object is null");
+ LoggerE("Object is null");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
TZDatePrivObject* privateObject = static_cast<TZDatePrivObject*>(JSObjectGetPrivate(arg));
if (!privateObject) {
- LogError("Private object is not set.");
+ LoggerE("Private object is not set.");
ThrowMsg(Commons::ConversionException, "Private object not initialized");
}
// limitations under the License.
//
-
-
-
#include <unicode/ustring.h>
#include <unicode/udat.h>
#include <unicode/dtptngen.h>
-
#include <string.h>
#include <vconf.h>
-
#include <Commons/Exception.h>
-
#include "TimeUtilTools.h"
-#include <dpl/log/log.h>
+#include <Logger.h>
namespace DeviceAPI {
namespace Time {
std::string str(resultBuffer);
free(resultBuffer);
- LogDebug(str);
+ LoggerD(str);
return str;
}
TimeZone *TimeUtilTools::makeTimeZone(const std::string &name)
{
- LogDebug("entered timezone name : " << name);
+ LoggerD("entered timezone name : " << name);
UnicodeString *id = toUnicodeString(name);
DateTimePatternGenerator *dateTimepatten = DateTimePatternGenerator::createInstance((bLocale ? Locale::getDefault() : Locale::getEnglish()), ec);
if (U_SUCCESS(ec)) {
UnicodeString patten;
- LogDebug("Type : " << type);
+ LoggerD("Type : " << type);
if (type == DATE_FORMAT)
patten = dateTimepatten->getBestPattern(UDAT_YEAR_MONTH_WEEKDAY_DAY, ec);
else if (type == DATE_SHORT_FORMAT)
if (!bLocale)
patten += " 'GMT'Z v'";
}
- LogDebug("pattern : " << toString(patten));
+ LoggerD("pattern : " << toString(patten));
return patten;
}
if (cal == NULL)
return;
- LogDebug("year : " << tolong(cal->get(UCAL_YEAR, ec)));
- LogDebug("month : " << tolong(cal->get(UCAL_MONTH, ec)));
- LogDebug("day : " << tolong(cal->get(UCAL_DATE, ec)));
- LogDebug("hours : " << tolong(cal->get(UCAL_HOUR, ec)));
- LogDebug("hours of day : " << tolong(cal->get(UCAL_HOUR_OF_DAY, ec)));
- LogDebug("AM/PM : " << tolong(cal->get(UCAL_AM_PM, ec)));
- LogDebug("dayofweek : " << tolong(cal->get(UCAL_DAY_OF_WEEK, ec)));
- LogDebug("minues : " << tolong(cal->get(UCAL_MINUTE, ec)));
- LogDebug("seconds : " << tolong(cal->get(UCAL_SECOND, ec)));
- LogDebug("miliseconds : " << tolong(cal->get(UCAL_MILLISECOND, ec)));
- LogDebug("zone offset : " << tolong(cal->get(UCAL_ZONE_OFFSET, ec)));
- LogDebug("dst offset : " << tolong(cal->get(UCAL_DST_OFFSET, ec)));
- LogDebug("is leap month? : " << tolong(cal->get(UCAL_IS_LEAP_MONTH, ec)));
+ LoggerD("year : " << tolong(cal->get(UCAL_YEAR, ec)));
+ LoggerD("month : " << tolong(cal->get(UCAL_MONTH, ec)));
+ LoggerD("day : " << tolong(cal->get(UCAL_DATE, ec)));
+ LoggerD("hours : " << tolong(cal->get(UCAL_HOUR, ec)));
+ LoggerD("hours of day : " << tolong(cal->get(UCAL_HOUR_OF_DAY, ec)));
+ LoggerD("AM/PM : " << tolong(cal->get(UCAL_AM_PM, ec)));
+ LoggerD("dayofweek : " << tolong(cal->get(UCAL_DAY_OF_WEEK, ec)));
+ LoggerD("minues : " << tolong(cal->get(UCAL_MINUTE, ec)));
+ LoggerD("seconds : " << tolong(cal->get(UCAL_SECOND, ec)));
+ LoggerD("miliseconds : " << tolong(cal->get(UCAL_MILLISECOND, ec)));
+ LoggerD("zone offset : " << tolong(cal->get(UCAL_ZONE_OFFSET, ec)));
+ LoggerD("dst offset : " << tolong(cal->get(UCAL_DST_OFFSET, ec)));
+ LoggerD("is leap month? : " << tolong(cal->get(UCAL_IS_LEAP_MONTH, ec)));
}
}
// limitations under the License.
//
-
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include "JSTimeUtil.h"
#include "JSTZDate.h"
#include "JSTimeDuration.h"
+#include <Logger.h>
namespace DeviceAPI {
namespace Time {
};
void on_widget_start_callback(int widgetId) {
- LogDebug("[TIZEN\\TimeUtil] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[TIZEN\\TimeUtil] on_widget_start_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId) {
- LogDebug("[TIZEN\\TimeUtil] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[TIZEN\\TimeUtil] on_widget_stop_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}
*/
#include "AnyFactory.h"
-
-#include <dpl/log/log.h>
#include <string.h>
#include <locale.h>
#include <Commons/Exception.h>
#include <PlatformException.h>
#include <JSUtil.h>
#include <sstream>
+#include <Logger.h>
namespace DeviceAPI {
namespace Tizen {
JSStringRef jsStrJson = JSValueCreateJSONString(context, value, 0, &jsError);
if(jsError != NULL || jsStrJson == NULL)
{
- LogError("Fail to create JSON string");
+ LoggerE("Fail to create JSON string");
return std::string("");
}
}
catch(BasePlatformException &e)
{
- LogError("Error while converting (" << e.getName() << ") : " << e.getMessage());
+ LoggerE("Error while converting (" << e.getName() << ") : " << e.getMessage());
}
return AnyPtr(new PrivateAny());
JSSortMode.cpp
FilterConverter.cpp
JSSimpleCoordinates.cpp
- JSFeature.cpp
- JSFeatureParam.cpp
PluginOnDemandPriv.cpp
JSTizen.cpp
)
* @description Reference from CalendarConverter.cpp
*/
-#include <dpl/log/log.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <CommonsJavaScript/Validator.h>
#include <CommonsJavaScript/JSUtils.h>
#include "JSSortMode.h"
#include "FilterConverter.h"
#include "AnyFactory.h"
+#include <Logger.h>
#define TIZEN_FILTER_CONVERTER_ATTRIBUTE_TYPE "type"
#define TIZEN_FILTER_CONVERTER_ATTRIBUTE_ORDER "order"
BaseFilterConverter::BaseFilterConverter(JSContextRef context) : Converter(context)
{
- LogDebug("entered");
+ LoggerD("entered");
}
BaseFilterConverter::~BaseFilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
JSValueRef BaseFilterConverter::toJSValueRef(const SortModePtr& arg)
IFilterProperties(properties),
m_exception(exception)
{
- LogDebug("entered");
+ LoggerD("entered");
}
FilterConverter::~FilterConverter()
{
- LogDebug("entered");
+ LoggerD("entered");
}
JSValueRef FilterConverter::toJSValueRef(FilterPtr arg)
JSValueRef value = JSGetArrayElement(m_context, obj, i);
if(value == NULL)
{
- LogWarning("value is NULL (" << i << ")");
+ LoggerW("value is NULL (" << i << ")");
continue;
}
filter = toFilter(value);
if(filter == NULL)
{
- LogWarning("Element is not an AbstractFilter (" << i << ")");
+ LoggerW("Element is not an AbstractFilter (" << i << ")");
continue;
}
*/
#include <algorithm>
-#include <dpl/log/log.h>
#include <Commons/Exception.h>
#include "IFilterVisitor.h"
+#include <Logger.h>
namespace DeviceAPI {\rnamespace Tizen {
#include "JSAttributeFilter.h"
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
#include <ArgumentValidator.h>
#include "AnyFactory.h"
+#include <Logger.h>
#define ATTRIBUTE_FILTER_CLASS_NAME "AttributeFilter"
-
#define ATTRIBUTE_FILTER_ATTR_ATTRIBUTE_NAME "attributeName"
#define ATTRIBUTE_FILTER_ATTR_MATCH_FLAG "matchFlag"
#define ATTRIBUTE_FILTER_ATTR_MATCH_VALUE "matchValue"
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef)
{
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
std::string attributeName;
MatchFlag matchFlag;
}
Catch(Exception)
{
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
context, TypeMismatchException("Error occurred while creating object"));
*exception = exceptionObj;
AttributeFilterPtr JSAttributeFilter::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSAttributeFilterPriv *priv = static_cast<JSAttributeFilterPriv*>(JSObjectGetPrivate(object));
if (!priv)
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
*/
#include "JSAttributeRangeFilter.h"
-
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
#include <ArgumentValidator.h>
#include "AnyFactory.h"
+#include <Logger.h>
#define ATTRIBUTE_RANGE_FILTER_CLASS_NAME "AttributeRangeFilter"
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef)
{
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
std::string attributeName;
AnyPtr initialValue(NULL);
}
Catch(Exception)
{
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
context, TypeMismatchException("Error occurred while creating object"));
*exception = exceptionObj;
AttributeRangeFilterPtr JSAttributeRangeFilter::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSAttributeRangeFilterPriv *priv = static_cast<JSAttributeRangeFilterPriv*>(JSObjectGetPrivate(object));
if (!priv)
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
*/
#include "JSCompositeFilter.h"
-
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <CommonsJavaScript/ScopedJSStringRef.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
#include <ArgumentValidator.h>
+#include <Logger.h>
#define ATTRIBUTE_FILTER_CLASS_NAME "CompositeFilter"
-
#define ATTRIBUTE_FILTER_ATTR_TYPE "type"
#define ATTRIBUTE_FILTER_ATTR_FILTERS "filters"
JSObjectRef jsObjectRef = JSObjectMake(context, getClassRef(), static_cast<void*>(priv));
if (NULL == jsObjectRef)
{
- LogError("object creation error");
+ LoggerE("object creation error");
return NULL;
}
const JSValueRef arguments[],
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
FilterType type;
JSValueRef jsValueFilters = NULL;
}
Catch(Exception)
{
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
context, TypeMismatchException("Error occurred while creating object"));
*exception = exceptionObj;
CompositeFilterPtr JSCompositeFilter::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSCompositeFilterPriv *priv = static_cast<JSCompositeFilterPriv*>(JSObjectGetPrivate(object));
if (!priv)
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return false;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
+++ /dev/null
-//
-// Tizen Web Device API
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file JSFeature.cpp
- * @author
- * @version 0.1
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <CommonsJavaScript/Converter.h>
-#include "JSFeature.h"
-#include "JSFeatureParam.h"
-
-
-namespace DeviceAPI {
-namespace Tizen {
-
-namespace {
- const char* PLUGIN_NAME = "Feature";
- const char* ATTRIBUTE_URI = "uri";
-}
-
-JSClassDefinition JSFeature::m_classInfo =
-{
- 0,
- kJSClassAttributeNone,
- PLUGIN_NAME,
- 0,
- m_properties,
- NULL, //m_functions,
- initialize,
- finalize,
- NULL, //hasProperty,
- NULL, //getProperty,
- NULL, //setProperty,
- NULL, //deleteProperty,
- NULL, //getPropertyNames,
- NULL,
- NULL,
- NULL, //hasInstance,
- NULL //convertToType
-};
-
-JSStaticValue JSFeature::m_properties[] = {
- { ATTRIBUTE_URI, getProperty, NULL, kJSPropertyAttributeReadOnly },
- { 0, 0, 0, 0 }
-};
-
-const JSClassDefinition* JSFeature::getClassInfo()
-{
- return &m_classInfo;
-}
-
-JSClassRef JSFeature::m_classRef = JSClassCreate(JSFeature::getClassInfo());
-
-void JSFeature::initialize(JSContextRef context, JSObjectRef object)
-{
- //LogDebug("entered");
- //private object should be passed to JSObjectMake function.
- //Nothing to do here.
-}
-
-void JSFeature::finalize(JSObjectRef object)
-{
- LogDebug("entered");
- JSFeaturePrivateObject* priv =
- static_cast<JSFeaturePrivateObject*>(JSObjectGetPrivate(object));
- delete priv;
-}
-
-JSClassRef JSFeature::getClassRef()
-{
- if (!m_classRef) {
- m_classRef = JSClassCreate(&m_classInfo);
- }
- return m_classRef;
-}
-
-JSValueRef JSFeature::getProperty(JSContextRef context, JSObjectRef object,
- JSStringRef propertyName, JSValueRef* exception)
-{
- LogDebug("entered");
- JSFeaturePrivateObject* priv =
- static_cast<JSFeaturePrivateObject*>(JSObjectGetPrivate(object));
- if (!priv) {
- LogError("no private object");
- return JSValueMakeUndefined(context);
- }
- Try
- {
- WrtDeviceApis::CommonsJavaScript::Converter converter(context);
- if (JSStringIsEqualToUTF8CString(propertyName, ATTRIBUTE_URI)) {
- return converter.toJSValueRef(priv->getObject()->getName() );
- }
- }
- Catch(WrtDeviceApis::Commons::Exception)
- {
- LogError("error during conversion");
- }
- return JSValueMakeUndefined(context);
-}
-
-} // Tizen
-} // DeviceAPI
-
+++ /dev/null
-//
-// Tizen Web Device API
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file JSFeature.h
- * @author
- * @version 0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_FEATURE_H_
-#define _WRT_PLUGIN_JS_FEATURE_H_
-
-#include <string>
-#include <vector>
-#include <JavaScriptCore/JavaScript.h>
-#include <WidgetDB/IWidgetFeature.h>
-
-namespace DeviceAPI {\rnamespace Tizen {
-
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<WrtDeviceApis::WidgetDB::Api::IWidgetFeaturePtr, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSFeaturePrivateObject;
-
-/**
- * @class JSFeature
- * @brief This class is javascript extenstion
- *
- */
-class JSFeature
-{
-public:
- /**
- * This method initializes this in the JS Engine.
- */
- static JSClassRef getClassRef();
-
- /**
- * Gets object's class description.
- */
- static const JSClassDefinition* getClassInfo();
-
-private:
- /**
- * The callback invoked when an object is first created.
- */
- static void initialize(JSContextRef context, JSObjectRef object);
-
- /**
- * The callback invoked when an object is finalized.
- */
- static void finalize(JSObjectRef object);
-
- /**
- * The callback invoked when getting a property's value.
- */
- static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
- JSStringRef propertyName, JSValueRef* exception);
-
- /**
- * This structure describes a statically declared value property.
- */
- static JSStaticValue m_properties[];
-
- /**
- * This structure contains properties and callbacks that define a type of object.
- */
- static JSClassDefinition m_classInfo;
-
- static JSClassRef m_classRef;
-
-};
-
-} // Tizen
-} // DeviceAPI
-
-
-#endif // _WRT_PLUGIN_JS_FEATURE_H_
+++ /dev/null
-//
-// Tizen Web Device API
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file JSFeatureParam.cpp
- * @author
- * @version 0.1
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include <CommonsJavaScript/Converter.h>
-#include "JSFeatureParam.h"
-
-
-namespace DeviceAPI {\rnamespace Tizen {
-
-namespace {
- const char* PLUGIN_NAME = "Param";
- const char* ATTRIBUTE_NAME = "name";
- const char* ATTRIBUTE_VALUE = "value";
-}
-
-JSClassDefinition JSFeatureParam::m_classInfo =
-{
- 0,
- kJSClassAttributeNone,
- PLUGIN_NAME,
- 0,
- m_properties,
- NULL, //m_functions,
- initialize,
- finalize,
- NULL, //hasProperty,
- NULL, //getProperty,
- NULL, //setProperty,
- NULL, //deleteProperty,
- NULL, //getPropertyNames,
- NULL,
- NULL,
- NULL, //hasInstance,
- NULL //convertToType
-};
-
-JSStaticValue JSFeatureParam::m_properties[] = {
- { ATTRIBUTE_NAME, getProperty, NULL, kJSPropertyAttributeReadOnly },
- { ATTRIBUTE_VALUE, getProperty, NULL, kJSPropertyAttributeReadOnly },
- { 0, 0, 0, 0 }
-};
-
-const JSClassDefinition* JSFeatureParam::getClassInfo()
-{
- return &m_classInfo;
-}
-
-JSClassRef JSFeatureParam::m_classRef = JSClassCreate(JSFeatureParam::getClassInfo());
-
-
-void JSFeatureParam::initialize(JSContextRef context, JSObjectRef object)
-{
- LogDebug("entered");
- //private object should be passed to JSObjectMake function.
- //Nothing to do here.
-}
-
-void JSFeatureParam::finalize(JSObjectRef object)
-{
- LogDebug("entered");
- JSFeatureParamPrivObject* priv =
- static_cast<JSFeatureParamPrivObject*>(JSObjectGetPrivate(object));
- delete priv;
-}
-
-JSClassRef JSFeatureParam::getClassRef()
-{
- if (!m_classRef) {
- m_classRef = JSClassCreate(&m_classInfo);
- }
- return m_classRef;
-}
-
-JSValueRef JSFeatureParam::getProperty(JSContextRef context, JSObjectRef object,
- JSStringRef propertyName, JSValueRef* exception)
-{
- LogDebug("entered");
- JSFeatureParamPrivObject* priv =
- static_cast<JSFeatureParamPrivObject*>(JSObjectGetPrivate(object));
- if (!priv) {
- LogError("no private object");
- return JSValueMakeUndefined(context);
- }
- Try
- {
- WrtDeviceApis::CommonsJavaScript::Converter converter(context);
- std::string propertyNameStr = converter.toString(propertyName);
- if (propertyNameStr == ATTRIBUTE_NAME) {
- return converter.toJSValueRef(priv->getObject().first);
- }
- else if (propertyNameStr == ATTRIBUTE_VALUE) {
- return converter.toJSValueRef(priv->getObject().second);
- }
- }
- Catch(WrtDeviceApis::Commons::Exception)
- {
- LogError("error during conversion");
- }
- return JSValueMakeUndefined(context);
-}
-
-} // Tizen
-} // DeviceAPI
-
+++ /dev/null
-//
-// Tizen Web Device API
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file JSFeatureParam.h
- * @author
- * @version 0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_FEATURE_PARAM_H_
-#define _WRT_PLUGIN_JS_FEATURE_PARAM_H_
-
-#include <string>
-#include <utility>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace DeviceAPI {\rnamespace Tizen {
-
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObject<std::pair<std::string, std::string>, WrtDeviceApis::CommonsJavaScript::NoOwnership> JSFeatureParamPrivObject;
-
-/**
- * @class JSFeatureParam
- * @brief This class is javascript extenstion
- *
- */
-class JSFeatureParam
-{
-public:
- /**
- * This method initializes this in the JS Engine.
- */
- static JSClassRef getClassRef();
-
- /**
- * Gets object's class description.
- */
- static const JSClassDefinition* getClassInfo();
-
-private:
- /**
- * The callback invoked when an object is first created.
- */
- static void initialize(JSContextRef context, JSObjectRef object);
-
- /**
- * The callback invoked when an object is finalized.
- */
- static void finalize(JSObjectRef object);
-
- /**
- * The callback invoked when getting a property's value.
- */
- static JSValueRef getProperty(JSContextRef context, JSObjectRef object,
- JSStringRef propertyName, JSValueRef* exception);
-
- /**
- * This structure describes a statically declared value property.
- */
- static JSStaticValue m_properties[];
-
- /**
- * This structure contains properties and callbacks that define a type of object.
- */
- static JSClassDefinition m_classInfo;
-
- static JSClassRef m_classRef;
-
-};
-
-} // Tizen
-} // DeviceAPI
-
-
-#endif // _WRT_PLUGIN_JS_FEATURE_PARAM_H_
#include "JSSimpleCoordinates.h"
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
#include <ArgumentValidator.h>
+#include <Logger.h>
#define ATTRIBUTE_FILTER_CLASS_NAME "SimpleCoordinates"
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");
ArgumentValidator validator(context, argumentCount, arguments);
}
Catch(Exception)
{
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
context, TypeMismatchException("Error occurred while creating object"));
*exception = exceptionObj;
SimpleCoordinatesPtr JSSimpleCoordinates::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSSimpleCoordinatesPriv *priv = static_cast<JSSimpleCoordinatesPriv*>(JSObjectGetPrivate(object));
if (!priv)
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
*/
#include "JSSortMode.h"
-
#include <string>
-#include <dpl/log/log.h>
#include <dpl/shared_ptr.h>
#include <JSWebAPIException.h>
#include <JSUtil.h>
#include <ArgumentValidator.h>
+#include <Logger.h>
#define ATTRIBUTE_FILTER_CLASS_NAME "SortMode"
JSSortModePriv *priv = new JSSortModePriv(context, privateData);
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");
std::string attributeName;
SortOrder sortOrder;
}
Catch(Exception)
{
- LogError("Argument type mismatch : " << _rethrown_exception.GetMessage());
+ LoggerE("Argument type mismatch : " << _rethrown_exception.GetMessage());
JSObjectRef exceptionObj = JSWebAPIException::makeJSWebAPIException(
context, TypeMismatchException("Error occurred while creating object"));
*exception = exceptionObj;
SortModePtr JSSortMode::getPrivData(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
JSSortModePriv *priv = static_cast<JSSortModePriv*>(JSObjectGetPrivate(object));
if (!priv)
ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Private object is null");
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
JSStringRef propertyName,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to get incorrect value [" << e.getName() << "] " << e.getMessage());
}
return JSValueMakeUndefined(context);
JSValueRef value,
JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
try
{
}
catch(BasePlatformException &e)
{
- LogWarning("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
+ LoggerW("trying to set incorrect value [" << e.getName() << "] " << e.getMessage());
}
return true;
#include <cassert>
#include <vector>
-#include <dpl/log/log.h>
#include <CommonsJavaScript/PrivateObject.h>
#include <CommonsJavaScript/Converter.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include "FilterTypes.h"
#include "AnyType.h"
#include "JSTizen.h"
-#include "JSFeature.h"
#include "plugin_config.h"
#include <WidgetDB/WidgetDBMgr.h>
#include <WidgetDB/IWidgetDB.h>
#include <PluginManager/PluginManagerFactory.h>
-
#include <iostream>
+#include <Logger.h>
#define PLUGIN_NAME "tizen"
-#define FUNCTION_LIST_AVAILABLE_FEATURES "listAvailableFeatures"
-#define FUNCTION_LIST_ACTIVATED_FEATURES "listActivatedFeatures"
namespace DeviceAPI {\rnamespace Tizen {
};
JSStaticFunction JSTizen::m_functions[] = {
- { FUNCTION_LIST_AVAILABLE_FEATURES, listAvailableFeatures, kJSPropertyAttributeNone},
- { FUNCTION_LIST_ACTIVATED_FEATURES, listActivatedFeatures, kJSPropertyAttributeNone},
{ 0, 0, 0 }
};
void JSTizen::initialize(JSContextRef context, JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
if (priv) {
void JSTizen::finalize(JSObjectRef object)
{
- LogDebug("entered");
+ LoggerD("entered");
TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
JSObjectSetPrivate(object, NULL);
delete priv;
TizenPrivate* priv =
static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
if (!priv || !priv->getObject()) {
- LogError("No private obejct");
+ LoggerE("No private obejct");
return;
}
PluginOnDemandPrivPtr privObj = priv->getObject();
}
Catch(Commons::Exception)
{
- LogError("Error occured");
+ LoggerE("Error occured");
}
}
bool JSTizen::hasProperty(JSContextRef context,
JSObjectRef object, JSStringRef propertyName)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
if (!priv || !priv->getObject()) {
- LogError("No private obejct");
+ LoggerE("No private obejct");
return false;
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Error occured");
+ LoggerE("Error occured");
}
//let JSCore to handle this property
JSValueRef JSTizen::getProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
TizenPrivate* priv =
static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
if (!priv || !priv->getObject()) {
- LogError("No private obejct");
+ LoggerE("No private obejct");
return false;
}
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Error occured");
+ LoggerE("Error occured");
}
/* During normal operation flow should not reach here,
bool JSTizen::setProperty(JSContextRef context, JSObjectRef object,
JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
{
- LogDebug("entered");
+ LoggerD("entered");
Try
{
TizenPrivate* priv =
static_cast<TizenPrivate*>(JSObjectGetPrivate(object));
if (!priv || !priv->getObject()) {
- LogError("No private obejct");
+ LoggerE("No private obejct");
return false;
}
std::string strPropertyName = CommonsJavaScript::Converter(context).toString(propertyName);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("Error occured");
+ LoggerE("Error occured");
}
//this code should not be reached. setProperty is not called when
//return false.
return false;
}
-
-JSValueRef JSTizen::listAvailableFeatures(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount,
- const JSValueRef arguments[], JSValueRef* exception)
-{
- LogDebug("entered");
-
- TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(thisObject));
- assert(priv);
-
- /*
- * Current Tizen spec assures that tizen is always available
- AccessStatus status = DEVICEAPIS_CHECK_ACCESS(
- DEVICEAPIS_FUNCTION_API_LIST_AVAIL_FEATURES);
-
- SYNC_ACCESS_STATUS_HANDLER(status, context, exception);
- */
-
- try
- {
- if (!priv) {
- ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "No private object");
- }
- PluginOnDemandPrivPtr privObj = priv->getObject();
- }
- catch(const WrtDeviceApis::Commons::Exception &ex)
- {
- return WrtDeviceApis::CommonsJavaScript::JSDOMExceptionFactory::UnknownException.make(context, exception);
- }
- JSObjectRef result = JSCreateArrayObject(context, 0, NULL);
- int widgetId = WrtAccessSingleton::Instance().getWidgetId();
- WidgetDB::Api::IWidgetDBPtr widgetDB =
- WidgetDB::Api::getWidgetDB(widgetId);
- WidgetDB::Api::Features features = widgetDB->getRegisteredFeatures();
- for (size_t i=0; i<features.size(); ++i) {
- JSFeaturePrivateObject *priv = new JSFeaturePrivateObject(context, features[i]);
- JSObjectRef tempObj = JSObjectMake(context, JSFeature::getClassRef(), priv);
- if (tempObj) {
- if (!JSSetArrayElement(context, result, i, tempObj)) {
- delete priv;
- }
- }
- else {
- delete priv;
- }
- }
- return result;
-}
-
-JSValueRef JSTizen::listActivatedFeatures(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argumentCount,
- const JSValueRef arguments[], JSValueRef* exception)
-{
- LogDebug("entered");
-
- TizenPrivate* priv = static_cast<TizenPrivate*>(JSObjectGetPrivate(thisObject));
- assert(priv);
-
- /*
- * Current Tizen spec assures that tizen is always available
- AccessStatus status = DEVICEAPIS_CHECK_ACCESS(
- DEVICEAPIS_FUNCTION_API_LIST_ACTIV_FEATURES);
-
- SYNC_ACCESS_STATUS_HANDLER(status, context, exception);*/
- try
- {
- if (!priv) {
- ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "No private object");
- }
- PluginOnDemandPrivPtr privObj = priv->getObject();
- }
- catch(const WrtDeviceApis::Commons::Exception &ex)
- {
- return WrtDeviceApis::CommonsJavaScript::JSDOMExceptionFactory::UnknownException.make(context, exception);
- }
- JSObjectRef result = JSCreateArrayObject(context, 0, NULL);
- int widgetId = WrtAccessSingleton::Instance().getWidgetId();
- WidgetDB::Api::IWidgetDBPtr widgetDB =
- WidgetDB::Api::getWidgetDB(widgetId);
- WidgetDB::Api::Features features = widgetDB->getWidgetFeatures();
- for (size_t i=0; i<features.size(); ++i) {
- JSFeaturePrivateObject *priv = new JSFeaturePrivateObject(context, features[i]);
- JSObjectRef tempObj = JSObjectMake(context, JSFeature::getClassRef(), priv);
- if (tempObj) {
- if (!JSSetArrayElement(context, result, i, tempObj)) {
- delete priv;
- }
- }
- else {
- delete priv;
- }
- }
- return result;
-}
-
} // Tizen
} // DeviceAPI
static JSStaticFunction m_functions[];
static JSClassRef m_classRef;
-
- static JSValueRef listAvailableFeatures(JSContextRef context,
- JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
- const JSValueRef arguments[], JSValueRef* exception);
-
- static JSValueRef listActivatedFeatures(JSContextRef context,
- JSObjectRef object, JSObjectRef thisObject, size_t argumentCount,
- const JSValueRef arguments[], JSValueRef* exception);
};
} // Tizen
* @brief
*/
-#include <dpl/log/log.h>
#include <Commons/plugin_initializer_def.h>
#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/Exception.h>
#include "JSCompositeFilter.h"
#include "JSSortMode.h"
#include "JSSimpleCoordinates.h"
+#include <Logger.h>
#define OBJECT_TIZEN "tizen"
void on_widget_start_callback(int widgetId)
{
- LogDebug("[Tizen\\xxx] on_widget_start_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\xxx] on_widget_start_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().initialize(widgetId);
}
Catch(Commons::Exception)
{
- LogError("WrtAccess initialization failed");
+ LoggerE("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
- LogDebug("[Tizen\\xxx] on_widget_stop_callback ("<<widgetId<<")");
+ LoggerD("[Tizen\\xxx] on_widget_stop_callback ("<<widgetId<<")");
Try
{
WrtAccessSingleton::Instance().deinitialize(widgetId);
}
Catch(WrtDeviceApis::Commons::Exception)
{
- LogError("WrtAccess deinitialization failed");
+ LoggerE("WrtAccess deinitialization failed");
}
}