Control: tag -1 pending

On Mon, 21 Oct 2019 at 00:26:58 +0200, Jonas Smedegaard wrote:
>> I can certainly add an option with a simple printf-like format to 
>> customize the log :-)
> 
> I was thinking something along the lines of printf-like hack, yes.

I took a hammer for this, and added a new option

    log-prefix

    A printf(3)-like format string to use as prefix for each log
    message. Interpreted sequences are %n and %m, expanding respectively
    to the component name (local/remote) and to the name of the mailbox
    relevant for the log entry. Conditions on a specifier %X can be
    obtained with %?X?then? or %?X?then&else?, which expands to ‘then’
    if the %X specifier expands to a non-empty string, and to ‘else’ (or
    the empty string if there is no else branch) otherwise. Literal %
    need to be escaped as %%, while &, ? and \ characters need to be
    \\-escaped.  (Default: %?n?%?m?%n(%m)&%n?: ?.)

It's quite overkill, but was also the occasion to refactor the logging
code :-)

-- 
Guilhem.

Attachment: signature.asc
Description: PGP signature

Reply via email to