aboutgitcodebugslistschat
path: root/util.h
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-03-15 00:59:09 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-03-25 13:21:13 +0100
commitd2e40bb8d98763e33c3eeac4f5f1b7c53465009f (patch)
treef2eb7812c96b418bbfe93dfc238afd466b78a946 /util.h
parent14c4c0253c51506caddb380c65fd56e0cf1060ab (diff)
downloadpasst-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar.gz
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar.bz2
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar.lz
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar.xz
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.tar.zst
passt-d2e40bb8d98763e33c3eeac4f5f1b7c53465009f.zip
conf, util, tap: Implement --trace option for extra verbose logging
--debug can be a bit too noisy, especially as single packets or socket messages are logged: implement a new option, --trace, implying --debug, that enables all debug messages. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.h b/util.h
index b7852e9..bfab221 100644
--- a/util.h
+++ b/util.h
@@ -8,6 +8,14 @@ void warn(const char *format, ...);
void info(const char *format, ...);
void debug(const char *format, ...);
+extern int log_trace;
+void trace_init(int enable);
+#define trace(format, ...) \
+ do { \
+ if (log_trace) \
+ debug(format, ##__VA_ARGS__); \
+ } while (0)
+
#ifndef SECCOMP_RET_KILL_PROCESS
#define SECCOMP_RET_KILL_PROCESS SECCOMP_RET_KILL
#endif