mirror of https://github.com/Mikaela/Limnoria.git
Added timestamp configuration variable.
This commit is contained in:
parent
057563540f
commit
ea8c7ddf77
|
@ -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
|
* Updated ChannelLogger not to log messages starting with
|
||||||
[nolog], in order to allow private information to remain private.
|
[nolog], in order to allow private information to remain private.
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,9 @@ conf.registerGlobalValue(conf.supybot.plugins.ChannelLogger,
|
||||||
'flushImmediately', registry.Boolean(False, """Determines whether channel
|
'flushImmediately', registry.Boolean(False, """Determines whether channel
|
||||||
logfiles will be flushed anytime they're written to, rather than being
|
logfiles will be flushed anytime they're written to, rather than being
|
||||||
buffered by the operating system."""))
|
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',
|
conf.registerChannelValue(conf.supybot.plugins.ChannelLogger, 'noLogPrefix',
|
||||||
registry.String('[nolog]', """Determines what string a message should be
|
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
|
prefixed with in order not to be logged. If you don't want any such
|
||||||
|
@ -118,6 +121,7 @@ class ChannelLogger(callbacks.Privmsg):
|
||||||
|
|
||||||
def doLog(self, channel, s):
|
def doLog(self, channel, s):
|
||||||
log = self.getLog(channel)
|
log = self.getLog(channel)
|
||||||
|
if self.registryValue('timestamp', channel):
|
||||||
self.timestamp(log)
|
self.timestamp(log)
|
||||||
log.write(s)
|
log.write(s)
|
||||||
if self.registryValue('flushImmediately'):
|
if self.registryValue('flushImmediately'):
|
||||||
|
|
Loading…
Reference in New Issue