Package gov.usgs.util.logging
Class RedirectConsole
- java.lang.Object
-
- gov.usgs.util.logging.RedirectConsole
-
public class RedirectConsole extends java.lang.Object
Console redirection utility. Replaces system.out and system.err with printstreams that log all writes when flushed.
-
-
Constructor Summary
Constructors Constructor Description RedirectConsole()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
cancel()
Undo a redirection previously setup using redirect().static void
redirect()
Redirect System.out and System.err to java.util.logging.Logger objects.
-
-
-
Method Detail
-
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.
-
-