Redirect system out and error to the console.

@param force Whether to force the redirect
489401
protected void redirectSystemOutAndErr(boolean force) {
        if (force || !(System.out instanceof ConsolePrintStream)) {
            System.setOut(new ConsolePrintStream(out));
        }
        if (force || !(System.err instanceof ConsoleErrorPrintStream)) {
            System.setErr(new ConsoleErrorPrintStream(err));
        }
    }
981339
public void abortScheduling(String requestId, boolean force) {
      if (trace) {
         log.tracef("Request[%s] abort scheduling", requestId);
      }
      ScheduledRequest scheduledRequest = scheduledRequests.get(requestId);
      if (scheduledRequest != null && (scheduledRequest.request.isDone() || force)) {
         scheduledRequest.scheduledFuture.cancel(false);
         scheduledRequests.remove(requestId);
      }
   }
653640
@Override
    public void handle(RequestContext context, AuthenticationException e) throws SecurityProviderException,
            IOException {
        String targetUrl = getTargetUrl();
        if (StringUtils.isNotEmpty(targetUrl)) {
            RedirectUtils.redirect(context.getRequest(), context.getResponse(), targetUrl);
        } else {
            sendError(e, context);
        }
    }
1001643
function(error) {
			if (error) {
				console.error(error.toString());
			}
			process.exit(cfg.ERROR_EXIT);
		}
42362
@Override
    public void sendRedirect(String location) throws IOException {
        if (isCommitted()) {
            throw new IllegalStateException("Response already committed");
        }
        if (null == location) {
            throw new IllegalArgumentException("Location is null");
        }
        resetBuffer();
        this.response.setHeader("Location", convertURItoURL(location.trim()));
        this.response.setStatus(307);
        flushBuffer();
    }
1210967
public static void redirect(HttpServletRequest request, HttpServletResponse response,
                               String url) throws IOException {
        String redirectUrl;

        if (url.startsWith("/")) {
            redirectUrl = request.getContextPath() + url;
        } else {
            redirectUrl = url;
        }

        logger.debug("Redirecting to URL: {}", redirectUrl);

        response.sendRedirect(redirectUrl);
    }
716731
public static void printError (String message, boolean force) {
		if (isDebugEnabled () || force) {
			String toOutput = "log-helper ERROR: " + message.replaceAll ("\n", "\nlog-helper ERROR: ");
			System.err.println (toOutput);
		}
	}
907199
public void redirect(String path) throws IOException
    {
        //response.setHeader("Location", path.charAt(0)=='/' ? path : "/"+path);
        response.sendRedirect(path.charAt(0)=='/' ? path : "/"+path);
        output.close();
    }
1326984
public static void forcedMove (
        ClientObject target, int arg1)
    {
        sendNotification(
            target, LocationDecoder.RECEIVER_CODE, LocationDecoder.FORCED_MOVE,
            new Object[] { Integer.valueOf(arg1) });
    }
494381
function redirectToNext(req, res) {
  var redirectTo = req.session.next || '';
  req.session.next = null; // Null it so that we do not use it again.
  res.redirect(redirectTo);
}
952972
protected function redirectForceSecure()
    {
        if (
            Request::secure() ||
            Request::ajax() ||
            !$this->property('forceSecure')
        ) {
            return;
        }

        return Redirect::secure(Request::path());
    }
994975
public void redirectCall(String connId, String destination) throws WorkspaceApiException {
        this.redirectCall(connId, destination, null, null);
    }
156622
protected void safeSetError(CommandOutput<?, ?, ?> output, ByteBuffer bytes, RedisCommand<?, ?, ?> command) {

        try {
            output.setError(bytes);
        } catch (Exception e) {
            command.completeExceptionally(e);
        }
    }
107505
public void requestFailed (final Exception cause)
    {
        EventQueue.invokeLater(new Runnable() {
            public void run () {
                _target.requestFailed(cause);
            }
        });
    }
673520
public void sendRedirect(String url) 
        throws IOException
    {
        if (url==null)
            throw new IllegalArgumentException();
        
        if (!URI.hasScheme(url))
        {
            StringBuffer buf = _servletHttpRequest.getHttpRequest().getRootURL();
            if (url.startsWith("/"))
                buf.append(URI.canonicalPath(url));
            else
            {
                String path=_servletHttpRequest.getRequestURI();
                String parent=(path.endsWith("/"))?path:URI.parentPath(path);
                url=URI.canonicalPath(URI.addPaths(parent,url));
                if (!url.startsWith("/"))
                    buf.append('/');
                buf.append(url);
            }
            
            url=buf.toString();
        }
        
        resetBuffer();
        
        _httpResponse.setField(HttpFields.__Location,url);
        _httpResponse.setStatus(HttpResponse.__302_Moved_Temporarily);
        complete();
    }
858129
public void flushAllLogs(final boolean force) {
        Iterator<Log> iter = getLogIterator();
        while (iter.hasNext()) {
            Log log = iter.next();
            try {
                boolean needFlush = force;
                if (!needFlush) {
                    long timeSinceLastFlush = System.currentTimeMillis() - log.getLastFlushedTime();
                    Integer logFlushInterval = logFlushIntervalMap.get(log.getTopicName());
                    if (logFlushInterval == null) {
                        logFlushInterval = config.getDefaultFlushIntervalMs();
                    }
                    final String flushLogFormat = "[%s] flush interval %d, last flushed %d, need flush? %s";
                    needFlush = timeSinceLastFlush >= logFlushInterval.intValue();
                    logger.trace(String.format(flushLogFormat, log.getTopicName(), logFlushInterval,
                            log.getLastFlushedTime(), needFlush));
                }
                if (needFlush) {
                    log.flush();
                }
            } catch (IOException ioe) {
                logger.error("Error flushing topic " + log.getTopicName(), ioe);
                logger.error("Halting due to unrecoverable I/O error while flushing logs: " + ioe.getMessage(), ioe);
                Runtime.getRuntime().halt(1);
            } catch (Exception e) {
                logger.error("Error flushing topic " + log.getTopicName(), e);
            }
        }
    }
1059066
def resolve_redirection(self, request, context):
        """"""
        current_page = context['current_page']
        lang = context['lang']
        if current_page.redirect_to_url:
            return HttpResponsePermanentRedirect(current_page.redirect_to_url)

        if current_page.redirect_to:
            return HttpResponsePermanentRedirect(
                current_page.redirect_to.get_url_path(lang))