From cf1de08457753bdfd13d340f2cfcb3e02998dd67 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 23 Jan 2016 13:41:47 -0800 Subject: [PATCH] commands: support rehashing channel loggers --- plugins/commands.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/commands.py b/plugins/commands.py index 6243914..c97e356 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -197,6 +197,13 @@ def rehash(irc, source, args): ircobj.conf = new_conf ircobj.serverdata = new_conf['servers'][network] ircobj.botdata = new_conf['bot'] + + # Clear the IRC object's channel logger and replace it with a + # new one by re-running logSetup(). + log.removeHandler(ircobj.loghandler) + ircobj.loghandler = None + ircobj.logSetup() + for network, sdata in new_conf['servers'].items(): # New server was added. Connect them if not already connected. if network not in world.networkobjects: