From a1a165c48c5422d9b302a6abec51e706f7cda934 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Mon, 19 Apr 2021 23:57:14 +0200 Subject: [HICN-699] facemgr: cleaner logs for face interaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic0c941812f758868498e4d087e237047f91d452b Signed-off-by: Jordan Augé --- .../facemgr/src/interfaces/hicn_light/hicn_light.c | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c') diff --git a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c index 74a0cd62b..b6e0e605a 100644 --- a/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c +++ b/ctrl/facemgr/src/interfaces/hicn_light/hicn_light.c @@ -327,13 +327,12 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) switch(facelet_get_event(facelet)) { case FACELET_EVENT_CREATE: - - /* Create face */ { + /* Create face */ char buf[MAXSZ_FACELET]; facelet_snprintf(buf, MAXSZ_FACELET, facelet); DEBUG("Create facelet %s", buf); - } + hc_face.face = *face; rc = hc_face_create(data->s, &hc_face); if (rc < 0) { @@ -341,7 +340,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) ret = -FACELET_ERROR_REASON_UNSPECIFIED_ERROR; goto ERR; } - INFO("Created face id=%d", hc_face.id); + INFO("Created face id=%d - %s", hc_face.id, buf); + } hicn_route_t ** route_array; int n = facelet_get_route_array(facelet, &route_array); @@ -413,7 +413,6 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) case FACELET_EVENT_DELETE: /* Removing a face should also remove associated routes */ - /* Create face */ hc_face.face = *face; rc = hc_face_delete(data->s, &hc_face); if (rc < 0) { @@ -421,6 +420,11 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) ret = -FACELET_ERROR_REASON_UNSPECIFIED_ERROR; goto ERR; } + + char buf[MAXSZ_FACELET]; + facelet_snprintf(buf, MAXSZ_FACELET, facelet); + INFO("Deleted face id=%d", hc_face.id); + break; case FACELET_EVENT_UPDATE: @@ -457,7 +461,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_admin_state_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Admin state updated"); + INFO("Updated face id=%d - admin_state=%s", hc_face.id, + face_state_str[admin_state]); } #ifdef WITH_POLICY if (facelet_get_netdevice_type_status(facelet) == FACELET_ATTR_STATUS_DIRTY) { @@ -517,7 +522,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_netdevice_type_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Tags updated"); + INFO("Updated face id=%d - netdevice_type=%s", hc_face.id, + netdevice_type_str[netdevice_type]); } if (facelet_get_priority_status(facelet) == FACELET_ATTR_STATUS_DIRTY) { INFO("Updating priority..."); @@ -549,7 +555,8 @@ int hl_on_event(interface_t * interface, facelet_t * facelet) goto ERR; } facelet_set_priority_status(facelet, FACELET_ATTR_STATUS_CLEAN); - INFO("Priority updated"); + + INFO("Updated face id=%d - priority=%d", hc_face.id, priority); } #endif /* WITH_POLICY */ break; -- cgit 1.2.3-korg