mirror of
https://github.com/upa/mscp.git
synced 2026-02-19 04:55:44 +08:00
wrap print progress in pprint
This commit is contained in:
14
src/util.h
14
src/util.h
@@ -8,20 +8,6 @@
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
extern int verbose;
|
||||
|
||||
#define pr_v(level, fmt, ...) do { \
|
||||
if (verbose >= level) { \
|
||||
fprintf(stdout, "\x1b[1m\x1b[34m" \
|
||||
"%s(): \x1b[0m" fmt, \
|
||||
__func__, ##__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define pr_v1(fmt, ...) pr_v(1, fmt, ##__VA_ARGS__)
|
||||
#define pr_v2(fmt, ...) pr_v(2, fmt, ##__VA_ARGS__)
|
||||
#define pr_v3(fmt, ...) pr_v(3, fmt, ##__VA_ARGS__)
|
||||
|
||||
|
||||
#define pr(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user