uk.ac.ed.inf.utils
Class LogUtils

java.lang.Object
  extended by uk.ac.ed.inf.utils.LogUtils

public class LogUtils
extends java.lang.Object

Utilities to log error messages

Version:
27 Feb 2009
Author:
Luna De Ferrari luna.deferrari-at-ed.ac.uk

Constructor Summary
LogUtils()
           
 
Method Summary
static java.lang.String error(java.lang.Object o)
           
static void error(java.lang.Object o, java.lang.String text)
           
static java.lang.String error(java.lang.String s)
           
static java.lang.String log(java.lang.Object o)
           
static void log(java.lang.Object o, java.lang.String text)
           
static void logAndPrint(java.io.File logFile, java.lang.String text)
          Logs some text to file AND prints it to screen.
static void redirectStdErr(java.io.File file)
          Redirect stderr to file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogUtils

public LogUtils()
Method Detail

error

public static java.lang.String error(java.lang.Object o)

error

public static void error(java.lang.Object o,
                         java.lang.String text)

error

public static java.lang.String error(java.lang.String s)

log

public static java.lang.String log(java.lang.Object o)

log

public static void log(java.lang.Object o,
                       java.lang.String text)

logAndPrint

public static void logAndPrint(java.io.File logFile,
                               java.lang.String text)
Logs some text to file AND prints it to screen. If the file is null, it prints to screen only.

Parameters:
logFile - the log file (can be null)
text - the message to be logged

redirectStdErr

public static void redirectStdErr(java.io.File file)
Redirect stderr to file