summaryrefslogtreecommitdiff
path: root/libmu_sieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-11-24 15:25:07 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-11-24 15:25:07 +0200
commit05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0 (patch)
tree0ed8642e5ffb858ba12f1b01dfa3db1934fd4230 /libmu_sieve
parenta4c1a0e88bdeb8372ae66e27da4009a49b0f8009 (diff)
downloadmailutils-05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0.tar.gz
mailutils-05df35d07a46f70e7d09a4da39fdd2d7a7d58ed0.tar.bz2
sieve: simplify action logging API
* include/mailutils/sieve.h (mu_sieve_action_log_t): Change proto. * lib/sieve.c (_sieve_action_log): Rewrite. * libmu_sieve/util.c (mu_sieve_log_action): Rewrite. * python/libmu_py/sieve.c (_sieve_action_printer): Rewrite. * sieve/sieve.c (_sieve_action_log): Rewrite.
Diffstat (limited to 'libmu_sieve')
-rw-r--r--libmu_sieve/util.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/libmu_sieve/util.c b/libmu_sieve/util.c
index b2011e2d1..8b437c7d3 100644
--- a/libmu_sieve/util.c
+++ b/libmu_sieve/util.c
@@ -344,16 +344,11 @@ mu_sieve_log_action (mu_sieve_machine_t mach, const char *action,
if (!mach->logger)
return;
+
+ mu_stream_ioctl (mach->errstream, MU_IOCTL_LOGSTREAM,
+ MU_IOCTL_LOGSTREAM_SET_LOCUS, &mach->locus);
va_start (ap, fmt);
- mu_stream_printf (mach->errstream, "\033s<%d>", MU_LOG_INFO);
- if (mach->locus.mu_file)
- mu_stream_printf (mach->errstream, "\033O<%d>\033f<%u>%s\033l<%u>",
- MU_LOGMODE_LOCUS,
- (unsigned) strlen (mach->locus.mu_file),
- mach->locus.mu_file,
- mach->locus.mu_line);
- mach->logger (mach->data, mach->errstream, mach->msgno, mach->msg,
- action, fmt, ap);
+ mach->logger (mach, action, fmt, ap);
va_end (ap);
}

Return to:

Send suggestions and report system problems to the System administrator.