private void redirectOutputStreams() {
        //Redirect standard output
        OutputStream redirectedStdOutput = new OutputStream() {
            @Override
            public void write(final int b) throws IOException {
                updateTextPane(String.valueOf((char) b));
            }

            @Override
            public void write(byte[] b, int off, int len) throws IOException {
                updateTextPane(new String(b, off, len));
            }

            @Override
            public void write(byte[] b) throws IOException {
                write(b, 0, b.length);
            }
            
            private void updateTextPane(final String text) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        Document doc = GlobalDialogs.consoleDialogLogPane.getDocument();
                        try {
                            SimpleAttributeSet sas = new SimpleAttributeSet();
                            if (text.contains("[Moddle]")) {
                                StyleConstants.setForeground(sas, Color.CYAN.darker().darker());
                            } else if (text.contains("INFO")) {
                                StyleConstants.setForeground(sas, Color.BLACK);
                            } else if (text.contains("WARNING")) {
                                StyleConstants.setForeground(sas, Color.ORANGE.darker());
                            } else if (text.contains("SEVERE")) {
                                StyleConstants.setForeground(sas, Color.RED.darker().darker());
                            } else {
                                StyleConstants.setForeground(sas, Color.CYAN.darker().darker().darker());
                            }
                            doc.insertString(doc.getLength(), text, sas);
                        } catch (BadLocationException e) {
                            throw new RuntimeException(e);
                        }
                        GlobalDialogs.consoleDialogLogPane.setCaretPosition(doc.getLength() - 1);
                    }
                });
            }
        };
        System.setOut(new PrintStream(redirectedStdOutput, true));
        
        //Redirect standard error
        OutputStream redirectedStdError = new OutputStream() {
            @Override
            public void write(final int b) throws IOException {
                updateTextPane(String.valueOf((char) b));
            }

            @Override
            public void write(byte[] b, int off, int len) throws IOException {
                updateTextPane(new String(b, off, len));
            }

            @Override
            public void write(byte[] b) throws IOException {
                write(b, 0, b.length);
            }
            
            private void updateTextPane(final String text) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        Document doc = GlobalDialogs.consoleDialogLogPane.getDocument();
                        try {
                            SimpleAttributeSet sas = new SimpleAttributeSet();
                            StyleConstants.setForeground(sas, Color.RED.darker());
                            doc.insertString(doc.getLength(), text, sas);
                        } catch (BadLocationException e) {
                            throw new RuntimeException(e);
                        }
                        GlobalDialogs.consoleDialogLogPane.setCaretPosition(doc.getLength() - 1);
                    }
                });
            }
        };
        System.setErr(new PrintStream(redirectedStdOutput, true));
    }