Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / lib / trace-ir / field-wrapper.c
index 86949fe131845a65f9d74885b105c4a76357ecb3..a570a2a3ae2ce863edbd55ac1e5e3047ae83de18 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 #define BT_LOG_TAG "LIB/FIELD-WRAPPER"
-#include "lib/lib-logging.h"
+#include "lib/logging.h"
 
 #include "lib/object-pool.h"
 #include "lib/object.h"
@@ -39,7 +39,8 @@ struct bt_field_wrapper *bt_field_wrapper_new(void *data)
        BT_LOGD_STR("Creating empty field wrapper object.");
 
        if (!field_wrapper) {
-               BT_LOGE("Failed to allocate one field wrapper.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one field wrapper.");
                goto end;
        }
 
@@ -72,11 +73,12 @@ struct bt_field_wrapper *bt_field_wrapper_create(
 {
        struct bt_field_wrapper *field_wrapper = NULL;
 
-       BT_ASSERT(pool);
-       BT_ASSERT(fc);
+       BT_ASSERT_DBG(pool);
+       BT_ASSERT_DBG(fc);
        field_wrapper = bt_object_pool_create_object(pool);
        if (!field_wrapper) {
-               BT_LIB_LOGE("Cannot allocate one field wrapper from field wrapper pool: "
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Cannot allocate one field wrapper from field wrapper pool: "
                        "%![pool-]+o", pool);
                goto error;
        }
@@ -84,7 +86,8 @@ struct bt_field_wrapper *bt_field_wrapper_create(
        if (!field_wrapper->field) {
                field_wrapper->field = (void *) bt_field_create(fc);
                if (!field_wrapper->field) {
-                       BT_LIB_LOGE("Cannot create field wrapper from field class: "
+                       BT_LIB_LOGE_APPEND_CAUSE(
+                               "Cannot create field wrapper from field class: "
                                "%![fc-]+F", fc);
                        goto error;
                }
This page took 0.025401 seconds and 4 git commands to generate.