aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2019-04-08 12:08:18 +0200
committerLinus Nordberg <linus@nordberg.se>2019-04-08 12:08:18 +0200
commit8d0f62201ab88389df459ca4745fc5336e42ddcc (patch)
tree66c0d91962847276abb8fab9649a597cebb74751
parentAddress three issues from review by Tharre (diff)
downloadwg-dynamic-8d0f62201ab88389df459ca4745fc5336e42ddcc.tar.xz
wg-dynamic-8d0f62201ab88389df459ca4745fc5336e42ddcc.zip
Correct logic in log_warn, log_info
-rw-r--r--dbg.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/dbg.h b/dbg.h
index fae583a..fa55ee9 100644
--- a/dbg.h
+++ b/dbg.h
@@ -29,9 +29,8 @@ extern int DBG_LVL;
#define SUFFIX(S, M, ...) M S, __VA_ARGS__
#define log_err(...) fprintf(stderr, PREFIX(__VA_ARGS__))
-/* FIXME: This looks backwards -- DBG_LVL=2 gives info but not warn. */
-#define log_warn(...) do { if (DBG_LVL > 2) log_err(__VA_ARGS__); } while (0)
-#define log_info(...) do { if (DBG_LVL > 1) log_err(__VA_ARGS__); } while (0)
+#define log_warn(...) do { if (DBG_LVL > 1) log_err(__VA_ARGS__); } while (0)
+#define log_info(...) do { if (DBG_LVL > 2) log_err(__VA_ARGS__); } while (0)
#define die(...) \
do { \
log_err(__VA_ARGS__); \