summaryrefslogtreecommitdiff
path: root/proto/wireguard/wireguard.h
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2020-01-02 10:32:42 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2020-05-08 18:52:55 +0200
commit96167d9372ff7fc94a4f235a720f935ef6c00ee1 (patch)
tree858f4e7c530a24dc31a81df22ef3a9da91d480e3 /proto/wireguard/wireguard.h
parent0d756ffc1b9e452267383e9486ab42a74cc2dc06 (diff)
Wireguard: Replace log with WG_TRACE
Diffstat (limited to 'proto/wireguard/wireguard.h')
-rw-r--r--proto/wireguard/wireguard.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto/wireguard/wireguard.h b/proto/wireguard/wireguard.h
index e1cce73f..30073869 100644
--- a/proto/wireguard/wireguard.h
+++ b/proto/wireguard/wireguard.h
@@ -4,6 +4,14 @@
#include "nest/protocol.h"
#include "sysdep/linux/wireguard.h"
+#ifdef LOCAL_DEBUG
+#define WG_FORCE_DEBUG 1
+#else
+#define WG_FORCE_DEBUG 0
+#endif
+#define WG_TRACE(flags, msg, args...) do { if ((p->p.debug & flags) || WG_FORCE_DEBUG) \
+ log(L_TRACE "%s: " msg, p->p.name , ## args ); } while(0)
+
struct peer_config {
node n;
const char *public_key;