From ea8c7ddf770bab07abaad2ca5560b9492a1826fc Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 24 Mar 2004 23:10:55 +0000 Subject: [PATCH] Added timestamp configuration variable. --- ChangeLog | 4 ++++ plugins/ChannelLogger.py | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d59dc10a3..e32ecf61b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ + * Added a configuration variable to ChannelLogger, timestamp, + which determines whether the bot will timestamp its logfiles. + This is a channel-specific variable, of course. + * Updated ChannelLogger not to log messages starting with [nolog], in order to allow private information to remain private. diff --git a/plugins/ChannelLogger.py b/plugins/ChannelLogger.py index 1b9e3c6da..3f22e60f6 100644 --- a/plugins/ChannelLogger.py +++ b/plugins/ChannelLogger.py @@ -54,6 +54,9 @@ conf.registerGlobalValue(conf.supybot.plugins.ChannelLogger, 'flushImmediately', registry.Boolean(False, """Determines whether channel logfiles will be flushed anytime they're written to, rather than being buffered by the operating system.""")) +conf.registerChannelValue(conf.supybot.plugins.ChannelLogger, 'timestamp', + registry.Boolean(True, """Determines whether the logs for this channel are + timestamped with the timestamp in supybot.log.timestampFormat.""")) conf.registerChannelValue(conf.supybot.plugins.ChannelLogger, 'noLogPrefix', registry.String('[nolog]', """Determines what string a message should be prefixed with in order not to be logged. If you don't want any such @@ -118,7 +121,8 @@ class ChannelLogger(callbacks.Privmsg): def doLog(self, channel, s): log = self.getLog(channel) - self.timestamp(log) + if self.registryValue('timestamp', channel): + self.timestamp(log) log.write(s) if self.registryValue('flushImmediately'): log.flush()