aboutsummaryrefslogtreecommitdiffstats
path: root/dftest.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2023-01-09 02:41:07 +0000
committerJoão Valverde <j@v6e.pt>2023-01-09 04:03:19 +0000
commit067bf04446e8132328d34178bcc3b427d15d728e (patch)
treeee1044e0b9ba7aed6943824e5ce17ef570530754 /dftest.c
parent4ec08045aad76e90c798009df8f91354327eb7cc (diff)
dftest: Add a newline to output
Diffstat (limited to 'dftest.c')
-rw-r--r--dftest.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/dftest.c b/dftest.c
index 706b4e7d3d..2a17dfb584 100644
--- a/dftest.c
+++ b/dftest.c
@@ -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;