net.sf.taverna.raven.log
Class ConsoleLog

java.lang.Object
  extended by net.sf.taverna.raven.log.ConsoleLog
All Implemented Interfaces:
LogInterface

public class ConsoleLog
extends java.lang.Object
implements LogInterface

Implementation of LogInterface for simple System.err based printouts. To use this implementation, do:

 Log.setImplementation(new ConsoleLog());
 

This is a very simple implementation, that by default only logs messages at WARN or higher. This threshold can be changed by setting the level member. The destination output can be changed by setting the console member. Stack traces will be printed by default if provided, but this can be disabled by setting printStackTrace to false

Author:
Stian Soiland-Reyes

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.taverna.raven.log.LogInterface
LogInterface.Priority
 
Field Summary
static java.io.PrintStream console
          Where to print log messages.
static LogInterface.Priority level
          Minimum level to log, ie.
 boolean printStackTrace
          Whether to print stacktraces if a Throwable was given with the log message.
 
Constructor Summary
ConsoleLog()
           
ConsoleLog(java.lang.Class c)
           
 
Method Summary
 LogInterface getLogger(java.lang.Class c)
           
 void log(LogInterface.Priority p, java.lang.Object msg, java.lang.Throwable ex)
          Log a message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

public static LogInterface.Priority level
Minimum level to log, ie. messages with lover priority will be discarded. By default set to Priority.WARN.


console

public static java.io.PrintStream console
Where to print log messages. By default set to System.err.


printStackTrace

public boolean printStackTrace
Whether to print stacktraces if a Throwable was given with the log message. By default set to true.

Constructor Detail

ConsoleLog

public ConsoleLog()

ConsoleLog

public ConsoleLog(java.lang.Class c)
Method Detail

getLogger

public LogInterface getLogger(java.lang.Class c)
Specified by:
getLogger in interface LogInterface

log

public void log(LogInterface.Priority p,
                java.lang.Object msg,
                java.lang.Throwable ex)
Description copied from interface: LogInterface
Log a message.

Specified by:
log in interface LogInterface
Parameters:
p - Priority
msg - Message
ex - Exception