aboutgitcodebugslistschat
path: root/util.c
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.c
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.c')
-rw-r--r--util.c6
1 files changed, 6 insertions, 0 deletions
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)