protected static LoggerPlugin getDelegatePlugin(String name) { LoggerPlugin plugin = null; try { plugin = (LoggerPlugin) pluginClass.newInstance(); } catch (Throwable e) { plugin = new NullLoggerPlugin(); } try { plugin.init(name); } catch(Throwable e) { System.err.println("Failed to initalize plugin: "+plugin); plugin = new NullLoggerPlugin(); } return plugin; }
/** * Get the delegate plugin * * @param name the name of the logger * @return the plugin */ protected static LoggerPlugin getDelegatePlugin(String name) { LoggerPlugin plugin = null; try { plugin = (LoggerPlugin) pluginClass.newInstance(); } catch (Throwable e) { plugin = new NullLoggerPlugin(); } try { plugin.init(name); } catch (Throwable e) { String extraInfo = e.getMessage(); System.err.println("Failed to initalize plugin: " + plugin + (extraInfo != null ? ", cause: " + extraInfo : "")); plugin = new NullLoggerPlugin(); } return plugin; }