try { System.out.println("Redirecting output to MegaMek.log"); PrintStream ps = new PrintStream(new BufferedOutputStream( new FileOutputStream("MegaMek.log"))); System.setOut(ps); System.setErr(ps); } catch (Exception e) { System.err.println("Unable to redirect output to log"); e.printStackTrace(); }
    public static void main(String[] args) {        Settings.load();        for (int i = 0; i < args.length; i++) {            if (args[i].equals("-testdice")) {                testDice();                return;            }            if (args[i].equals("-dedicated")) {                new Server(Settings.lastServerPass, Settings.lastServerPort);                return;            }        }                Frame frame = new Frame("MegaMek");        MegaMek mm = new MegaMek(frame);    }