summaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-20 14:55:54 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-20 14:55:54 +0200
commit77f9be38d7469eefb0fac3adf43261b4d84315d2 (patch)
tree70c42ec4864e850e15b0c31b9493646ead42a05b /main.h
parente11014c0443ea687ad65a14b9124aa366da7984a (diff)
Make logging messages consistent in adding a newline for all messages
Diffstat (limited to 'main.h')
-rw-r--r--main.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/main.h b/main.h
index 7d14118..9d50bc8 100644
--- a/main.h
+++ b/main.h
@@ -42,11 +42,12 @@ void __debug(enum debug_lvl lvl, const char *fmt, ...) __attribute__((format(pri
#define __ifdebug(lvl, fmt, ...) \
do { \
if (debug_enabled((lvl))) \
- __debug((lvl), fmt __VA_OPT__(,) __VA_ARGS__); \
+ __debug((lvl), fmt "\n"__VA_OPT__(,) __VA_ARGS__); \
} while (0)
-#define debug(lvl, fmt, ...) __ifdebug((lvl), "%s:%i: " fmt, __func__, \
- __LINE__ __VA_OPT__(,) __VA_ARGS__)
+#define debug(lvl, fmt, ...) __ifdebug((lvl), "%s:%s:%i: " fmt, \
+ __func__, __FILE__, __LINE__ \
+ __VA_OPT__(,) __VA_ARGS__)
#define verbose(fmt, ...) __ifdebug(DBG_VERBOSE, fmt, __VA_ARGS__)
#define info(fmt, ...) __ifdebug(DBG_INFO, fmt, __VA_ARGS__)
#define error(fmt, ...) __ifdebug(DBG_ERROR, "%s: " fmt, \
@@ -56,8 +57,6 @@ void __die(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
#define die(fmt, ...) __die("%s:%i: " fmt "\n", __func__, \
__LINE__ __VA_OPT__(,) __VA_ARGS__)
-#define perrordie(fmt, ...) __die("%s:%i: " fmt ": %m\n", __func__, \
- __LINE__ __VA_OPT__(,) __VA_ARGS__)
struct uring_task;