Browse Source

refactor(server): Move UA_LOG_NODEID_WRAP to /src/ua_util_internal.h

Julius Pfrommer 4 years ago
parent
commit
f896432586
2 changed files with 8 additions and 7 deletions
  1. 0 7
      src/server/ua_services_nodemanagement.c
  2. 8 0
      src/ua_util_internal.h

+ 0 - 7
src/server/ua_services_nodemanagement.c

@@ -19,13 +19,6 @@
 #include "ua_server_internal.h"
 #include "ua_services.h"
 
-#define UA_LOG_NODEID_WRAP(NODEID, LOG) {   \
-    UA_String nodeIdStr = UA_STRING_NULL;   \
-    UA_NodeId_toString(NODEID, &nodeIdStr); \
-    LOG;                                    \
-    UA_String_deleteMembers(&nodeIdStr);    \
-}
-
 /*********************/
 /* Edit Node Context */
 /*********************/

+ 8 - 0
src/ua_util_internal.h

@@ -23,6 +23,14 @@ _UA_BEGIN_DECLS
 /* Macro-Expand for MSVC workarounds */
 #define UA_MACRO_EXPAND(x) x
 
+/* Print a NodeId in logs */
+#define UA_LOG_NODEID_WRAP(NODEID, LOG) {   \
+    UA_String nodeIdStr = UA_STRING_NULL;   \
+    UA_NodeId_toString(NODEID, &nodeIdStr); \
+    LOG;                                    \
+    UA_String_clear(&nodeIdStr);            \
+}
+
 /* Integer Shortnames
  * ------------------
  * These are not exposed on the public API, since many user-applications make