1
0
Fork 0
mirror of https://passt.top/passt synced 2025-06-09 17:15:34 +02:00

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>
This commit is contained in:
Stefano Brivio 2022-03-15 00:59:09 +01:00
parent 14c4c0253c
commit d2e40bb8d9
9 changed files with 55 additions and 4 deletions

15
conf.c
View file

@ -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");