private LogLevel parseLogLevel(String[] args) { if (args.length < 4) { return LogLevel.WARN; } else { try { return LogLevel.valueOf(args[3]); } catch (LogLevelFormatException e) { throw new IllegalArgumentException("'" + args[3] + "' is not a valid log level."); } } }
/** Open logging window. */ public void showLogs() { Logger rootLogger = Logger.getRootLogger(); LF5Appender lf5Appender = (LF5Appender) rootLogger.getAppender("LF5Appender"); if (lf5Appender == null) { logBrokerMonitor = new LogBrokerMonitor(LogLevel.getLog4JLevels()) { @Override protected void closeAfterConfirm() { hide(); } }; lf5Appender = new LF5Appender(logBrokerMonitor); lf5Appender.setName("LF5Appender"); rootLogger.addAppender(lf5Appender); } lf5Appender.getLogBrokerMonitor().show(); }