#define BT_COMP_LOG_SELF_COMP (file->self_comp)
#define BT_LOG_OUTPUT_LEVEL (file->log_level)
#define BT_LOG_TAG "PLUGIN/SRC.CTF.FS/FILE"
-#include "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <stdio.h>
#include <sys/types.h>
BT_COMP_LOGI("Opening file \"%s\" with mode \"%s\"", file->path->str, mode);
file->fp = fopen(file->path->str, mode);
if (!file->fp) {
- BT_COMP_LOGE("Cannot open file \"%s\" with mode \"%s\": %s",
- file->path->str, mode, strerror(errno));
+ BT_COMP_LOGE_APPEND_CAUSE_ERRNO(file->self_comp,
+ "Cannot open file", ": path=%s, mode=%s",
+ file->path->str, mode);
goto error;
}
BT_COMP_LOGI("Opened file: %p", file->fp);
if (fstat(fileno(file->fp), &stat)) {
- BT_COMP_LOGE("Cannot get file information: %s", strerror(errno));
+ BT_COMP_LOGE_APPEND_CAUSE_ERRNO(file->self_comp,
+ "Cannot get file information",
+ ": path=%s", file->path->str);
goto error;
}