diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-11-09 14:38:44 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-11-09 14:40:49 +0200 |
commit | 67eb1f4c05ec5fafec7ec7745575a8213734f134 (patch) | |
tree | 68a490c2d2dae0f9d079fc81a10c203fc01cc5ef | |
parent | 08204cb140768a2963a90c6a20ddb9c6da95695f (diff) | |
download | mailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.gz mailfromd-67eb1f4c05ec5fafec7ec7745575a8213734f134.tar.bz2 |
Document debug categories. Fix improper use of decimal constants instead of MU_DEBUG_TRACE identifiers
-rw-r--r-- | doc/mailfromd.texi | 55 | ||||
-rw-r--r-- | src/builtin/io.bi | 16 | ||||
-rw-r--r-- | src/builtin/mbox.bi | 2 | ||||
-rw-r--r-- | src/builtin/other.bi | 2 | ||||
-rw-r--r-- | src/builtin/sa.bi | 2 |
5 files changed, 61 insertions, 16 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 74dedfdc..2e075699 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -3395,3 +3395,3 @@ whether it is appropriate to print its diagnostics and informational messages on standard error or to send them to syslog. Standard error -is assumed if the program is run with any of the following command +is assumed if the program is run with one of the following command line options: @@ -3607,8 +3607,6 @@ List records being removed. @table @asis -@item trace0 -Verbose information about failed DNS queries. -@item trace2 -Verbosely list retrieved MXs @item trace8 Verbose information about attempted DNS queries and their results. +@item trace9 +Enables @samp{libadns} internal debugging. @end table @@ -3706,2 +3704,49 @@ Explicitly list A records obtained when processing the @samp{a} SPF mechanism. +Categories starting with @samp{bi_} debug built-in modules: + +@table @asis +@item bi_db +Database functions. +@table @asis +@item trace5 +List database look-ups. +@item trace6 +Trace operations on the greylisting database. +@end table + +@item bi_sa +SpamAssassin and ClamAV API. +@table @asis +@item trace1 +Report the findings of the @samp{clamav} function. +@item trace9 +Trace payload in interactions with @samp{spamd}. +@end table + +@item bi_io +I/O functions. +@table @asis +@item trace1 +Debug the following functions: @code{open}, @code{spawn}, @code{write}. +@item trace2 +Report stderr redirection. +@item trace3 +Report external commands being run. +@end table + +@item bi_mbox +Mailbox functions. +@table @asis +@item trace1 +Report opened mailboxes. +@end table + +@item bi_other +Other built-ins. +@table @asis +@item trace1 +Report results of checks for existence of usernames. +@end table +@end table + For example, the following invocation enables levels up to diff --git a/src/builtin/io.bi b/src/builtin/io.bi index d1512ad8..3e84bb52 100644 --- a/src/builtin/io.bi +++ b/src/builtin/io.bi @@ -179,3 +179,3 @@ stderr_to_log(char *arg, const char *cmd) } - MF_DEBUG(10, + MF_DEBUG(MU_DEBUG_TRACE2, ("redirecting stderr to syslog %s.%s", @@ -233,3 +233,3 @@ stderr_handler(int mode, char *arg, const char *cmd) } - MF_DEBUG(10, ("redirecting stderr to %s", arg)); + MF_DEBUG(MU_DEBUG_TRACE2, ("redirecting stderr to %s", arg)); fd = open(arg, O_CREAT|O_WRONLY|append, 0644); @@ -363,3 +363,3 @@ open_program_stream_ioe(eval_environ_t env, - MF_DEBUG(10, ("running %s", cmdline)); + MF_DEBUG(MU_DEBUG_TRACE3, ("running %s", cmdline)); if (mu_wordsplit(cmdline, &ws, @@ -718,3 +718,3 @@ MF_DEFUN(open, NUMBER, STRING name) - MF_DEBUG(10, ("opening stream %s", name)); + MF_DEBUG(MU_DEBUG_TRACE1, ("opening stream %s", name)); iotab[i].name = mu_strdup(name); @@ -756,3 +756,3 @@ MF_DEFUN(open, NUMBER, STRING name) mu_strerror(rc)); - MF_DEBUG(10, ("open(%s) = %d", name, i)); + MF_DEBUG(MU_DEBUG_TRACE1, ("open(%s) = %d", name, i)); MF_RETURN(i); @@ -777,3 +777,3 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL, - MF_DEBUG(10, ("spawning %s", name)); + MF_DEBUG(MU_DEBUG_TRACE1, ("spawning %s", name)); iotab[i].name = mu_strdup(name); @@ -814,3 +814,3 @@ MF_DEFUN(spawn, NUMBER, STRING name, OPTIONAL, mu_strerror(rc)); - MF_DEBUG(10, ("spawn(%s) = %d", name, i)); + MF_DEBUG(MU_DEBUG_TRACE1, ("spawn(%s) = %d", name, i)); MF_RETURN(i); @@ -924,3 +924,3 @@ MF_DEFUN(write, VOID, NUMBER fd, STRING str, OPTIONAL, NUMBER n) - MF_DEBUG(10, ("writing %s to %lu", str, fd)); + MF_DEBUG(MU_DEBUG_TRACE1, ("writing %s to %lu", str, fd)); MF_ASSERT(fd >= 0 && fd < nstreams && OFD(iotab[fd]) != -1, diff --git a/src/builtin/mbox.bi b/src/builtin/mbox.bi index df4f3ec2..27f74628 100644 --- a/src/builtin/mbox.bi +++ b/src/builtin/mbox.bi @@ -91,3 +91,3 @@ MF_DEFUN(mailbox_open, NUMBER, STRING url, OPTIONAL, STRING mode, STRING perms) _("no more mailboxes available")); - MF_DEBUG(10, ("opening mailbox %s", url)); + MF_DEBUG(MU_DEBUG_TRACE1, ("opening mailbox %s", url)); mp = mbtab + md; diff --git a/src/builtin/other.bi b/src/builtin/other.bi index 5063885e..bdb21b00 100644 --- a/src/builtin/other.bi +++ b/src/builtin/other.bi @@ -50,3 +50,3 @@ valid_user_p(eval_environ_t env, const char *name) - MF_DEBUG(10, + MF_DEBUG(MU_DEBUG_TRACE1, ("Checking user %s: %s", name, rc ? "true" : "false")); diff --git a/src/builtin/sa.bi b/src/builtin/sa.bi index fd3fa0b7..6225829f 100644 --- a/src/builtin/sa.bi +++ b/src/builtin/sa.bi @@ -576,3 +576,3 @@ MF_DEFUN(clamav, NUMBER, NUMBER nmsg, STRING urlstr) - MF_DEBUG(2, + MF_DEBUG(MU_DEBUG_TRACE1, ("%sclamav found %s", |