Improve debug parser and output functions.
New parser accepts range specifications (mailbox.trace3-prot). mu_debug_format_spec outputs specs in the canonical form. * include/mailutils/debug.h (MU_DEBUG_LEVEL_RANGE): New macro. (mu_debug_set_category_level): Change return type to int. (mu_debug_get_category_level): New proto. * libmailutils/diag/debug.c (mu_debug_set_category_level): Change return type to int. (mu_debug_get_category_level): New function. (mu_debug_level_from_string): New function. (parse_spec): Accept range specification. Negation at the start of spec implies 'proto'. (mu_debug_format_spec): Rewrite. * libmailutils/tests/debugspec.c: New file. * libmailutils/tests/debugspec.at: New file. * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add debugspec. (TESTSUITE_AT): add debugspec.at * libmailutils/tests/testsuite.at: Include debugspec.at. * libmailutils/tests/.gitignore: Add debugspec. * sieve/sieve.c: Do not advertise 'T' and 'P' arguments to --debug. (debug_level): Remove. (set_debug_level): Rewrite the handling of legacy debug specifiers 'TP'.
Showing
8 changed files
with
318 additions
and
46 deletions
libmailutils/tests/debugspec.at
0 → 100644
libmailutils/tests/debugspec.c
0 → 100644
-
Please register or sign in to post a comment