Sort includes in C++ files
[babeltrace.git] / src / plugins / ctf / common / print.hpp
CommitLineData
e98a2d6e 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
e98a2d6e
PP
3 *
4 * Copyright (c) 2016 Philippe Proulx <pproulx@efficios.com>
5 *
0235b0db 6 * Define PRINT_PREFIX and PRINT_ERR_STREAM, then include this file.
e98a2d6e
PP
7 */
8
0235b0db
MJ
9#ifndef CTF_BTR_PRINT_H
10#define CTF_BTR_PRINT_H
11
e98a2d6e 12#include <stdio.h>
c802cacb 13
91d81473 14#include "common/macros.h"
e98a2d6e 15
4164020e
SM
16#define PERR(fmt, ...) \
17 do { \
18 if (PRINT_ERR_STREAM) { \
19 fprintf(PRINT_ERR_STREAM, "Error: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
20 } \
21 } while (0)
e98a2d6e 22
4164020e
SM
23#define PWARN(fmt, ...) \
24 do { \
25 if (PRINT_ERR_STREAM) { \
26 fprintf(PRINT_ERR_STREAM, "Warning: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
27 } \
28 } while (0)
e98a2d6e 29
4164020e
SM
30#define PDBG(fmt, ...) \
31 do { \
32 if (babeltrace_debug) { \
33 fprintf(stderr, "Debug: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
34 } \
35 } while (0)
e98a2d6e
PP
36
37#endif /* CTF_BTR_PRINT_H */
This page took 0.094049 seconds and 4 git commands to generate.