Class RedirectConsole

java.lang.Object
gov.usgs.util.logging.RedirectConsole

public class RedirectConsole extends Object
Console redirection utility. Replaces system.out and system.err with printstreams that log all writes when flushed.
  • Constructor Details

    • RedirectConsole

      public RedirectConsole()
  • Method Details

    • redirect

      public static void redirect()
      Redirect System.out and System.err to java.util.logging.Logger objects. System.out is redirected to logger "system.out". System.err is redirected to logger "system.err". Use the cancel method to undo this redirection.
    • cancel

      public static void cancel()
      Undo a redirection previously setup using redirect(). Restores System.out and System.err to their state before redirect was called.