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;