diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-03-15 00:59:09 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-03-25 13:21:13 +0100 |
commit | d2e40bb8d98763e33c3eeac4f5f1b7c53465009f (patch) | |
tree | f2eb7812c96b418bbfe93dfc238afd466b78a946 /conf.c | |
parent | 14c4c0253c51506caddb380c65fd56e0cf1060ab (diff) | |
download | passt-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 'conf.c')
-rw-r--r-- | conf.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -558,6 +558,7 @@ static void usage(const char *name) info(""); info( " -d, --debug Be verbose, don't run in background"); + info( " --trace Be extra verbose, implies --debug"); info( " -q, --quiet Don't print informational messages"); info( " -f, --foreground Don't run in background"); info( " default: run in background if started from a TTY"); @@ -829,6 +830,7 @@ void conf(struct ctx *c, int argc, char **argv) {"no-dhcp-search", no_argument, NULL, 8 }, {"dns-forward", required_argument, NULL, 9 }, {"no-netns-quit", no_argument, NULL, 10 }, + {"trace", no_argument, NULL, 11 }, { 0 }, }; struct get_bound_ports_ns_arg ns_ports_arg = { .c = c }; @@ -960,6 +962,19 @@ void conf(struct ctx *c, int argc, char **argv) } c->no_netns_quit = 1; break; + case 11: + if (c->trace) { + err("Multiple --trace options given"); + usage(argv[0]); + } + + if (c->quiet) { + err("Either --trace or --quiet"); + usage(argv[0]); + } + + c->trace = c->debug = c->foreground = 1; + break; case 'd': if (c->debug) { err("Multiple --debug options given"); |