mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-27 05:21:09 -05: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) 2005, Jeremiah Fincher
|
||||||
|
# Copyright (c) 2009, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -39,6 +40,8 @@ def configure(advanced):
|
|||||||
conf.registerPlugin('ChannelLogger', True)
|
conf.registerPlugin('ChannelLogger', True)
|
||||||
|
|
||||||
ChannelLogger = conf.registerPlugin('ChannelLogger')
|
ChannelLogger = conf.registerPlugin('ChannelLogger')
|
||||||
|
conf.registerChannelValue(ChannelLogger, 'enable',
|
||||||
|
registry.Boolean(True, """Determines whether logging is enabled."""))
|
||||||
conf.registerGlobalValue(ChannelLogger, 'flushImmediately',
|
conf.registerGlobalValue(ChannelLogger, 'flushImmediately',
|
||||||
registry.Boolean(False, """Determines whether channel logfiles will be
|
registry.Boolean(False, """Determines whether channel logfiles will be
|
||||||
flushed anytime they're written to, rather than being buffered by the
|
flushed anytime they're written to, rather than being buffered by the
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2002-2004, Jeremiah Fincher
|
# Copyright (c) 2002-2004, Jeremiah Fincher
|
||||||
|
# Copyright (c) 2009, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -162,6 +163,8 @@ class ChannelLogger(callbacks.Plugin):
|
|||||||
return ircutils.toLower(channel)
|
return ircutils.toLower(channel)
|
||||||
|
|
||||||
def doLog(self, irc, channel, s, *args):
|
def doLog(self, irc, channel, s, *args):
|
||||||
|
if not self.registryValue('enable', channel):
|
||||||
|
return
|
||||||
s = format(s, *args)
|
s = format(s, *args)
|
||||||
channel = self.normalizeChannel(irc, channel)
|
channel = self.normalizeChannel(irc, channel)
|
||||||
log = self.getLog(irc, channel)
|
log = self.getLog(irc, channel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user