lib/ctf-ir/utils.c: add logging
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 16 May 2017 04:09:06 +0000 (00:09 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:43 +0000 (12:57 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/ctf-ir/utils.c

index c83b50d9916376968ad546b8d8eabfbb28b50011..0ab0df2464c72df45ecb898f886c5c8522824b89 100644 (file)
@@ -26,6 +26,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "CTF-IR-UTILS"
+#include <babeltrace/lib-logging-internal.h>
+
 #include <string.h>
 #include <stdlib.h>
 #include <glib.h>
@@ -79,13 +82,20 @@ int bt_ctf_validate_identifier(const char *input_string)
        char *string = NULL;
        char *save_ptr, *token;
 
-       if (!input_string || input_string[0] == '\0') {
+       if (!input_string) {
+               BT_LOGV_STR("Invalid parameter: input string is NULL.");
+               ret = -1;
+               goto end;
+       }
+
+       if (input_string[0] == '\0') {
                ret = -1;
                goto end;
        }
 
        string = strdup(input_string);
        if (!string) {
+               BT_LOGE("strdup() failed.");
                ret = -1;
                goto end;
        }
This page took 0.025553 seconds and 4 git commands to generate.