2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
6 * Define PRINT_PREFIX and PRINT_ERR_STREAM, then include this file.
9 #ifndef CTF_BTR_PRINT_H
10 #define CTF_BTR_PRINT_H
14 #define PERR(fmt, ...) \
16 if (PRINT_ERR_STREAM) { \
17 fprintf(PRINT_ERR_STREAM, "Error: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
21 #define PWARN(fmt, ...) \
23 if (PRINT_ERR_STREAM) { \
24 fprintf(PRINT_ERR_STREAM, "Warning: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
28 #define PDBG(fmt, ...) \
30 if (babeltrace_debug) { \
31 fprintf(stderr, "Debug: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
35 #endif /* CTF_BTR_PRINT_H */