WeeChat DevCenter

Date in log filenames

It is now possible to use date formaters in log filenames (in mask options).

For example to have log by year and month in separate directories, you can do :

/set logger.file.mask "%Y/%m/$plugin.$name.weechatlog"

You'll have a tree like that:

~/.weechat/
    |- logs/
        |- 2009/
            |- 12/
                |  irc.server.freenode.weechatlog
                |  irc.freenode.#weechat.weechatlog
        |- 2010/
            |- 01/
                |  irc.server.freenode.weechatlog
                |  irc.freenode.#weechat.weechatlog

Comments

1. On Tuesday, February 2 2010, 19:21 by drubin

I thought I would add this comment since it confused me a little at first and I was one of the requesters of this feature.

Because I don't like filenames like the static $plugin.$name. FlashCode was good enough to add logger.mask.$plugin configuration option that allows each plugin to override the default options.

So I have logger.mask.irc = "$server/$channel/%Y.%m.log" << Woohoo how cool is it that you can use irc properties in the logger.mask.irc config option!

2. On Friday, February 12 2010, 03:45 by dan

set logger '$server/$channel/%Y-%m.log'

is creating a file named '%y-%m.log' ie. date format strings dont seem to be parsing correctly using the ubuntu deb downloads.

3. On Friday, February 12 2010, 07:46 by FlashCode

This feature is available only in version 0.3.2-dev (future 0.3.2), and not in 0.3.1 or older versions.