org.directwebremoting.util
Class Logger

java.lang.Object
  extended by org.directwebremoting.util.Logger

public final class Logger
extends java.lang.Object

A very quick and dirty logging implementation. java.util.logging is out because we work with JDK 1.3 and we don't want to force users to import log4j or commons-logging. Don't use this outside of DWR - it's just a quick hack to keep things simple.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Method Summary
 void debug(java.lang.String message)
          Logger a debug message
 void error(java.lang.String message)
          Logger an error message
 void error(java.lang.String message, java.lang.Throwable th)
          Logger an error message
 void fatal(java.lang.String message)
          Logger a fatal error message
 void fatal(java.lang.String message, java.lang.Throwable th)
          Logger a fatal error message
static Logger getLogger(java.lang.Class<?> base)
           
 void info(java.lang.String message)
          Logger an info message
 boolean isDebugEnabled()
          Save CPU time when we are not debugging
static void setDefaultImplementation(java.lang.Class<? extends LoggingOutput> defaultImplementation)
           
 void warn(java.lang.String message)
          Logger a warning message
 void warn(java.lang.String message, java.lang.Throwable th)
          Logger a warning message
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

public static Logger getLogger(java.lang.Class<?> base)
Parameters:
base - The class to log against
Returns:
A new logger

setDefaultImplementation

public static void setDefaultImplementation(java.lang.Class<? extends LoggingOutput> defaultImplementation)
Parameters:
defaultImplementation - the defaultImplementation to set

debug

public void debug(java.lang.String message)
Logger a debug message

Parameters:
message - The text to log

info

public void info(java.lang.String message)
Logger an info message

Parameters:
message - The text to log

warn

public void warn(java.lang.String message)
Logger a warning message

Parameters:
message - The text to log

warn

public void warn(java.lang.String message,
                 java.lang.Throwable th)
Logger a warning message

Parameters:
message - The text to log
th - An optional stack trace

error

public void error(java.lang.String message)
Logger an error message

Parameters:
message - The text to log

error

public void error(java.lang.String message,
                  java.lang.Throwable th)
Logger an error message

Parameters:
message - The text to log
th - An optional stack trace

fatal

public void fatal(java.lang.String message)
Logger a fatal error message

Parameters:
message - The text to log

fatal

public void fatal(java.lang.String message,
                  java.lang.Throwable th)
Logger a fatal error message

Parameters:
message - The text to log
th - An optional stack trace

isDebugEnabled

public boolean isDebugEnabled()
Save CPU time when we are not debugging

Returns:
true if debugging is enabled

Copyright 2008