pl.edu.agh.cast.util.logging
Class LoggingUtil

java.lang.Object
  extended by pl.edu.agh.cast.util.logging.LoggingUtil

public final class LoggingUtil
extends Object

Utility methods for logger management.

Author:
AGH CAST Team

Constructor Summary
LoggingUtil()
           
 
Method Summary
static PrintStream rebindStdErr(org.apache.log4j.Logger logger)
          Re-binds System.err to given logger.
static PrintStream rebindStdOut(org.apache.log4j.Logger logger)
          Re-binds System.out to given logger.
static void rebindStdOutErr(File file)
          Re-binds System.out and System.err to given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingUtil

public LoggingUtil()
Method Detail

rebindStdOut

public static PrintStream rebindStdOut(org.apache.log4j.Logger logger)
Re-binds System.out to given logger.

Parameters:
logger - the logger to bind standard output to
Returns:
the original standard output writer

rebindStdErr

public static PrintStream rebindStdErr(org.apache.log4j.Logger logger)
Re-binds System.err to given logger.

Parameters:
logger - the logger to bind standard error to
Returns:
the original standard error writer

rebindStdOutErr

public static void rebindStdOutErr(File file)
Re-binds System.out and System.err to given file.

Parameters:
file - file to use for standard output and error streams


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.