// -------- Functions -------- /// <summary> /// Initializes the plugin. /// </summary> /// <param name="pluginInit">The class that has information required for initing the plugin.</param> public void Init(PluginInitor initor) { string pluginDir = Path.Combine( initor.ChaskisConfigPluginRoot, "IrcLogger" ); string configPath = Path.Combine( pluginDir, "IrcLoggerConfig.xml" ); this.config = XmlLoader.LoadIrcLoggerConfig( configPath ); if (string.IsNullOrEmpty(config.LogFileLocation)) { config.LogFileLocation = Path.Combine(pluginDir, "Logs"); } if (string.IsNullOrEmpty(config.LogName)) { config.LogName = "irclog"; } this.logManager = new LogManager(config, initor.Log); AllHandlerConfig allHandlerConfig = new AllHandlerConfig { AllAction = this.HandleLogEvent }; AllHandler handler = new AllHandler( allHandlerConfig ); this.handlers.Add(handler); }