reimplement the old mu-log.[ch] into mu-logging.{cc,hh}
If available (and using an appropriately equipped glib), log to the
systemd journal
Only g_criticals have stderr output, all the other g_* go to the log
file / journal.
The previous implementation of `msg-graphs` called `mu:plots/mu:plot` with
output set to `#t` when the option `--text` was passed. This caused an error in
the `string-append` call in `mu:plot` since the expression `(or output "dumb")`
evaluated to the symbol `#t` rather than a string.
This commit fixes this by making sure that `mu:plot` is called with `output` set
to `"dumb"` when the option `--text` is passed to `msg-graphs`, and with
`output` set to `"wxt"` (the default multi-platform graphical output device in
`gnuplot`) otherwise. This is done by essentially making the code of
`msg-graphs` agree with the plotting code in the `guile/scripts` directory.
(mu:for-each-message ...) allows an optional expression to be passed
so that only messages matching that expression are searched when
looking for duplicates.
This patch adds a --expr flag so that e.g.
find-dups.scm --expr d:6m..3m
will reduce the range of messages to those between 3 and 6 months ago
to search for duplicates. I found this useful when using expressions
to find messages in a particular year, rather than searching the whole
database. This is often quicker and less worrying than searching the
whole database.
If --expr is not provided, expr should default to #t so that the whole
database is searched as before.
'find-dups' was trying to call `mu remove' for each duplicate message it
removes. This can be quit slow, so simply delete a file. After dups have
been removed, run `mu index'.
Closes#592
Uses open-pipe* to ensure that escaping isn't needed (seen in md5sum)
since arguments are passed.
Also see this discussion: http://thread.gmane.org/gmane.lisp.guile.user/11777
Experimental feature... be careful.
mu:run-stats expects the passed-in function to take 3 arguments. The
third argument applies to gnuplot only, which is not applicable to the
count function in msgs-count.scm.