log plugin compile errors

This commit is contained in:
Luke Rogers 2013-10-11 11:21:18 +13:00
parent b6c20d7dca
commit ed2eefb9cd

View file

@ -64,8 +64,8 @@ class PluginLoader(object):
namespace = {} namespace = {}
eval(code, namespace) eval(code, namespace)
except Exception: except Exception:
# plugin has errors, print them! self.bot.logger.error("Error compiling {}.".format(filename))
traceback.print_exc() self.bot.logger.error(traceback.format_exc())
return return
# remove plugins already loaded from this file # remove plugins already loaded from this file
@ -103,7 +103,7 @@ class PluginLoader(object):
filename = os.path.basename(path) filename = os.path.basename(path)
self.bot.logger.info("Unloading plugins from: {}".format(filename)) self.bot.logger.info("Unloading plugins from: {}".format(filename))
# remove plugins from the plugin list if they are from this file # remove plugins loaded from this file
for plugin_type, plugins in self.bot.plugins.iteritems(): for plugin_type, plugins in self.bot.plugins.iteritems():
self.bot.plugins[plugin_type] = [x for x in plugins if x[0]._filename != filename] self.bot.plugins[plugin_type] = [x for x in plugins if x[0]._filename != filename]