Changes between Version 15 and Version 16 of IrcLogsPlugin

Jul 21, 2009, 4:58:34 AM (5 years ago)



  • IrcLogsPlugin

    v15 v16  
    6666'''Note:''' In order to enable indexing for 0.11, you'll currently need a patch, see comment:ticket:1183:6.
     68== Configuration beta ==
     70=== Quick Config ===
     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.
     76irclogs.* = enabled
     79channel = #trac
     80basepath = /var/logs/supybot/irclogs
     83=== Verbose Config ===
     85Here is an example with a lot more options set.
     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
     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.''
     106=== DB Config ===
     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.
     112provider = db
     113database = sqlite:/var/lib/gozerbot/.gozerbot/chatlog.db
     114channel = #trac
     115timezone = America/New_York
     118=== Multi Channel Config ===
     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.
     123[irclogs] = #dunkbots
     125channel.gozer.format = gozer
     126channel.gozer.timezone = America/New_York
     127channel.gozer.navbutton = gozerbot irc logs = IrcNet
     129channel.gozer.provider = file
     132=== Adding New File Formats ===
     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).:
     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
    68157== Wiki Macros 0.11 ==