Re-format new 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>
91d81473 13#include "common/macros.h"
e98a2d6e 14
4164020e
SM
15#define PERR(fmt, ...) \
16 do { \
17 if (PRINT_ERR_STREAM) { \
18 fprintf(PRINT_ERR_STREAM, "Error: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
19 } \
20 } while (0)
e98a2d6e 21
4164020e
SM
22#define PWARN(fmt, ...) \
23 do { \
24 if (PRINT_ERR_STREAM) { \
25 fprintf(PRINT_ERR_STREAM, "Warning: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
26 } \
27 } while (0)
e98a2d6e 28
4164020e
SM
29#define PDBG(fmt, ...) \
30 do { \
31 if (babeltrace_debug) { \
32 fprintf(stderr, "Debug: " PRINT_PREFIX ": " fmt, ##__VA_ARGS__); \
33 } \
34 } while (0)
e98a2d6e
PP
35
36#endif /* CTF_BTR_PRINT_H */
This page took 0.09135 seconds and 4 git commands to generate.