aboutsummaryrefslogtreecommitdiffstats
path: root/api/logger.h
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-10-15 12:21:55 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-10-30 16:51:00 +0100
commit0ad302c11ddae5a8bb6de2c59e908d815f918ab9 (patch)
treea80d3db316ab65a45858d6fa41afd5e928fe2863 /api/logger.h
parentapi: internal reorganization (diff)
downloadwintun-0ad302c11ddae5a8bb6de2c59e908d815f918ab9.tar.xz
wintun-0ad302c11ddae5a8bb6de2c59e908d815f918ab9.zip
api: stop double error status reporting
When an internal function logs an error and its cause, it bloats the log when the caller logs the cause again. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api/logger.h')
-rw-r--r--api/logger.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/logger.h b/api/logger.h
index f795a00..e7e3d35 100644
--- a/api/logger.h
+++ b/api/logger.h
@@ -33,6 +33,6 @@ LoggerLastError(_In_z_ const WCHAR *Prefix)
return Error;
}
-#define LOG(lvl, msg) Logger((lvl), _L(__FUNCTION__) L": " msg)
-#define LOG_ERROR(msg, err) LoggerError(_L(__FUNCTION__) L": " msg, (err))
-#define LOG_LAST_ERROR(msg) LoggerLastError(_L(__FUNCTION__) L": " msg)
+#define LOG(lvl, msg) (Logger((lvl), _L(__FUNCTION__) L": " msg))
+#define LOG_ERROR(msg, err) (LoggerError(_L(__FUNCTION__) L": " msg, (err)))
+#define LOG_LAST_ERROR(msg) (LoggerLastError(_L(__FUNCTION__) L": " msg))