net.sf.taverna.raven.log
Class Log

java.lang.Object
  extended by net.sf.taverna.raven.log.Log

public class Log
extends java.lang.Object

Log proxy for Raven

Allow Raven to log its internals without worrying about which implementation of the logging framework to use. Logging framework can be switched on the fly by calling Log.setImplementation(LogInterface).

The public interface of this class slightly resembles that of Log4j.Logger. Example usage:

 public class LocalRepository implements Repository {
     private static Log logger = Log.getLogger(LocalRepository.class);
       ..
                      try { 
                                                        ac = new LocalArtifactClassLoader(dep);
                                                        logger.info("Found " + ac);
                                        } catch (MalformedURLException e) {
                                                        logger.error("Malformed URL when loading " + dep, e);
                                                }
 

The default log implementation is JavaLog, which proxies to java.util.logging. For details on how to modify these settings, see JavaLog. Other available implementations are ConsoleLog, which just prints to System.err for everything on level WARN or above, or Log4jLog in the artifact raven-log4j, which depends on log4j being available through the system classloader. For details, see Log4jLog.

Author:
Stian Soiland-Reyes
See Also:
Logging, JavaLog, ConsoleLog, Log4jLog, Log.setImplementation(LogInterface)

Method Summary
 void debug(java.lang.Object msg)
           
 void debug(java.lang.Object msg, java.lang.Throwable ex)
           
 void error(java.lang.Object msg)
           
 void error(java.lang.Object msg, java.lang.Throwable ex)
           
 void fatal(java.lang.Object msg)
           
 void fatal(java.lang.Object msg, java.lang.Throwable ex)
           
static Log getLogger(java.lang.Class c)
           
 void info(java.lang.Object msg)
           
 void info(java.lang.Object msg, java.lang.Throwable ex)
           
 void log(LogInterface.Priority priority, java.lang.Object msg, java.lang.Throwable ex)
           
static void setImplementation(LogInterface implementation)
          Set the implementation
 void warn(java.lang.Object msg)
           
 void warn(java.lang.Object msg, java.lang.Throwable ex)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

public static Log getLogger(java.lang.Class c)

setImplementation

public static void setImplementation(LogInterface implementation)
Set the implementation

Parameters:
implementation -

debug

public void debug(java.lang.Object msg)

debug

public void debug(java.lang.Object msg,
                  java.lang.Throwable ex)

error

public void error(java.lang.Object msg)

error

public void error(java.lang.Object msg,
                  java.lang.Throwable ex)

fatal

public void fatal(java.lang.Object msg)

fatal

public void fatal(java.lang.Object msg,
                  java.lang.Throwable ex)

info

public void info(java.lang.Object msg)

info

public void info(java.lang.Object msg,
                 java.lang.Throwable ex)

log

public void log(LogInterface.Priority priority,
                java.lang.Object msg,
                java.lang.Throwable ex)

warn

public void warn(java.lang.Object msg)

warn

public void warn(java.lang.Object msg,
                 java.lang.Throwable ex)