Changes between Version 15 and Version 16 of IrcLogsPlugin


Ignore:
Timestamp:
Jul 21, 2009, 2:58:34 AM (15 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IrcLogsPlugin

    v15 v16  
    6565
    6666'''Note:''' In order to enable indexing for 0.11, you'll currently need a patch, see comment:ticket:1183:6.
     67
     68== Configuration beta ==
     69
     70=== Quick Config ===
     71
     72It is extremely simple to setup irclogs with supy bot.  Just make sure the user running the trac process has access to the log files.
     73
     74{{{
     75[components]
     76irclogs.* = enabled
     77
     78[irclogs]
     79channel = #trac
     80basepath = /var/logs/supybot/irclogs
     81}}}
     82
     83=== Verbose Config ===
     84
     85Here is an example with a lot more options set.
     86
     87{{{
     88[irclogs]
     89channel = #trac
     90network = FreeNode
     91basepath = /var/log/supybot/irclogs
     92# ConfigParser braindamage workaround, see below
     93# path is what we are trying to set.
     94dateform = %%Y-%%m-%%d
     95paths = %%(channel)s/%%(channel)s-%(dateform)s.log
     96# done braindamage.
     97navbutton = trac irc logs
     98format = supy  # gozer is also supported out of the box.
     99hidden_users = billy-joe, mac
     100provider = file
     101timezone = UTC
     102}}}
     103
     104''There is a bug in ConfigParser that causes string interpolation, even though parameters are excaped, it in values with %%(named)s variables and date format (%%Y.. etc) variables.  We require this functionality in the path option, so we have to split it into two variables to work around the issue.  Normally the path default is fine and shouldn't be overridden, but if the need arises, this workaround will be needed.''
     105
     106=== DB Config ===
     107
     108The database should take a standard trac db connection string.  If none is specified, then the trac db will be used as the default.  The database must contain a table with the following columns (time, network, target, nick, type, message).  It is suggested that indexes are put on the time, (network, target) sets.  target is usually the channel name.
     109
     110{{{
     111[irclogs]
     112provider = db
     113database = sqlite:/var/lib/gozerbot/.gozerbot/chatlog.db
     114channel = #trac
     115timezone = America/New_York
     116}}}
     117
     118=== Multi Channel Config ===
     119
     120IrcLogPlugin now supports mutliple channels.  Simple setup new channel options with the channel.$channel-name prefix.  channel-name can be anything you like.  Each channel will 'inherit' any unspecified options from the 'default' set of options.
     121
     122{{{
     123[irclogs]
     124channel.gozer.channel = #dunkbots
     125channel.gozer.format = gozer
     126channel.gozer.timezone = America/New_York
     127channel.gozer.navbutton = gozerbot irc logs
     128channel.gozer.network = IrcNet
     129channel.gozer.provider = file
     130}}}
     131
     132=== Adding New File Formats ===
     133
     134The simplest way is to create a ticket and let me do it ;).  But any help is much appreciated.  A file format basically consists of file paths, regexes to parse lines, and order to try regexes in.  match_order is the order the regexes will be matched in.  The first part of the name will be matched to match_order.  the match order value will also be used as the type.  It is possible to add new types by having new regexes, but make sure there is a message positional regex group or things could go haywire.  The timestamp regex is seperate for convenience.  The timestamp format is used to parse the timestamp into a datetime.  Here is an example for gozer (already provided by default).:
     135
     136{{{
     137format.gozer.basepath = /var/lib/gozerbot/.gozerbot/logs/
     138# the workaround again :P
     139gozerdate = %%Y%%m%%d
     140format.gozer.path = %%(network)s/simple/%%(channel)s.%(gozerdate).log
     141format.gozer.timestamp_format = %%Y%%m%%d %%H%%M%%S
     142format.gozer.timezone = utc
     143format.gozer.timestamp_regex = (?P<timestamp>\d{4}-\d{2}-\d{2}.\d{2}:\d{2}:\d{2})
     144format.gozer.comment_regex = ^%%(timestamp_regex)s[ |:]*(?P<message><(?P<nick>[^>]+)>\s(?P<comment>.*))$
     145format.gozer.action_regex  = ^%%(timestamp_regex)s[ |:]*(?P<message>\*\s(?P<nick>[^ ]+)\s(?P<action>.*))$
     146format.gozer.join_regex    = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<nick>[^ ]+)\shas\sjoined.*)$
     147format.gozer.part_regex    = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<nick>[^ ]+).*\shas\sleft.*)$
     148format.gozer.quit_regex    = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<nick>[^ ]+).*\shas\squit.*)$
     149format.gozer.kick_regex    = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<kicked>[^ ]+)\swas\skicked\sby\s(?P<nick>[^ ]+).*)$
     150format.gozer.mode_regex    = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<nick>[^ ]+)\ssets\smode:\s(?P<mode>.+))$
     151format.gozer.topic_regex   = ^%%(timestamp_regex)s[ |:]*(?P<message>\*{0,3}\s(?P<nick>[^ ]+)\schanges\stopic\sto\s"?(?P<topic>.+)"?)$
     152format.gozer.nick_regex    = ^%%(timestamp_regex)s[ |:]*s(?P<message>\*{3}\s(?P<nick>.*)\s.*now\sknown\sas(?P<newnick>.*))$
     153format.gozer.notice_regex  = ^%%(timestamp_regex)s[ |:]*s(?P<message>-(?P<nick>.*)-\s(?P<notice>.*))$
     154format.gozer.match_order   = comment part join quit action kick mode topic nick notice
     155}}}
    67156
    68157== Wiki Macros 0.11 ==