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.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'util.c') diff --git a/util.c b/util.c index 90b5ab8..50b83db 100644 --- a/util.c +++ b/util.c @@ -45,6 +45,7 @@ static int log_sock = -1; static char log_ident[BUFSIZ]; static int log_opt; static time_t log_debug_start; +int log_trace; #define logfn(name, level) \ void name(const char *format, ...) { \ @@ -77,6 +78,11 @@ logfn(warn, LOG_WARNING) logfn(info, LOG_INFO) logfn(debug, LOG_DEBUG) +void trace_init(int enable) +{ + log_trace = enable; +} + /** * __openlog() - Non-optional openlog() wrapper, to allow custom vsyslog() * @ident: openlog() identity (program name) -- cgit v1.2.3