mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Add stripFormatting option (default True)
This commit is contained in:
parent
52ee0919db
commit
84a7026367
@ -57,6 +57,10 @@ 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.registerGlobalValue(conf.supybot.plugins.ChannelLogger,
|
||||||
|
'stripFormatting', registry.Boolean(True, """Determines whether
|
||||||
|
formatting characters (such as bolding, color, etc.) are removed when
|
||||||
|
writing the logs to disk."""))
|
||||||
conf.registerChannelValue(conf.supybot.plugins.ChannelLogger, 'timestamp',
|
conf.registerChannelValue(conf.supybot.plugins.ChannelLogger, 'timestamp',
|
||||||
registry.Boolean(True, """Determines whether the logs for this channel are
|
registry.Boolean(True, """Determines whether the logs for this channel are
|
||||||
timestamped with the timestamp in supybot.log.timestampFormat."""))
|
timestamped with the timestamp in supybot.log.timestampFormat."""))
|
||||||
@ -191,6 +195,8 @@ class ChannelLogger(callbacks.Privmsg):
|
|||||||
log = self.getLog(channel)
|
log = self.getLog(channel)
|
||||||
if self.registryValue('timestamp', channel):
|
if self.registryValue('timestamp', channel):
|
||||||
self.timestamp(log)
|
self.timestamp(log)
|
||||||
|
if self.registryValue('stripFormatting', channel):
|
||||||
|
s = ircutils.stripFormatting(s)
|
||||||
log.write(s)
|
log.write(s)
|
||||||
if self.registryValue('flushImmediately'):
|
if self.registryValue('flushImmediately'):
|
||||||
log.flush()
|
log.flush()
|
||||||
|
Loading…
Reference in New Issue
Block a user