diff options
author | João Valverde <j@v6e.pt> | 2023-01-09 02:41:07 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-01-09 04:03:19 +0000 |
commit | 067bf04446e8132328d34178bcc3b427d15d728e (patch) | |
tree | ee1044e0b9ba7aed6943824e5ce17ef570530754 /dftest.c | |
parent | 4ec08045aad76e90c798009df8f91354327eb7cc (diff) |
dftest: Add a newline to output
Diffstat (limited to 'dftest.c')
-rw-r--r-- | dftest.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -41,7 +41,10 @@ #include "ui/version_info.h" static int opt_verbose = 0; -static int opt_noisy = 0; +#define DFTEST_LOG_NONE 0 +#define DFTEST_LOG_DEBUG 1 +#define DFTEST_LOG_NOISY 2 +static int opt_log_level = DFTEST_LOG_NONE; static int opt_flex = 0; static int opt_lemon = 0; static int opt_syntax_tree = 0; @@ -252,7 +255,7 @@ main(int argc, char **argv) opt_verbose = 1; break; case 'd': - opt_noisy = 1; + opt_log_level = DFTEST_LOG_NOISY; break; case 'f': opt_flex = 1; @@ -302,10 +305,14 @@ main(int argc, char **argv) print_usage(EXIT_FAILURE); } - if (opt_noisy) + if (opt_log_level == DFTEST_LOG_NOISY) { ws_log_set_noisy_filter(LOG_DOMAIN_DFILTER); - else if (opt_flex || opt_lemon) + } + else if (opt_flex || opt_lemon) { + /* Enable some dfilter logs with flex/lemon traces for context. */ ws_log_set_debug_filter(LOG_DOMAIN_DFILTER); + opt_log_level = DFTEST_LOG_DEBUG; + } /* * Get credential information for later use. @@ -396,6 +403,11 @@ main(int argc, char **argv) goto out; } + /* If logging is enabled add an empty line. */ + if (opt_log_level > DFTEST_LOG_NONE) { + printf("\n"); + } + if (df == NULL) { printf("Filter is empty.\n"); exit_status = 1; |