public static ShellLogHandler getLogHandler(Map<String, Object> topoConf) { if (topoConf == null) { throw new IllegalArgumentException("Config is required"); } String logHandlerClassName = null; if (topoConf.containsKey(Config.TOPOLOGY_MULTILANG_LOG_HANDLER)) { try { logHandlerClassName = topoConf.get(Config.TOPOLOGY_MULTILANG_LOG_HANDLER).toString(); return (ShellLogHandler) Class.forName(logHandlerClassName).newInstance(); } catch (ClassCastException | InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException("Error loading ShellLogHandler " + logHandlerClassName, e); } } return new DefaultShellLogHandler(); }
@Before public void setUp() { logHandler = new DefaultShellLogHandler(); }
public static ShellLogHandler getLogHandler(Map stormConf) { if (stormConf == null) { throw new IllegalArgumentException("Config is required"); } String logHandlerClassName = null; if (stormConf.containsKey(Config.TOPOLOGY_MULTILANG_LOG_HANDLER)) { try { logHandlerClassName = stormConf.get(Config.TOPOLOGY_MULTILANG_LOG_HANDLER).toString(); return (ShellLogHandler) Class.forName(logHandlerClassName).newInstance(); } catch (ClassCastException | InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException("Error loading ShellLogHandler " + logHandlerClassName, e); } } return new DefaultShellLogHandler(); } }