Changed colorized to color to be consistent with other plugins.

This commit is contained in:
Jeremy Fincher 2004-08-21 07:35:45 +00:00
parent 0e9a7a7057
commit 5bb43126a6

View File

@ -114,7 +114,7 @@ class IrcFormatter(log.Formatter):
class ColorizedIrcFormatter(IrcFormatter): class ColorizedIrcFormatter(IrcFormatter):
def formatException(self, (E, e, tb)): def formatException(self, (E, e, tb)):
if conf.supybot.plugins.LogToIrc.colorized(): if conf.supybot.plugins.LogToIrc.color():
s = IrcFormatter.formatException(self, (E, e, tb)) s = IrcFormatter.formatException(self, (E, e, tb))
return ircutils.mircColor(s, fg='red') return ircutils.mircColor(s, fg='red')
else: else:
@ -122,7 +122,7 @@ class ColorizedIrcFormatter(IrcFormatter):
def format(self, record, *args, **kwargs): def format(self, record, *args, **kwargs):
s = IrcFormatter.format(self, record, *args, **kwargs) s = IrcFormatter.format(self, record, *args, **kwargs)
if conf.supybot.plugins.LogToIrc.colorized(): if conf.supybot.plugins.LogToIrc.color():
if record.levelno == logging.CRITICAL: if record.levelno == logging.CRITICAL:
s = ircutils.bold(ircutils.bold(s)) s = ircutils.bold(ircutils.bold(s))
elif record.levelno == logging.ERROR: elif record.levelno == logging.ERROR:
@ -171,9 +171,9 @@ conf.registerGlobalValue(conf.supybot.plugins.LogToIrc,
'userCapabilityRequired', registry.String('owner', """Determines what 'userCapabilityRequired', registry.String('owner', """Determines what
capability is required for the bot to log to in private messages to the capability is required for the bot to log to in private messages to the
user. If this is empty, there will be no capability that's checked.""")) user. If this is empty, there will be no capability that's checked."""))
conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'colorized', conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'color',
registry.Boolean(False, """Determines whether the bot's logs registry.Boolean(False, """Determines whether the bot's logs to IRC will be
to IRC will be colorized with mIRC colors.""")) colorized with mIRC colors."""))
conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'notice', conf.registerGlobalValue(conf.supybot.plugins.LogToIrc, 'notice',
registry.Boolean(False, """Determines whether the bot's logs to IRC will be registry.Boolean(False, """Determines whether the bot's logs to IRC will be
sent via NOTICE instead of PRIVMSG. Channels will always be PRIVMSGed, sent via NOTICE instead of PRIVMSG. Channels will always be PRIVMSGed,
@ -196,7 +196,7 @@ def configure(advanced):
output(str(e)) output(str(e))
targets = '' targets = ''
colorized = yn('Would you like these messages to be colored?') colorized = yn('Would you like these messages to be colored?')
conf.supybot.plugins.LogToIrc.colorized.setValue(colorized) conf.supybot.plugins.LogToIrc.color.setValue(colorized)
if advanced: if advanced:
level = '' level = ''
while not level: while not level: