-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.h
31 lines (23 loc) · 839 Bytes
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-FileCopyrightText: The vmnet-helper authors
// SPDX-License-Identifier: Apache-2.0
#ifndef LOG_H
#define LOG_H
#include <stdbool.h>
extern bool verbose;
#define DEBUG(msg) \
do { \
if (verbose) \
fprintf(stderr, "DEBUG " msg "\n"); \
} while (0)
#define INFO(msg) fprintf(stderr, "INFO " msg "\n")
#define WARN(msg) fprintf(stderr, "WARN " msg "\n")
#define ERROR(msg) fprintf(stderr, "ERROR " msg "\n")
#define DEBUGF(fmt, ...) \
do { \
if (verbose) \
fprintf(stderr, "DEBUG " fmt "\n", __VA_ARGS__); \
} while (0)
#define INFOF(fmt, ...) fprintf(stderr, "INFO " fmt "\n", __VA_ARGS__)
#define WARNF(fmt, ...) fprintf(stderr, "WARN " fmt "\n", __VA_ARGS__)
#define ERRORF(fmt, ...) fprintf(stderr, "ERROR " fmt "\n", __VA_ARGS__)
#endif // LOG_H