summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-10-07 18:40:37 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-10-07 18:40:37 +0000
commitfaf2a19de0badaba9327ce1cd05c6a586d85a121 (patch)
tree4b6691d8151275529b4d5f92736af1212cfd97c4 /lib/command_match.c
parent943624d733950fa7ff53715b44e274b387f15dbd (diff)
lib: Improve formatting for matcher tracing output
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index ac6a6c813a..e25bca2db8 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -192,8 +192,10 @@ command_match_r (struct graph_node *start, vector vline, unsigned int n)
char *input_token = vector_slot (vline, n);
#ifdef TRACE_MATCHER
- fprintf (stdout, "\"%s\" matches \"%s\" (%d) ? ", input_token, token->text, token->type);
- switch (match_token (token, input_token))
+ fprintf (stdout, "\"%-20s\" matches \"%-30s\" ? ", input_token, token->text);
+ enum match_type mt = match_token (token, input_token);
+ fprintf (stdout, "min: %d - ", minmatch);
+ switch (mt)
{
case trivial_match:
fprintf (stdout, "trivial_match ");
@@ -208,7 +210,8 @@ command_match_r (struct graph_node *start, vector vline, unsigned int n)
fprintf (stdout, "exact_match ");
break;
}
- fprintf (stdout, "(minimum: %d)\n", minmatch);
+ if (mt >= minmatch) fprintf (stdout, " MATCH");
+ fprintf (stdout, "\n");
#endif
// if we don't match this node, die