mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
ChannelLogger: Allow logging to be disabled on specific channels
This commit is contained in:
parent
125e24ceda
commit
ce469b0851
@ -1,5 +1,6 @@
|
||||
###
|
||||
# Copyright (c) 2005, Jeremiah Fincher
|
||||
# Copyright (c) 2009, James Vega
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -39,6 +40,8 @@ def configure(advanced):
|
||||
conf.registerPlugin('ChannelLogger', True)
|
||||
|
||||
ChannelLogger = conf.registerPlugin('ChannelLogger')
|
||||
conf.registerChannelValue(ChannelLogger, 'enable',
|
||||
registry.Boolean(True, """Determines whether logging is enabled."""))
|
||||
conf.registerGlobalValue(ChannelLogger, 'flushImmediately',
|
||||
registry.Boolean(False, """Determines whether channel logfiles will be
|
||||
flushed anytime they're written to, rather than being buffered by the
|
||||
|
@ -1,5 +1,6 @@
|
||||
###
|
||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
||||
# Copyright (c) 2009, James Vega
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@ -162,6 +163,8 @@ class ChannelLogger(callbacks.Plugin):
|
||||
return ircutils.toLower(channel)
|
||||
|
||||
def doLog(self, irc, channel, s, *args):
|
||||
if not self.registryValue('enable', channel):
|
||||
return
|
||||
s = format(s, *args)
|
||||
channel = self.normalizeChannel(irc, channel)
|
||||
log = self.getLog(irc, channel)
|
||||
|
Loading…
Reference in New Issue
Block a user