From: Parkhi Date: Wed, 15 Feb 2017 07:23:29 +0000 (+0900) Subject: Update all of easysetup log message's level X-Git-Tag: 1.3.0~633 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c200c3a674444c6ab1ce240745ee704b6793ef5f;p=platform%2Fupstream%2Fiotivity.git Update all of easysetup log message's level - Public API's log level is changed "INFO" - Internal API's log level is changed "DEBUG" - All of infomation which is Easysetup data is changed "INFO_PRIVATE" log level Change-Id: I0eb97517be4da52fb0b202eb7c6379e85045a77d Signed-off-by: Parkhi Reviewed-on: https://gerrit.iotivity.org/gerrit/17291 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi Tested-by: Uze Choi --- diff --git a/service/easy-setup/enrollee/src/easysetup.c b/service/easy-setup/enrollee/src/easysetup.c index d463556..f8779f9 100755 --- a/service/easy-setup/enrollee/src/easysetup.c +++ b/service/easy-setup/enrollee/src/easysetup.c @@ -46,11 +46,11 @@ static ESDeviceProperty gESDeviceProperty; void ESWiFiConfRsrcCallback(ESResult esResult, ESWiFiConfData *eventData) { - OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback IN"); + OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback IN"); if(esResult != ES_OK) { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback Error Occured"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESWiFiConfRsrcCallback Error Occured"); return; } @@ -61,18 +61,18 @@ void ESWiFiConfRsrcCallback(ESResult esResult, ESWiFiConfData *eventData) } else { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "WiFiConfProvCb is NULL"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "WiFiConfProvCb is NULL"); return; } } void ESCoapCloudConfRsrcCallback(ESResult esResult, ESCoapCloudConfData *eventData) { - OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback IN"); + OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback IN"); if(esResult != ES_OK) { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback Error Occured"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESCoapCloudConfRsrcCallback Error Occured"); return; } @@ -82,18 +82,18 @@ void ESCoapCloudConfRsrcCallback(ESResult esResult, ESCoapCloudConfData *eventDa } else { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "CoapCloudConfProvCb is NULL"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "CoapCloudConfProvCb is NULL"); return; } } void ESDevConfRsrcallback(ESResult esResult, ESDevConfData *eventData) { - OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "ESDevConfRsrcallback IN"); + OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESDevConfRsrcallback IN"); if(esResult != ES_OK) { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "ESDevConfRsrcallback Error Occured"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "ESDevConfRsrcallback Error Occured"); return; } @@ -103,7 +103,7 @@ void ESDevConfRsrcallback(ESResult esResult, ESDevConfData *eventData) } else { - OIC_LOG_V(ERROR, ES_ENROLLEE_TAG, "DevConfProvCb is NULL"); + OIC_LOG(ERROR, ES_ENROLLEE_TAG, "DevConfProvCb is NULL"); return; } } @@ -185,14 +185,14 @@ ESResult ESSetDeviceProperty(ESDeviceProperty *deviceProperty) while((deviceProperty->WiFi).mode[modeIdx] != WiFi_EOF) { (gESDeviceProperty.WiFi).mode[modeIdx] = (deviceProperty->WiFi).mode[modeIdx]; - OIC_LOG_V(INFO, ES_ENROLLEE_TAG, "WiFi Mode : %d", (gESDeviceProperty.WiFi).mode[modeIdx]); + OIC_LOG_V(INFO_PRIVATE, ES_ENROLLEE_TAG, "WiFi Mode : %d", (gESDeviceProperty.WiFi).mode[modeIdx]); modeIdx ++; } (gESDeviceProperty.WiFi).freq = (deviceProperty->WiFi).freq; - OIC_LOG_V(INFO, ES_ENROLLEE_TAG, "WiFi Freq : %d", (gESDeviceProperty.WiFi).freq); + OIC_LOG_V(INFO_PRIVATE, ES_ENROLLEE_TAG, "WiFi Freq : %d", (gESDeviceProperty.WiFi).freq); OICStrcpy((gESDeviceProperty.DevConf).deviceName, OIC_STRING_MAX_VALUE, (deviceProperty->DevConf).deviceName); - OIC_LOG_V(INFO, ES_ENROLLEE_TAG, "Device Name : %s", (gESDeviceProperty.DevConf).deviceName); + OIC_LOG_V(INFO_PRIVATE, ES_ENROLLEE_TAG, "Device Name : %s", (gESDeviceProperty.DevConf).deviceName); OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESSetDeviceProperty OUT"); return ES_OK; @@ -235,7 +235,7 @@ ESResult ESSetErrorCode(ESErrorCode esErrCode) return ES_ERROR; } - OIC_LOG_V(DEBUG, ES_ENROLLEE_TAG, "Set ESErrorCode succesfully : %d", esErrCode); + OIC_LOG_V(INFO, ES_ENROLLEE_TAG, "Set ESErrorCode succesfully : %d", esErrCode); OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESSetErrorCode OUT"); return ES_OK; } @@ -259,6 +259,8 @@ ESResult ESTerminateEnrollee() ESResult ESSetCallbackForUserdata(ESReadUserdataCb readCb, ESWriteUserdataCb writeCb) { + OIC_LOG(INFO, ES_ENROLLEE_TAG, "ESSetCallbackForUserdata IN"); + if(!readCb && !writeCb) { OIC_LOG(INFO, ES_ENROLLEE_TAG, "Both of callbacks for user data are null"); diff --git a/service/easy-setup/enrollee/src/resourcehandler.c b/service/easy-setup/enrollee/src/resourcehandler.c index 17981f2..475a0c2 100755 --- a/service/easy-setup/enrollee/src/resourcehandler.c +++ b/service/easy-setup/enrollee/src/resourcehandler.c @@ -97,7 +97,7 @@ ESResult SetCallbackForUserData(ESReadUserdataCb readCb, ESWriteUserdataCb write { if(!readCb && !writeCb) { - OIC_LOG(INFO, ES_RH_TAG, "Both of callbacks for user data are null"); + OIC_LOG(DEBUG, ES_RH_TAG, "Both of callbacks for user data are null"); return ES_ERROR; } gReadUserdataCb = readCb; @@ -157,31 +157,31 @@ OCStackResult initEasySetupResource(bool isSecured) } if(res != OC_STACK_OK) { - OIC_LOG_V(INFO, ES_RH_TAG, "Created EasySetup resource with result: %s", getResult(res)); + OIC_LOG_V(ERROR, ES_RH_TAG, "Created EasySetup resource with result: %s", getResult(res)); return res; } res = OCBindResourceTypeToResource(g_ESEasySetupResource.handle, OC_RSRVD_ES_RES_TYPE_COL); if(res != OC_STACK_OK) { - OIC_LOG_V(INFO, ES_RH_TAG, "Binding Resource type with result: %s", getResult(res)); + OIC_LOG_V(ERROR, ES_RH_TAG, "Binding Resource type with result: %s", getResult(res)); return res; } res = OCBindResourceInterfaceToResource(g_ESEasySetupResource.handle, OC_RSRVD_INTERFACE_LL); if(res != OC_STACK_OK) { - OIC_LOG_V(INFO, ES_RH_TAG, "Binding Resource interface with result: %s", getResult(res)); + OIC_LOG_V(ERROR, ES_RH_TAG, "Binding Resource interface with result: %s", getResult(res)); return res; } res = OCBindResourceInterfaceToResource(g_ESEasySetupResource.handle, OC_RSRVD_INTERFACE_BATCH); if(res != OC_STACK_OK) { - OIC_LOG_V(INFO, ES_RH_TAG, "Binding Resource interface with result: %s", getResult(res)); + OIC_LOG_V(ERROR, ES_RH_TAG, "Binding Resource interface with result: %s", getResult(res)); return res; } - OIC_LOG_V(INFO, ES_RH_TAG, "Created EasySetup resource with result: %s", getResult(res)); + OIC_LOG_V(DEBUG, ES_RH_TAG, "Created EasySetup resource with result: %s", getResult(res)); return res; } @@ -214,7 +214,7 @@ OCStackResult initWiFiConfResource(bool isSecured) NULL, OC_DISCOVERABLE | OC_OBSERVABLE); } - OIC_LOG_V(INFO, ES_RH_TAG, "Created WiFiConf resource with result: %s", getResult(res)); + OIC_LOG_V(DEBUG, ES_RH_TAG, "Created WiFiConf resource with result: %s", getResult(res)); return res; } @@ -243,7 +243,7 @@ OCStackResult initCoapCloudConfResource(bool isSecured) NULL, OC_DISCOVERABLE | OC_OBSERVABLE); } - OIC_LOG_V(INFO, ES_RH_TAG, "Created CoapCloudConf resource with result: %s", getResult(res)); + OIC_LOG_V(DEBUG, ES_RH_TAG, "Created CoapCloudConf resource with result: %s", getResult(res)); return res; } @@ -272,14 +272,14 @@ OCStackResult initDevConfResource(bool isSecured) NULL, OC_DISCOVERABLE | OC_OBSERVABLE); } - OIC_LOG_V(INFO, ES_RH_TAG, "Created DevConf resource with result: %s", getResult(res)); + OIC_LOG_V(DEBUG, ES_RH_TAG, "Created DevConf resource with result: %s", getResult(res)); return res; } void updateEasySetupResource(OCEntityHandlerRequest* ehRequest, OCRepPayload* input) { - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESEasySetupResource.status %d", g_ESEasySetupResource.status); + OIC_LOG_V(DEBUG, ES_RH_TAG, "g_ESEasySetupResource.status %d", g_ESEasySetupResource.status); if(ehRequest->query) { @@ -314,7 +314,7 @@ void updateWiFiConfResource(OCRepPayload* input) { OICStrcpy(g_ESWiFiConfResource.ssid, sizeof(g_ESWiFiConfResource.ssid), ssid); OICStrcpy(wiFiData->ssid, sizeof(wiFiData->ssid), ssid); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESWiFiConfResource.ssid : %s", g_ESWiFiConfResource.ssid); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESWiFiConfResource.ssid : %s", g_ESWiFiConfResource.ssid); } char* cred = NULL; @@ -322,7 +322,7 @@ void updateWiFiConfResource(OCRepPayload* input) { OICStrcpy(g_ESWiFiConfResource.cred, sizeof(g_ESWiFiConfResource.cred), cred); OICStrcpy(wiFiData->pwd, sizeof(wiFiData->pwd), cred); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESWiFiConfResource.cred %s", g_ESWiFiConfResource.cred); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESWiFiConfResource.cred %s", g_ESWiFiConfResource.cred); } int64_t authType = -1; @@ -330,7 +330,7 @@ void updateWiFiConfResource(OCRepPayload* input) { g_ESWiFiConfResource.authType = authType; wiFiData->authtype = g_ESWiFiConfResource.authType; - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESWiFiConfResource.authType %u", g_ESWiFiConfResource.authType); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESWiFiConfResource.authType %u", g_ESWiFiConfResource.authType); } int64_t encType = -1; @@ -338,7 +338,7 @@ void updateWiFiConfResource(OCRepPayload* input) { g_ESWiFiConfResource.encType = encType; wiFiData->enctype = g_ESWiFiConfResource.encType; - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESWiFiConfResource.encType %u", g_ESWiFiConfResource.encType); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESWiFiConfResource.encType %u", g_ESWiFiConfResource.encType); } if(gReadUserdataCb) @@ -348,7 +348,7 @@ void updateWiFiConfResource(OCRepPayload* input) if(ssid || cred || authType!= -1 || encType != -1) { - OIC_LOG(INFO, ES_RH_TAG, "Send WiFiConfRsrc Callback To ES"); + OIC_LOG(DEBUG, ES_RH_TAG, "Send WiFiConfRsrc Callback To ES"); // TODO : Need to check appropriateness of gWiFiData if(gWifiConfRsrcEvtCb != NULL) @@ -363,7 +363,7 @@ void updateWiFiConfResource(OCRepPayload* input) if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESWiFiConfResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "Enrollee doesn't have any observer."); + OIC_LOG(DEBUG, ES_RH_TAG, "Enrollee doesn't have any observer."); } OICFree(wiFiData); @@ -391,7 +391,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) { OICStrcpy(g_ESCoapCloudConfResource.authCode, sizeof(g_ESCoapCloudConfResource.authCode), authCode); OICStrcpy(cloudData->authCode, sizeof(cloudData->authCode), authCode); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESCoapCloudConfResource.authCode %s", g_ESCoapCloudConfResource.authCode); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESCoapCloudConfResource.authCode %s", g_ESCoapCloudConfResource.authCode); } char *accessToken = NULL; @@ -399,7 +399,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) { OICStrcpy(g_ESCoapCloudConfResource.accessToken, sizeof(g_ESCoapCloudConfResource.accessToken), accessToken); OICStrcpy(cloudData->accessToken, sizeof(cloudData->accessToken), accessToken); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESCoapCloudConfResource.accessToken %s", g_ESCoapCloudConfResource.accessToken); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESCoapCloudConfResource.accessToken %s", g_ESCoapCloudConfResource.accessToken); } int64_t accessTokenType = -1; @@ -407,7 +407,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) { g_ESCoapCloudConfResource.accessTokenType = accessTokenType; cloudData->accessTokenType = g_ESCoapCloudConfResource.accessTokenType; - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESCoapCloudConfResource.accessTokenType %d", g_ESCoapCloudConfResource.accessTokenType); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESCoapCloudConfResource.accessTokenType %d", g_ESCoapCloudConfResource.accessTokenType); } char *authProvider = NULL; @@ -415,7 +415,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) { OICStrcpy(g_ESCoapCloudConfResource.authProvider, sizeof(g_ESCoapCloudConfResource.authProvider), authProvider); OICStrcpy(cloudData->authProvider, sizeof(cloudData->authProvider), authProvider); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESCoapCloudConfResource.authServerUrl %s", g_ESCoapCloudConfResource.authProvider); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESCoapCloudConfResource.authServerUrl %s", g_ESCoapCloudConfResource.authProvider); } char *ciServer = NULL; @@ -423,7 +423,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) { OICStrcpy(g_ESCoapCloudConfResource.ciServer, sizeof(g_ESCoapCloudConfResource.ciServer), ciServer); OICStrcpy(cloudData->ciServer, sizeof(cloudData->ciServer), ciServer); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESCoapCloudConfResource.ciServer %s", g_ESCoapCloudConfResource.ciServer); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESCoapCloudConfResource.ciServer %s", g_ESCoapCloudConfResource.ciServer); } if(gReadUserdataCb) @@ -433,7 +433,7 @@ void updateCoapCloudConfResource(OCRepPayload* input) if(authCode || accessToken || authProvider || ciServer) { - OIC_LOG(INFO, ES_RH_TAG, "Send CoapCloudConfRsrc Callback To ES"); + OIC_LOG(DEBUG, ES_RH_TAG, "Send CoapCloudConfRsrc Callback To ES"); // TODO : Need to check appropriateness of gCloudData if(gCoapCloudConfRsrcEvtCb != NULL) @@ -442,13 +442,13 @@ void updateCoapCloudConfResource(OCRepPayload* input) } else { - OIC_LOG(ERROR, ES_RH_TAG, "gCoapCloudConfRsrcEvtCb is NULL"); + OIC_LOG(DEBUG, ES_RH_TAG, "gCoapCloudConfRsrcEvtCb is NULL"); } } if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESCoapCloudConfResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer."); + OIC_LOG(DEBUG, ES_RH_TAG, "CoapCloudConf resource doesn't have any observer."); } OICFree(cloudData); @@ -472,7 +472,7 @@ void updateDevConfResource(OCRepPayload* input) { OICStrcpy(g_ESDevConfResource.location, sizeof(g_ESDevConfResource.location), location); OICStrcpy(devConfData->location, sizeof(devConfData->location), location); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESDevConfResource.location %s", g_ESDevConfResource.location); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESDevConfResource.location %s", g_ESDevConfResource.location); } char *country = NULL; @@ -480,7 +480,7 @@ void updateDevConfResource(OCRepPayload* input) { OICStrcpy(g_ESDevConfResource.country, sizeof(g_ESDevConfResource.country), country); OICStrcpy(devConfData->country, sizeof(devConfData->country), country); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESDevConfResource.country %s", g_ESDevConfResource.country); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESDevConfResource.country %s", g_ESDevConfResource.country); } char *language = NULL; @@ -488,7 +488,7 @@ void updateDevConfResource(OCRepPayload* input) { OICStrcpy(g_ESDevConfResource.language, sizeof(g_ESDevConfResource.language), language); OICStrcpy(devConfData->language, sizeof(devConfData->language), language); - OIC_LOG_V(INFO, ES_RH_TAG, "g_ESDevConfResource.language %s", g_ESDevConfResource.language); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "g_ESDevConfResource.language %s", g_ESDevConfResource.language); } if(gReadUserdataCb) @@ -498,7 +498,7 @@ void updateDevConfResource(OCRepPayload* input) if(country || language) { - OIC_LOG(INFO, ES_RH_TAG, "Send DevConfRsrc Callback To ES"); + OIC_LOG(DEBUG, ES_RH_TAG, "Send DevConfRsrc Callback To ES"); // TODO : Need to check appropriateness of gDevConfData if(gDevConfRsrcEvtCb != NULL) @@ -507,13 +507,13 @@ void updateDevConfResource(OCRepPayload* input) } else { - OIC_LOG(ERROR, ES_RH_TAG, "gDevConfRsrcEvtCb is NULL"); + OIC_LOG(DEBUG, ES_RH_TAG, "gDevConfRsrcEvtCb is NULL"); } } if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESDevConfResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "devConfResource doesn't have any observer."); + OIC_LOG(DEBUG, ES_RH_TAG, "devConfResource doesn't have any observer."); } OICFree(devConfData); @@ -534,7 +534,7 @@ OCRepPayload* constructResponseOfWiFiConf(char *interface) return NULL; } - OIC_LOG(INFO, ES_RH_TAG, "constructResponse WiFiConf res"); + OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse WiFiConf res"); OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_WIFICONF); OCRepPayload* repPayload = NULL; @@ -614,7 +614,7 @@ OCRepPayload* constructResponseOfCoapCloudConf(char *interface) return NULL; } - OIC_LOG(INFO, ES_RH_TAG, "constructResponse CoapCloudConf res"); + OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse CoapCloudConf res"); OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_COAPCLOUDCONF); OCRepPayload* repPayload = NULL; @@ -686,7 +686,7 @@ OCRepPayload* constructResponseOfDevConf(char *interface) return NULL; } - OIC_LOG(INFO, ES_RH_TAG, "constructResponse DevConf res"); + OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse DevConf res"); OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_DEVCONF); OCRepPayload* repPayload = NULL; @@ -931,7 +931,7 @@ OCRepPayload* constructResponseOfEasySetup(OCEntityHandlerRequest *ehRequest) (ehRequest->query && !strcmp(ehRequest->query, "")) || (ehRequest->query && CompareResourceInterface(ehRequest->query, OC_RSRVD_INTERFACE_DEFAULT))) { - OIC_LOG(INFO, ES_RH_TAG, "constructResponse EasySetup res"); + OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse EasySetup res"); OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_EASYSETUP); OCRepPayloadAddInterface(payload, OC_RSRVD_INTERFACE_DEFAULT); OCRepPayloadAddInterface(payload, OC_RSRVD_INTERFACE_LL); @@ -957,7 +957,7 @@ OCRepPayload* constructResponseOfEasySetup(OCEntityHandlerRequest *ehRequest) ehRequest->query && CompareResourceInterface(ehRequest->query, OC_RSRVD_INTERFACE_BATCH)) { - OIC_LOG(INFO, ES_RH_TAG, "constructResponse EasySetup res"); + OIC_LOG(DEBUG, ES_RH_TAG, "constructResponse EasySetup res"); OCRepPayloadSetUri(payload, OC_RSRVD_ES_URI_EASYSETUP); OCRepPayload* repPayload = NULL; @@ -1118,7 +1118,7 @@ OCStackResult CreateEasySetupResources(bool isSecured, ESResourceMask resourceMa } - OIC_LOG_V(INFO, ES_RH_TAG, "Created all resources with result: %s", getResult(res)); + OIC_LOG_V(DEBUG, ES_RH_TAG, "Created all resources with result: %s", getResult(res)); return res; } @@ -1274,7 +1274,7 @@ OCEntityHandlerResult ProcessGetRequest(OCEntityHandlerRequest *ehRequest, OCRep OCEntityHandlerResult ProcessPostRequest(OCEntityHandlerRequest *ehRequest, OCRepPayload** payload) { - OIC_LOG(INFO, ES_RH_TAG, "ProcessPostRequest enter"); + OIC_LOG(DEBUG, ES_RH_TAG, "ProcessPostRequest enter"); OCEntityHandlerResult ehResult = OC_EH_ERROR; if (ehRequest->payload && ehRequest->payload->type != PAYLOAD_TYPE_REPRESENTATION) { @@ -1399,12 +1399,12 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, { if (OC_REST_GET == entityHandlerRequest->method) { - OIC_LOG(INFO, ES_RH_TAG, "Received GET request"); + OIC_LOG(DEBUG, ES_RH_TAG, "Received GET request"); ehRet = ProcessGetRequest(entityHandlerRequest, &payload); } else if (OC_REST_PUT == entityHandlerRequest->method) { - OIC_LOG(INFO, ES_RH_TAG, "Received PUT request"); + OIC_LOG(DEBUG, ES_RH_TAG, "Received PUT request"); //PUT request will be handled in the internal implementation if (g_ESEasySetupResource.handle != NULL) @@ -1419,7 +1419,7 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, } else if (OC_REST_POST == entityHandlerRequest->method) { - OIC_LOG(INFO, ES_RH_TAG, "Received OC_REST_POST from client"); + OIC_LOG(DEBUG, ES_RH_TAG, "Received OC_REST_POST from client"); if (g_ESEasySetupResource.handle != NULL) { ehRet = ProcessPostRequest(entityHandlerRequest, &payload); @@ -1453,15 +1453,15 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, } if (entityHandlerRequest && (flag & OC_OBSERVE_FLAG)) { - OIC_LOG(INFO, ES_RH_TAG, "Flag includes OC_OBSERVE_FLAG"); + OIC_LOG(DEBUG, ES_RH_TAG, "Flag includes OC_OBSERVE_FLAG"); if (OC_OBSERVE_REGISTER == entityHandlerRequest->obsInfo.action) { - OIC_LOG (INFO, ES_RH_TAG, "Received OC_OBSERVE_REGISTER from Mediator"); + OIC_LOG(DEBUG, ES_RH_TAG, "Received OC_OBSERVE_REGISTER from Mediator"); } else if (OC_OBSERVE_DEREGISTER == entityHandlerRequest->obsInfo.action) { - OIC_LOG (INFO, ES_RH_TAG, "Received OC_OBSERVE_DEREGISTER from Mediator"); + OIC_LOG(DEBUG, ES_RH_TAG, "Received OC_OBSERVE_DEREGISTER from Mediator"); } } return ehRet; @@ -1469,70 +1469,70 @@ OCEntityHandlerResult OCEntityHandlerCb(OCEntityHandlerFlag flag, OCStackResult SetDeviceProperty(ESDeviceProperty *deviceProperty) { - OIC_LOG(INFO, ES_RH_TAG, "SetDeviceProperty IN"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetDeviceProperty IN"); g_ESWiFiConfResource.supportedFreq = (deviceProperty->WiFi).freq; - OIC_LOG_V(INFO, ES_RH_TAG, "WiFi Freq : %d", g_ESWiFiConfResource.supportedFreq); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "WiFi Freq : %d", g_ESWiFiConfResource.supportedFreq); int modeIdx = 0; while((deviceProperty->WiFi).mode[modeIdx] != WiFi_EOF) { g_ESWiFiConfResource.supportedMode[modeIdx] = (deviceProperty->WiFi).mode[modeIdx]; - OIC_LOG_V(INFO, ES_RH_TAG, "WiFi Mode : %d", g_ESWiFiConfResource.supportedMode[modeIdx]); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "WiFi Mode : %d", g_ESWiFiConfResource.supportedMode[modeIdx]); modeIdx ++; } g_ESWiFiConfResource.numMode = modeIdx; OICStrcpy(g_ESDevConfResource.devName, OIC_STRING_MAX_VALUE, (deviceProperty->DevConf).deviceName); - OIC_LOG_V(INFO, ES_RH_TAG, "Device Name : %s", g_ESDevConfResource.devName); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "Device Name : %s", g_ESDevConfResource.devName); OICStrcpy(g_ESDevConfResource.modelNumber, OIC_STRING_MAX_VALUE, (deviceProperty->DevConf).modelNumber); - OIC_LOG_V(INFO, ES_RH_TAG, "Model Number : %s", g_ESDevConfResource.modelNumber); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "Model Number : %s", g_ESDevConfResource.modelNumber); if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESWiFiConfResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "wifiResource doesn't have any observers."); + OIC_LOG(DEBUG, ES_RH_TAG, "wifiResource doesn't have any observers."); } if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESDevConfResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "devConfResource doesn't have any observers."); + OIC_LOG(DEBUG, ES_RH_TAG, "devConfResource doesn't have any observers."); } - OIC_LOG(INFO, ES_RH_TAG, "SetDeviceProperty OUT"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetDeviceProperty OUT"); return OC_STACK_OK; } OCStackResult SetEnrolleeState(ESEnrolleeState esState) { - OIC_LOG(INFO, ES_RH_TAG, "SetEnrolleeState IN"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetEnrolleeState IN"); g_ESEasySetupResource.status = esState; - OIC_LOG_V(INFO, ES_RH_TAG, "Enrollee Status : %d", g_ESEasySetupResource.status); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "Enrollee Status : %d", g_ESEasySetupResource.status); if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "provResource doesn't have any observers."); + OIC_LOG(DEBUG, ES_RH_TAG, "provResource doesn't have any observers."); } - OIC_LOG(INFO, ES_RH_TAG, "SetEnrolleeState OUT"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetEnrolleeState OUT"); return OC_STACK_OK; } OCStackResult SetEnrolleeErrCode(ESErrorCode esErrCode) { - OIC_LOG(INFO, ES_RH_TAG, "SetEnrolleeErrCode IN"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetEnrolleeErrCode IN"); g_ESEasySetupResource.lastErrCode = esErrCode; - OIC_LOG_V(INFO, ES_RH_TAG, "Enrollee ErrorCode : %d", g_ESEasySetupResource.lastErrCode); + OIC_LOG_V(INFO_PRIVATE, ES_RH_TAG, "Enrollee ErrorCode : %d", g_ESEasySetupResource.lastErrCode); if(OC_STACK_NO_OBSERVERS == OCNotifyAllObservers(g_ESEasySetupResource.handle, OC_HIGH_QOS)) { - OIC_LOG(INFO, ES_RH_TAG, "provResource doesn't have any observers."); + OIC_LOG(DEBUG, ES_RH_TAG, "provResource doesn't have any observers."); } - OIC_LOG(INFO, ES_RH_TAG, "SetEnrolleeErrCode OUT"); + OIC_LOG(DEBUG, ES_RH_TAG, "SetEnrolleeErrCode OUT"); return OC_STACK_OK; } diff --git a/service/easy-setup/mediator/richsdk/src/CloudResource.cpp b/service/easy-setup/mediator/richsdk/src/CloudResource.cpp index ce94718..70b99cc 100755 --- a/service/easy-setup/mediator/richsdk/src/CloudResource.cpp +++ b/service/easy-setup/mediator/richsdk/src/CloudResource.cpp @@ -46,7 +46,7 @@ namespace OIC ESCloudResourceCb cb, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG, ES_CLOUD_RES_TAG, "onCloudProvResponseSafetyCb"); + OIC_LOG(DEBUG, ES_CLOUD_RES_TAG, "onCloudProvResponseSafetyCb"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -57,7 +57,7 @@ namespace OIC void CloudResource::provisionProperties(const CloudProp& cloudProp) { - OIC_LOG (DEBUG, ES_CLOUD_RES_TAG, "provisionProperties IN"); + OIC_LOG(DEBUG, ES_CLOUD_RES_TAG, "provisionProperties IN"); OCRepresentation provisioningRepresentation = cloudProp.toOCRepresentation(); @@ -71,13 +71,13 @@ namespace OIC m_ocResource->post(OC_RSRVD_ES_RES_TYPE_EASYSETUP, BATCH_INTERFACE, provisioningRepresentation, QueryParamsMap(), cb, OC::QualityOfService::HighQos); - OIC_LOG (DEBUG, ES_CLOUD_RES_TAG, "provisionProperties OUT"); + OIC_LOG(DEBUG, ES_CLOUD_RES_TAG, "provisionProperties OUT"); } void CloudResource::onCloudProvResponse(const HeaderOptions& /*headerOptions*/, const OCRepresentation& /*rep*/, const int eCode) { - OIC_LOG_V (DEBUG, ES_CLOUD_RES_TAG, "onCloudProvResponse : eCode = %d", + OIC_LOG_V(DEBUG, ES_CLOUD_RES_TAG, "onCloudProvResponse : eCode = %d", eCode); if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED) @@ -88,7 +88,7 @@ namespace OIC if(eCode == OCStackResult::OC_STACK_COMM_ERROR) { - OIC_LOG_V (DEBUG, ES_CLOUD_RES_TAG, + OIC_LOG(DEBUG, ES_CLOUD_RES_TAG, "can't receive any response from Enrollee by a timeout threshold."); result = ESResult::ES_COMMUNICATION_ERROR; } diff --git a/service/easy-setup/mediator/richsdk/src/EasySetup.cpp b/service/easy-setup/mediator/richsdk/src/EasySetup.cpp index e57bb80..ef1a06a 100755 --- a/service/easy-setup/mediator/richsdk/src/EasySetup.cpp +++ b/service/easy-setup/mediator/richsdk/src/EasySetup.cpp @@ -50,7 +50,7 @@ namespace OIC std::shared_ptr EasySetup::createRemoteEnrollee (std::shared_ptr< OC::OCResource > resource) { - OIC_LOG(DEBUG, EASYSETUP_TAG, "createRemoteEnrollee IN"); + OIC_LOG(INFO, EASYSETUP_TAG, "createRemoteEnrollee IN"); if(resource) { @@ -66,11 +66,11 @@ namespace OIC { if(interface.compare(BATCH_INTERFACE) == 0) { - OIC_LOG (DEBUG, EASYSETUP_TAG, "RemoteEnrollee object is succeessfully created"); - OIC_LOG_V (DEBUG, EASYSETUP_TAG, "HOST: %s", resource->host().c_str()); - OIC_LOG_V (DEBUG, EASYSETUP_TAG, "URI: %s", resource->uri().c_str()); - OIC_LOG_V (DEBUG, EASYSETUP_TAG, "SID: %s", resource->sid().c_str()); - OIC_LOG_V (DEBUG, EASYSETUP_TAG, "CONNECTIVITY: %d", resource->connectivityType()); + OIC_LOG (INFO, EASYSETUP_TAG, "RemoteEnrollee object is succeessfully created"); + OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "HOST: %s", resource->host().c_str()); + OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "URI: %s", resource->uri().c_str()); + OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "SID: %s", resource->sid().c_str()); + OIC_LOG_V (INFO_PRIVATE, EASYSETUP_TAG, "CONNECTIVITY: %d", resource->connectivityType()); return std::shared_ptr< RemoteEnrollee > (new RemoteEnrollee(resource)); } } diff --git a/service/easy-setup/mediator/richsdk/src/EnrolleeResource.cpp b/service/easy-setup/mediator/richsdk/src/EnrolleeResource.cpp index ad6dd1a..48750fb 100755 --- a/service/easy-setup/mediator/richsdk/src/EnrolleeResource.cpp +++ b/service/easy-setup/mediator/richsdk/src/EnrolleeResource.cpp @@ -44,7 +44,7 @@ namespace OIC ESEnrolleeResourceCb cb, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onEnrolleeResourceSafetyCB"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onEnrolleeResourceSafetyCB"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -55,19 +55,19 @@ namespace OIC void EnrolleeResource::onProvisioningResponse(const HeaderOptions& /*headerOptions*/, const OCRepresentation& /*rep*/, const int eCode) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onProvisioningResponse : eCode = %d", + OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onProvisioningResponse : eCode = %d", eCode); if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED) { ESResult result = ESResult::ES_ERROR; - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "onProvisioningResponse : Provisioning is failed "); if(eCode == OCStackResult::OC_STACK_COMM_ERROR) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "can't receive any response from Enrollee by a timeout threshold."); result = ESResult::ES_COMMUNICATION_ERROR; } @@ -78,7 +78,7 @@ namespace OIC return; } - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onProvisioningResponse : Provisioning is success. "); std::shared_ptr< DevicePropProvisioningStatus > provStatus = std::make_shared< @@ -89,19 +89,19 @@ namespace OIC void EnrolleeResource::onGetStatusResponse(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onGetStatusResponse : eCode = %d", + OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onGetStatusResponse : eCode = %d", eCode); if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED) { ESResult result = ESResult::ES_ERROR; - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "onGetStatusResponse : onGetStatusResponse is failed "); if(eCode == OCStackResult::OC_STACK_COMM_ERROR) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "can't receive any response from Enrollee by a timeout threshold."); result = ESResult::ES_COMMUNICATION_ERROR; } @@ -125,19 +125,19 @@ namespace OIC void EnrolleeResource::onGetConfigurationResponse(const HeaderOptions& /*headerOptions*/, const OCRepresentation& rep, const int eCode) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onGetConfigurationResponse : eCode = %d", + OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onGetConfigurationResponse : eCode = %d", eCode); if (eCode > OCStackResult::OC_STACK_RESOURCE_CHANGED) { ESResult result = ESResult::ES_ERROR; - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "onGetConfigurationResponse : onGetConfigurationResponse is failed "); if(eCode == OCStackResult::OC_STACK_COMM_ERROR) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "can't receive any response from Enrollee by a timeout threshold."); result = ESResult::ES_COMMUNICATION_ERROR; } @@ -177,7 +177,7 @@ namespace OIC void EnrolleeResource::getStatus() { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getStatus IN"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getStatus IN"); if (m_ocResource == nullptr) { @@ -212,12 +212,12 @@ namespace OIC return; } - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getStatus OUT"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getStatus OUT"); } void EnrolleeResource::getConfiguration() { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getConfiguration IN"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getConfiguration IN"); if (m_ocResource == nullptr) { @@ -251,12 +251,12 @@ namespace OIC return; } - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getConfiguration OUT"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "getConfiguration OUT"); } void EnrolleeResource::provisionProperties(const DeviceProp& deviceProp) { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "provisionProperties IN"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "provisionProperties IN"); if (m_ocResource == nullptr) { throw ESBadRequestException("Resource is not initialized"); @@ -275,7 +275,7 @@ namespace OIC m_ocResource->post(OC_RSRVD_ES_RES_TYPE_EASYSETUP, BATCH_INTERFACE, provisioningRepresentation, QueryParamsMap(), cb, OC::QualityOfService::HighQos); - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "provisionProperties OUT"); + OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "provisionProperties OUT"); } } } diff --git a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp index 26ba5db..66c962e 100755 --- a/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp +++ b/service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp @@ -71,7 +71,7 @@ namespace OIC ESSecurityCb cb, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "onEnrolleeSecuritySafetyCB"); + OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "onEnrolleeSecuritySafetyCB"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -185,18 +185,18 @@ namespace OIC ownerID = {}; } - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Mediator ID %s", m_mediatorID.c_str()); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Enrollee's Owner ID %s", ownerID.c_str()); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Mediator ID %s", m_mediatorID.c_str()); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Enrollee's Owner ID %s", ownerID.c_str()); if(ownerID == m_mediatorID) { - OIC_LOG(INFO, ENROLEE_SECURITY_TAG, + OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "The found device's first owner ID is matched with Mediator's ID"); ret = true; } else { - OIC_LOG(INFO, ENROLEE_SECURITY_TAG, + OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "The found device's first owner ID is NOT matched with Mediator's ID"); } @@ -237,7 +237,7 @@ namespace OIC if(subOwnerID == m_mediatorID) { - OIC_LOG(INFO, ENROLEE_SECURITY_TAG, + OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "The found device's owner ID is matched with Mediator's ID as a second owner"); ret = true; break; @@ -247,7 +247,7 @@ namespace OIC if(!ret) { - OIC_LOG(INFO, ENROLEE_SECURITY_TAG, + OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "The found device's sub owner ID is NOT matched with Mediator's ID"); } @@ -337,7 +337,9 @@ namespace OIC if( OC_STACK_OK == result->at(i).res ) { OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "MultipleOwnershipTransferCb is succeeded"); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device %s", result->at(i).res, uuid.c_str()); + OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", uuid.c_str()); + OTMResult = true; } else @@ -556,7 +558,9 @@ namespace OIC if( OC_STACK_OK == result->at(i).res ) { OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "OwnershipTransfer is succeeded"); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device %s", result->at(i).res, uuid.c_str()); + OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", uuid.c_str()); + OTMResult = true; } else @@ -622,7 +626,7 @@ namespace OIC OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Secured resource is found."); OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "HOST: %s", m_securedResource->getDevAddr().c_str()); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "SID: %s", m_securedResource->getDeviceID().c_str()); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "SID: %s", m_securedResource->getDeviceID().c_str()); OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Owned status: %d", m_securedResource->getOwnedStatus()); OicSecOxm_t selectedOTMethod = OIC_OXM_COUNT; @@ -640,7 +644,7 @@ namespace OIC char uuidString[UUID_STRING_SIZE] = {}; if(OCConvertUuidToString(m_securedResource->getDevPtr()->doxm->owner.id, uuidString)) { - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Owner ID: %s", uuidString); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Owner ID: %s", uuidString); } else { @@ -670,7 +674,7 @@ namespace OIC else if(OIC_PRECONFIG_PIN == ownershipTransferData.getMOTMethod()) { OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Selected MOT Method: OIC_PRECONFIG_PIN"); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Pre-configured PIN: %s", + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Pre-configured PIN: %s", ownershipTransferData.getPreConfiguredPin().c_str()); } #endif @@ -733,7 +737,7 @@ namespace OIC char uuidString[UUID_STRING_SIZE] = {}; if(OCConvertUuidToString(mediatorDevId->id, uuidString)) { - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Mediator UUID : %s", uuidString); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Mediator UUID : %s", uuidString); OICFree(mediatorDevId); return std::string(uuidString); } @@ -930,7 +934,7 @@ namespace OIC OCStackResult result = OC_STACK_ERROR; ESResult res = ESResult::ES_ERROR; - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Transfering ownership for : %s ", + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Transfering ownership for : %s ", m_securedResource->getDeviceID().c_str()); OC::ResultCallBack ownershipTransferCb = @@ -969,7 +973,7 @@ namespace OIC OCStackResult result = OC_STACK_ERROR; - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Transfering sub-ownership for : %s ", + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Transfering sub-ownership for : %s ", m_securedResource->getDeviceID().c_str()); if(OIC_PRECONFIG_PIN == MOTdata.getMOTMethod() && @@ -1035,8 +1039,8 @@ namespace OIC std::string uuid; convertUUIDToString(result->at(i).deviceId.id, uuid); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, - "Result is = %d for device %s", result->at(i).res, uuid.c_str()); + OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", uuid.c_str()); } removeDeviceResult = true; } @@ -1065,7 +1069,7 @@ namespace OIC { std::string uuid; convertUUIDToString(pUuidList->dev.id, uuid); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "m_ocResource->sid(): %s, cur DB UUID %s", m_ocResource->sid().c_str(), uuid.c_str()); if(m_ocResource->sid() == uuid.c_str()) @@ -1141,7 +1145,7 @@ namespace OIC { OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "Secured resource is found."); OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "HOST: %s", ownedDevice->getDevAddr().c_str()); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "SID: %s", ownedDevice->getDeviceID().c_str()); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "SID: %s", ownedDevice->getDeviceID().c_str()); OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Owned status: %d", ownedDevice->getOwnedStatus()); if (ownedDevice->getOwnedStatus()) @@ -1257,7 +1261,7 @@ namespace OIC return res; } - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Given cloudUuid: %s", cloudUuid.c_str()); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "Given cloudUuid: %s", cloudUuid.c_str()); OicUuid_t uuid; if(OC_STACK_OK != ConvertStrToUuid(cloudUuid.c_str(), &uuid)) @@ -1309,13 +1313,13 @@ namespace OIC OicSecAcl_t* acl = (OicSecAcl_t*) OICCalloc(1, sizeof(OicSecAcl_t)); if(!acl) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); return NULL; // not need to 'goto' |ERROR| before allocating |acl| } OicSecAce_t* ace = (OicSecAce_t*) OICCalloc(1, sizeof(OicSecAce_t)); if(!ace) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); return NULL; // not need to 'goto' |ERROR| before allocating |acl| } LL_APPEND(acl->aces, ace); @@ -1325,7 +1329,7 @@ namespace OIC OicSecRsrc_t* rsrc = (OicSecRsrc_t*)OICCalloc(1, sizeof(OicSecRsrc_t)); if(!rsrc) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); OCDeleteACLList(acl); return NULL; } @@ -1335,7 +1339,7 @@ namespace OIC rsrc->href = (char*) OICCalloc(len, sizeof(char)); if(!rsrc->href) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); FreeRsrc(rsrc); OCDeleteACLList(acl); return NULL; @@ -1347,7 +1351,7 @@ namespace OIC rsrc->types = (char**)OICCalloc(arrLen, sizeof(char*)); if(!rsrc->types) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); FreeRsrc(rsrc); OCDeleteACLList(acl); return NULL; @@ -1355,7 +1359,7 @@ namespace OIC rsrc->types[0] = OICStrdup("rt"); // ignore if(!rsrc->types[0]) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICStrdup error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICStrdup error return"); FreeRsrc(rsrc); OCDeleteACLList(acl); return NULL; @@ -1365,7 +1369,7 @@ namespace OIC rsrc->interfaces = (char**)OICCalloc(arrLen, sizeof(char*)); if(!rsrc->interfaces) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return"); FreeRsrc(rsrc); OCDeleteACLList(acl); return NULL; @@ -1373,7 +1377,7 @@ namespace OIC rsrc->interfaces[0] = OICStrdup("if"); // ignore if(!rsrc->interfaces[0]) { - OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICStrdup error return"); + OIC_LOG(ERROR, ENROLEE_SECURITY_TAG, "createAcl: OICStrdup error return"); FreeRsrc(rsrc); OCDeleteACLList(acl); return NULL; @@ -1405,8 +1409,9 @@ namespace OIC for (unsigned int i = 0; i < result->size(); i++) { convertUUIDToString(result->at(i).deviceId.id, devUuid); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device %s", - result->at(i).res, devUuid.c_str()); + + OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", devUuid.c_str()); } delete result; aclResult = true; @@ -1431,8 +1436,9 @@ namespace OIC for (unsigned int i = 0; i < result->size(); i++) { convertUUIDToString(result->at(i).deviceId.id, devUuid); - OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d for device %s", - result->at(i).res, devUuid.c_str()); + + OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Result is = %d", result->at(i).res); + OIC_LOG_V(INFO_PRIVATE, ENROLEE_SECURITY_TAG, "device uuid : %s", devUuid.c_str()); } delete result; certResult= true; diff --git a/service/easy-setup/mediator/richsdk/src/RemoteEnrollee.cpp b/service/easy-setup/mediator/richsdk/src/RemoteEnrollee.cpp index 2c887ee..5bba4e5 100755 --- a/service/easy-setup/mediator/richsdk/src/RemoteEnrollee.cpp +++ b/service/easy-setup/mediator/richsdk/src/RemoteEnrollee.cpp @@ -57,7 +57,7 @@ namespace OIC const std::shared_ptr< SecProvisioningStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusHandlerCallback"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -68,13 +68,13 @@ namespace OIC void RemoteEnrollee::securityStatusHandler( const std::shared_ptr< SecProvisioningStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "securityStatusHandlr IN"); - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "UUID = %s, ESResult = %d", - status->getDeviceUUID().c_str(), status->getESResult()); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "securityStatusHandlr IN"); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "UUID = %s", status->getDeviceUUID().c_str()); + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "ESResult = %d", status->getESResult()); if(status->getESResult() == ES_OK) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Ownership transfer is successfully done."); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "Ownership transfer is successfully done."); m_securityProvStatusCb(status); } else @@ -82,14 +82,14 @@ namespace OIC OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_TAG, "Ownership transfer is failed."); m_securityProvStatusCb(status); } - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "securityStatusHandlr OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "securityStatusHandlr OUT"); } ESOwnershipTransferData RemoteEnrollee::onSecurityStatusWithOptionHandlerCallback( const std::shared_ptr< SecProvisioningStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusWithOptionHandlerCallback"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusWithOptionHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -101,11 +101,11 @@ namespace OIC ESOwnershipTransferData RemoteEnrollee::securityStatusWithOptionHandler( const std::shared_ptr< SecProvisioningStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "securityStatusWithOptionHandler IN"); - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "UUID = %s, ESResult = %d", - status->getDeviceUUID().c_str(), status->getESResult()); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "securityStatusWithOptionHandler IN"); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "UUID = %s", status->getDeviceUUID().c_str()); + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "ESResult = %d", status->getESResult()); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "securityStatusWithOptionHandler OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "securityStatusWithOptionHandler OUT"); return m_securityProvStatusCbWithOption(status); } @@ -113,7 +113,7 @@ namespace OIC const std::shared_ptr< GetEnrolleeStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onGetStatusHandlerCallback"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onGetStatusHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -124,20 +124,20 @@ namespace OIC void RemoteEnrollee::getStatusHandler( const std::shared_ptr< GetEnrolleeStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler IN"); - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler = %d", + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler = %d", status->getESResult()); m_getStatusCb(status); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler OUT"); } void RemoteEnrollee::onGetConfigurationStatusHandlerCallback( const std::shared_ptr< GetConfigurationStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onGetConfigurationStatusHandlerCallback"); + OIC_LOG(INFO,ES_REMOTE_ENROLLEE_TAG,"onGetConfigurationStatusHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -148,20 +148,20 @@ namespace OIC void RemoteEnrollee::getConfigurationStatusHandler ( const std::shared_ptr< GetConfigurationStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getConfigurationStatusHandler IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getConfigurationStatusHandler IN"); - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG,"GetConfigurationStatus = %d", + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG,"GetConfigurationStatus = %d", status->getESResult()); m_getConfigurationStatusCb(status); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getConfigurationStatusHandler OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getConfigurationStatusHandler OUT"); } void RemoteEnrollee::onDevicePropProvisioningStatusHandlerCallback( const std::shared_ptr< DevicePropProvisioningStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onDevicePropProvisioningStatusHandlerCallback"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onDevicePropProvisioningStatusHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -172,19 +172,19 @@ namespace OIC void RemoteEnrollee::devicePropProvisioningStatusHandler( const std::shared_ptr< DevicePropProvisioningStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "devicePropProvisioningStatusHandler IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "devicePropProvisioningStatusHandler IN"); - OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_TAG, "DeviceProvStatus = %d", status->getESResult()); + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "DeviceProvStatus = %d", status->getESResult()); m_devicePropProvStatusCb(status); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "devicePropProvisioningStatusHandler OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "devicePropProvisioningStatusHandler OUT"); } void RemoteEnrollee::onCloudPropProvisioningStatusHandlerCallback( const std::shared_ptr< CloudPropProvisioningStatus > status, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onCloudPropProvisioningStatusHandlerCallback"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onCloudPropProvisioningStatusHandlerCallback"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -195,19 +195,19 @@ namespace OIC void RemoteEnrollee::cloudPropProvisioningStatusHandler ( const std::shared_ptr< CloudPropProvisioningStatus > status) const { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "cloudPropProvisioningStatusHandler IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "cloudPropProvisioningStatusHandler IN"); - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"CloudProvStatus = %d", + OIC_LOG_V(INFO,ES_REMOTE_ENROLLEE_TAG,"CloudProvStatus = %d", status->getESResult()); m_cloudPropProvStatusCb(status); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "cloudPropProvisioningStatusHandler OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "cloudPropProvisioningStatusHandler OUT"); } void RemoteEnrollee::onDiscoveredCallback(const std::shared_ptr resource, std::weak_ptr this_ptr) { - OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onDiscoveredCallback()"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"onDiscoveredCallback()"); std::shared_ptr Ptr = this_ptr.lock(); if(Ptr) { @@ -217,7 +217,7 @@ namespace OIC void RemoteEnrollee::onDeviceDiscovered(std::shared_ptr resource) { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_TAG, "onDeviceDiscovered IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "onDeviceDiscovered IN"); try { @@ -231,21 +231,21 @@ namespace OIC // Get the resource URI resourceURI = resource->uri(); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "URI of the resource: %s", resourceURI.c_str()); // Get the resource host address hostAddress = resource->host(); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "Host address of the resource: %s", hostAddress.c_str()); hostDeviceID = resource->sid(); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "Host DeviceID of the resource: %s", hostDeviceID.c_str()); if(!m_deviceId.empty() && m_deviceId == hostDeviceID) { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_TAG, "Find matched resource for cloud provisioning"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "Find matched resource for cloud provisioning"); m_ocResource = resource; m_discoveryResponse = true; m_cond.notify_all(); @@ -255,23 +255,23 @@ namespace OIC } catch(std::exception& e) { - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "Exception in foundResource: %s", e.what()); } - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_TAG, "onDeviceDiscovered OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "onDeviceDiscovered OUT"); } ESResult RemoteEnrollee::discoverResource() { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "discoverResource IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "discoverResource IN"); std::string query(""); query.append(ES_BASE_RES_URI); query.append("?rt="); query.append(OC_RSRVD_ES_RES_TYPE_EASYSETUP); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, "query = %s", query.c_str()); + OIC_LOG_V(INFO, ES_REMOTE_ENROLLEE_TAG, "query = %s", query.c_str()); m_discoveryResponse = false; @@ -283,7 +283,7 @@ namespace OIC if (result != OCStackResult::OC_STACK_OK) { - OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_TAG, "Failed discoverResource"); return ES_ERROR; } @@ -293,7 +293,7 @@ namespace OIC if (!m_discoveryResponse) { - OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_TAG, "Failed discoverResource because timeout"); return ES_ERROR; } @@ -303,7 +303,7 @@ namespace OIC void RemoteEnrollee::provisionSecurity(const SecurityProvStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity IN"); #ifdef __WITH_DTLS__ ESResult res = ESResult::ES_ERROR; if(!callback) @@ -328,7 +328,7 @@ namespace OIC std::make_shared< SecProvisioningStatus >(m_localEnrolleeSecurity->getUUID(), res); securityProvStatusCb(securityProvisioningStatus); #else - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG,"Mediator is unsecured built."); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"Mediator is unsecured built."); if(!callback) { @@ -339,12 +339,12 @@ namespace OIC ("", ESResult::ES_SEC_OPERATION_IS_NOT_SUPPORTED); callback(securityProvisioningStatus); #endif - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity OUT"); } void RemoteEnrollee::provisionSecurity(const SecurityProvStatusCbWithOption callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity IN"); #ifdef __WITH_DTLS__ ESResult res = ESResult::ES_ERROR; if(!callback) @@ -369,7 +369,7 @@ namespace OIC std::make_shared< SecProvisioningStatus >(m_localEnrolleeSecurity->getUUID(), res); securityProvStatusCbWithOption(securityProvisioningStatus); #else - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG,"Mediator is unsecured built."); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG,"Mediator is unsecured built."); if(!callback) { @@ -380,12 +380,12 @@ namespace OIC ("", ESResult::ES_SEC_OPERATION_IS_NOT_SUPPORTED); callback(securityProvisioningStatus); #endif - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionSecurity OUT"); } void RemoteEnrollee::getStatus(const GetStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatus IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getStatus IN"); if(!callback) { @@ -407,12 +407,12 @@ namespace OIC m_enrolleeResource->registerGetStatusCallback(getStatusCb); m_enrolleeResource->getStatus(); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatus OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getStatus OUT"); } void RemoteEnrollee::getConfiguration(const GetConfigurationStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getConfiguration IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getConfiguration IN"); if(!callback) { @@ -434,13 +434,13 @@ namespace OIC m_enrolleeResource->registerGetConfigurationStatusCallback(getConfigurationStatusCb); m_enrolleeResource->getConfiguration(); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getConfiguration OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "getConfiguration OUT"); } void RemoteEnrollee::provisionDeviceProperties(const DeviceProp& deviceProp, const DevicePropProvStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionDeviceProperties IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionDeviceProperties IN"); if(!callback) { @@ -467,12 +467,12 @@ namespace OIC m_enrolleeResource->registerDevicePropProvStatusCallback(devicePropProvStatusCb); m_enrolleeResource->provisionProperties(deviceProp); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionDeviceProperties OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionDeviceProperties OUT"); } void RemoteEnrollee::initCloudResource() { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "initCloudResource IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "initCloudResource IN"); ESResult result = ES_ERROR; @@ -480,7 +480,7 @@ namespace OIC if (result == ES_ERROR) { - OIC_LOG(ERROR,ES_REMOTE_ENROLLEE_TAG, + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_TAG, "Failed to create resource object using discoverResource"); throw ESBadRequestException ("Resource object not created"); } @@ -497,24 +497,24 @@ namespace OIC } } - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "initCloudResource OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "initCloudResource OUT"); } void RemoteEnrollee::provisionCloudProperties(const CloudProp& cloudProp, const CloudPropProvStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties w/o OCResource IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties w/o OCResource IN"); provisionCloudProperties(NULL, cloudProp, callback); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties w/o OCResource OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties w/o OCResource OUT"); } void RemoteEnrollee::provisionCloudProperties(const std::shared_ptr< OC::OCResource > resource, const CloudProp& cloudProp, const CloudPropProvStatusCb callback) { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties IN"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties IN"); if(!callback) { @@ -535,7 +535,7 @@ namespace OIC if(resource->getResourceTypes().at(0) != OC_RSRVD_ES_RES_TYPE_EASYSETUP || resource->connectivityType() & CT_ADAPTER_TCP) { - OIC_LOG (ERROR, ES_REMOTE_ENROLLEE_TAG, "Given resource is not valid due to wrong rt or conntype"); + OIC_LOG(ERROR, ES_REMOTE_ENROLLEE_TAG, "Given resource is not valid due to wrong rt or conntype"); throw ESInvalidParameterException("A given OCResource is wrong"); } @@ -545,11 +545,11 @@ namespace OIC { if(interface.compare(BATCH_INTERFACE) == 0) { - OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_TAG, "RemoteEnrollee object is succeessfully created"); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, "HOST: %s", resource->host().c_str()); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, "URI: %s", resource->uri().c_str()); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, "SID: %s", resource->sid().c_str()); - OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_TAG, "CONNECTIVITY: %d", resource->connectivityType()); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "RemoteEnrollee object is succeessfully created"); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "HOST: %s", resource->host().c_str()); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "URI: %s", resource->uri().c_str()); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "SID: %s", resource->sid().c_str()); + OIC_LOG_V(INFO_PRIVATE, ES_REMOTE_ENROLLEE_TAG, "CONNECTIVITY: %d", resource->connectivityType()); isFound = true; } } @@ -568,7 +568,7 @@ namespace OIC } else { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "Skip to find a provisioning resource"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "Skip to find a provisioning resource"); m_ocResource = resource; m_cloudResource = std::make_shared(m_ocResource); } @@ -607,7 +607,7 @@ namespace OIC } else { - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "ACL and Cert. provisioning are skipped."); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "ACL and Cert. provisioning are skipped."); } #endif //defined(__WITH_DTLS__) && defined(__WITH_TLS__) @@ -624,7 +624,7 @@ namespace OIC m_cloudResource->registerCloudPropProvisioningStatusCallback(cloudPropProvStatusCb); m_cloudResource->provisionProperties(cloudProp); - OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties OUT"); + OIC_LOG(INFO, ES_REMOTE_ENROLLEE_TAG, "provisionCloudProperties OUT"); } } }