From ce469b0851a97a8f53bb03e51fa36fcba34977b3 Mon Sep 17 00:00:00 2001 From: James Vega Date: Mon, 19 Jan 2009 21:13:18 +0000 Subject: [PATCH] ChannelLogger: Allow logging to be disabled on specific channels --- plugins/ChannelLogger/config.py | 3 +++ plugins/ChannelLogger/plugin.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugins/ChannelLogger/config.py b/plugins/ChannelLogger/config.py index a0390e870..c06a05107 100644 --- a/plugins/ChannelLogger/config.py +++ b/plugins/ChannelLogger/config.py @@ -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 diff --git a/plugins/ChannelLogger/plugin.py b/plugins/ChannelLogger/plugin.py index 6ee7ede53..719e306cc 100644 --- a/plugins/ChannelLogger/plugin.py +++ b/plugins/ChannelLogger/plugin.py @@ -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)