From: saerome.kim Date: Mon, 29 Jan 2018 08:42:00 +0000 (+0900) Subject: mot-agent: change log level which is regarded errors even it is to show info. X-Git-Tag: submit/tizen/20190131.065036~147 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07ad667aa6c0d40925f82e922e8a6bcea7e47ce3;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git mot-agent: change log level which is regarded errors even it is to show info. Signed-off-by: saerome.kim --- diff --git a/src/mot-agent/ma-subowner.c b/src/mot-agent/ma-subowner.c index fbb8dfd..e8b66cd 100644 --- a/src/mot-agent/ma-subowner.c +++ b/src/mot-agent/ma-subowner.c @@ -718,11 +718,11 @@ static gboolean _ma_timeout_cb(gpointer data) switch (con->cid) { case MA_DISC_MOT_ENB_DEVS: - MA_LOGE("Discovered Multiple Ownership Transfer Enabled Devices"); + MA_LOGW("Timeout: Discovered MOT Enabled Devices"); __notify_found_devs(con); break; case MA_DISC_MOWNED_DEVS: - MA_LOGE("Discovered Multiple Ownership Transfer Enabled Devices"); + MA_LOGW("Timeout: Discovered My Owned Devices"); __notify_found_devs(con); break; case MA_MOT: @@ -959,7 +959,6 @@ static gpointer _mot_func(gpointer data) ret = OCAddPreconfigPin(src_dev, testPreconfigPin, strlen(testPreconfigPin)); if(OC_STACK_OK != ret) { MA_LOGE("Failed to save the pre-configured PIN"); - MA_LOGE("You can't use the pre-configured PIN OxM for MOT"); goto MOT_ENDED; } } @@ -979,7 +978,7 @@ static gpointer _mot_func(gpointer data) /* Restore MOT enabled devices */ src_dev->next = next_dev ; - MA_LOGE("Registered Discovered Devices"); + MA_LOGI("Registered Discovered Devices"); MOT_ENDED: @@ -1155,31 +1154,26 @@ static OicSecAcl_t* _create_target_acl(const OicUuid_t* target, const OicUuid_t* OicSecAce_t* ace = NULL; OicSecRsrc_t* rsrc = NULL; - if (NULL == target) { - MA_LOGE( "target is NULL"); - return NULL; - } + ma_check_null_ret_error(target, "target", NULL); + ma_check_null_ret_error(subject, "subject", NULL); + - if (NULL == subject) { - MA_LOGE( "subejct is NULL"); - return NULL; - } #ifdef DEBUG_UUID - MA_LOGE("target = %s", _get_readable_uuid(target)); - MA_LOGE("subject = %s", _get_readable_uuid(subject)); - MA_LOGE("rsrc_uri = %s", rsrc_uri); - MA_LOGE("rsrc_type = %s", rsrc_type); - MA_LOGE("rsrc_interface = %s", rsrc_interface); - MA_LOGE("permission = %d", permission); + MA_LOGD("target = %s", _get_readable_uuid(target)); + MA_LOGD("subject = %s", _get_readable_uuid(subject)); + MA_LOGD("rsrc_uri = %s", rsrc_uri); + MA_LOGD("rsrc_type = %s", rsrc_type); + MA_LOGD("rsrc_interface = %s", rsrc_interface); + MA_LOGD("permission = %d", permission); #endif acl = (OicSecAcl_t*) OICCalloc(1, sizeof(OicSecAcl_t)); if (!acl) { - MA_LOGE( "acl : OICCalloc failed =%d", errno); + MA_LOGE( "acl : OICCalloc failed = %d", errno); return NULL; } ace = (OicSecAce_t*) OICCalloc(1, sizeof(OicSecAce_t)); if (!ace) { - MA_LOGE( "ace : OICCalloc failed =%d", errno); + MA_LOGE( "ace : OICCalloc failed = %d", errno); return NULL; } LL_APPEND(acl->aces, ace); @@ -1188,14 +1182,14 @@ static OicSecAcl_t* _create_target_acl(const OicUuid_t* target, const OicUuid_t* /* fill the href */ rsrc = (OicSecRsrc_t*)OICCalloc(1, sizeof(OicSecRsrc_t)); if (!rsrc) { - MA_LOGE( "rsrc: OICCalloc failed =%d", errno); + MA_LOGE( "rsrc: OICCalloc failed = %d", errno); goto CREATE_ACL_ERROR; } len = strlen(rsrc_uri)+1; // '1' for null termination rsrc->href = (char*) OICCalloc(len, sizeof(char)); if (!rsrc->href) { - MA_LOGE( "rsrc->href: OICCalloc failed =%d", errno); + MA_LOGE( "rsrc->href: OICCalloc failed = %d", errno); goto CREATE_ACL_ERROR; } memcpy(rsrc->href, rsrc_uri, len); @@ -1204,12 +1198,12 @@ static OicSecAcl_t* _create_target_acl(const OicUuid_t* target, const OicUuid_t* rsrc->typeLen = 1; rsrc->types = (char**)OICCalloc(1, sizeof(char*)); if (!rsrc->types) { - MA_LOGE( "rsrc->types: OICCalloc failed =%d", errno); + MA_LOGE( "rsrc->types: OICCalloc failed = %d", errno); goto CREATE_ACL_ERROR; } rsrc->types[0] = g_strdup(rsrc_type); if (!rsrc->types[0]) { - MA_LOGE( "rsrc->types[0]: g_strdup failed =%d", errno); + MA_LOGE( "rsrc->types[0]: g_strdup failed = %d", errno); goto CREATE_ACL_ERROR; } @@ -1217,12 +1211,12 @@ static OicSecAcl_t* _create_target_acl(const OicUuid_t* target, const OicUuid_t* rsrc->interfaceLen = 1; rsrc->interfaces = (char**)OICCalloc(1, sizeof(char*)); if (!rsrc->interfaces) { - MA_LOGE( "rsrc->interfaces: OICCalloc failed =%d", errno); + MA_LOGE( "rsrc->interfaces: OICCalloc failed = %d", errno); goto CREATE_ACL_ERROR; } rsrc->interfaces[0] = g_strdup(rsrc_interface); if (!rsrc->interfaces[0]) { - MA_LOGE( "rsrc->interfaces[0] : g_strdup failed =%d", errno); + MA_LOGE( "rsrc->interfaces[0] : g_strdup failed = %d", errno); goto CREATE_ACL_ERROR; } @@ -1233,7 +1227,7 @@ static OicSecAcl_t* _create_target_acl(const OicUuid_t* target, const OicUuid_t* ace->eownerID = (OicUuid_t*)OICCalloc(1, sizeof(OicUuid_t)); if (NULL == ace->eownerID) { - MA_LOGE( "ace->eownerID : OICCalloc failed =%d", errno); + MA_LOGE( "ace->eownerID : OICCalloc failed = %d", errno); goto CREATE_ACL_ERROR; } memcpy(ace->eownerID->id, subject->id, sizeof(subject->id)); @@ -1879,7 +1873,7 @@ static gpointer _remove_mo_func(gpointer data) goto REMOVE_MO_ENDED; } - MA_LOGE("Remove Multiple Ownership Done"); + MA_LOGI("Remove Multiple Ownership Done"); REMOVE_MO_ENDED: @@ -2120,7 +2114,7 @@ static gpointer _pair_func(gpointer data) /* Restore MOT enabled devices */ src_dev->next = next_dev ; - MA_LOGE("Registered Discovered Devices"); + MA_LOGI("Registered Discovered Devices"); g_client->g_doneCB = false; @@ -2305,7 +2299,7 @@ static gpointer _unpair_func(gpointer data) goto PVUNPAIR_ERROR; } - MA_LOGE("Remove Multiple Ownership Done"); + MA_LOGI("Remove Multiple Ownership Done"); g_client->g_doneCB = false;