-/* Error printing wrappers */
-#define _PERROR(_fmt, ...) \
- do { \
- if (!ctx->efd) break; \
- fprintf(ctx->efd, "[error] %s: " _fmt "\n", \
- __func__, __VA_ARGS__); \
- } while (0)
-
-#define _PWARNING(_fmt, ...) \
- do { \
- if (!ctx->efd) break; \
- fprintf(ctx->efd, "[warning] %s: " _fmt "\n", \
- __func__, __VA_ARGS__); \
- } while (0)
-
-#define _FPERROR(_stream, _fmt, ...) \
- do { \
- if (!_stream) break; \
- fprintf(_stream, "[error] %s: " _fmt "\n", \
- __func__, __VA_ARGS__); \
- } while (0)
-
-#define _FPWARNING(_stream, _fmt, ...) \
- do { \
- if (!_stream) break; \
- fprintf(_stream, "[warning] %s: " _fmt "\n", \
- __func__, __VA_ARGS__); \
- } while (0)
-
-#define _PERROR_DUP_ATTR(_attr, _entity) \
- do { \
- if (!ctx->efd) break; \
- fprintf(ctx->efd, \
- "[error] %s: duplicate attribute \"" \
- _attr "\" in " _entity "\n", __func__); \
- } while (0)
+#define _BT_LOGE_DUP_ATTR(_node, _attr, _entity) \
+ _BT_LOGE_LINENO((_node)->lineno, \
+ "Duplicate attribute in %s: attr-name=\"%s\"", \
+ _entity, _attr)
+
+#define _BT_LOGE_NODE(_node, _msg, args...) \
+ _BT_LOGE_LINENO((_node)->lineno, _msg, ## args)
+
+#define _BT_LOGW_NODE(_node, _msg, args...) \
+ _BT_LOGW_LINENO((_node)->lineno, _msg, ## args)
+
+#define _BT_LOGV_NODE(_node, _msg, args...) \
+ _BT_LOGV_LINENO((_node)->lineno, _msg, ## args)