From d2e40bb8d98763e33c3eeac4f5f1b7c53465009f Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 15 Mar 2022 00:59:09 +0100 Subject: 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 --- util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util.h') 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 -- cgit v1.2.3