org.crosswire.common.util
Class Logger

java.lang.Object
  extended by org.crosswire.common.util.Logger

Deprecated. Use LoggerFactory and Logger directly.

@Deprecated
public final class Logger
extends Object

This class is going away. It is a facade for slf4j, which itself is a facade for an application's logger of choice. This class is very similar to Commons-Logging except it should be even smaller and have an API closer to the Log4J API (and even J2SE 1.4 logging). This implementation is lazy. The actual internal logger is not initialized until first use. Turns out that this class indirectly depends upon JSword's Project class to help find the logging configuration file. If it is not lazy, it looks in the wrong places for the configuration file.

Author:
Joe Walker [joe at eireneh dot com], DM Smith
See Also:
for license details.
The copyright to this program is held by it's authors.

Field Summary
private static Logger cwLogger
          Deprecated.  
private static boolean established
          Deprecated.  
private static Level level
          Deprecated.  
private  org.slf4j.Logger logger
          Deprecated. The actual logger.
 
Constructor Summary
private Logger(Class<T> id)
          Deprecated. Create a logger for the class.
 
Method Summary
 void debug(String msg)
          Deprecated. Log a message at the DEBUG level.
 void debug(String format, Object... arguments)
          Deprecated. Log a message at the DEBUG level according to the specified format and arguments.
 void debug(String format, Object arg)
          Deprecated. Log a message at the DEBUG level according to the specified format and argument.
 void debug(String format, Object arg1, Object arg2)
          Deprecated. Log a message at the DEBUG level according to the specified format and arguments.
 void debug(String msg, Throwable t)
          Deprecated. Log an exception (throwable) at the DEBUG level with an accompanying message.
 void error(String msg)
          Deprecated. Log a message at the ERROR level.
 void error(String format, Object... arguments)
          Deprecated. Log a message at the ERROR level according to the specified format and arguments.
 void error(String format, Object arg)
          Deprecated. Log a message at the ERROR level according to the specified format and argument.
 void error(String format, Object arg1, Object arg2)
          Deprecated. Log a message at the ERROR level according to the specified format and arguments.
 void error(String msg, Throwable th)
          Deprecated. Log an exception (throwable) at the ERROR level with an accompanying message.
static void establishLogging()
          Deprecated.  
 void fatal(String msg)
          Deprecated. Use error(String) instead.
 void fatal(String msg, Throwable th)
          Deprecated. Use error(String, Throwable) instead.
static
<T> Logger
getLogger(Class<T> clazz)
          Deprecated. Use LoggerFactory.getLogger(Class) instead.
static
<T> Logger
getLogger(Class<T> clazz, boolean showLocation)
          Deprecated. Use LoggerFactory.getLogger(Class) instead.
 void info(String msg)
          Deprecated. Log a message at the INFO level.
 void info(String format, Object... arguments)
          Deprecated. Log a message at the INFO level according to the specified format and arguments.
 void info(String format, Object arg)
          Deprecated. Log a message at the INFO level according to the specified format and argument.
 void info(String format, Object arg1, Object arg2)
          Deprecated. Log a message at the INFO level according to the specified format and arguments.
 void info(String msg, Throwable th)
          Deprecated. Log an exception (throwable) at the INFO level with an accompanying message.
 boolean isDebugEnabled()
          Deprecated. Is the logger instance enabled for the DEBUG level?
 boolean isErrorEnabled()
          Deprecated. Is the logger instance enabled for the ERROR level?
 boolean isInfoEnabled()
          Deprecated. Is the logger instance enabled for the INFO level?
 boolean isWarnEnabled()
          Deprecated. Is the logger instance enabled for the WARN level?
 void log(Level lev, String msg)
          Deprecated. Use error(String), warn(String), info(String), debug(String), or Logger#trace(String)
 void log(Level lev, String msg, Throwable th)
          Deprecated. Use error(String, Throwable), warn(String, Throwable), info(String, Throwable), debug(String, Throwable), or Logger#trace(String, Throwable)
static void outputEverything()
          Deprecated. Use your underlying logger to set levels
static void outputInfoMinimum()
          Deprecated. Use your underlying logger to set levels
static void outputNothing()
          Deprecated. Use your underlying logger to set levels
 void setLevel(Level newLevel)
          Deprecated. Use your underlying logger to set levels
static void setShowLocationForInfoDebugTrace(boolean enabled)
          Deprecated. Sets the show location for debug and trace.
 boolean shouldLog(Level theLevel)
          Deprecated. Use isErrorEnabled(), isWarnEnabled(), isInfoEnabled(), isDebugEnabled(), or Logger#isTraceEnabled()
 void warn(String msg)
          Deprecated. Log a message at the WARN level.
 void warn(String format, Object... arguments)
          Deprecated. Log a message at the WARN level according to the specified format and arguments.
 void warn(String format, Object arg)
          Deprecated. Log a message at the WARN level according to the specified format and argument.
 void warn(String format, Object arg1, Object arg2)
          Deprecated. Log a message at the WARN level according to the specified format and arguments.
 void warn(String msg, Throwable th)
          Deprecated. Log an exception (throwable) at the WARN level with an accompanying message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

established

private static volatile boolean established
Deprecated. 

level

private static volatile Level level
Deprecated. 

logger

private org.slf4j.Logger logger
Deprecated. 
The actual logger.


cwLogger

private static Logger cwLogger
Deprecated. 
Constructor Detail

Logger

private Logger(Class<T> id)
Deprecated. 
Create a logger for the class. Wrapped by org.slf4j.Logger#getLogger(Class).

Method Detail

getLogger

@Deprecated
public static <T> Logger getLogger(Class<T> clazz)
Deprecated. Use LoggerFactory.getLogger(Class) instead.

Get a new logger for the class that shows the class, method and line number of the caller.

Parameters:
clazz - the class that holds the logger.

getLogger

@Deprecated
public static <T> Logger getLogger(Class<T> clazz,
                                              boolean showLocation)
Deprecated. Use LoggerFactory.getLogger(Class) instead.

Get a new logger for the class that shows the class of the caller.

Parameters:
clazz - the class that holds the logger.
showLocation - when true it will get the method and line where logging occurred.

setLevel

@Deprecated
public void setLevel(Level newLevel)
Deprecated. Use your underlying logger to set levels

Set the level at which output occurs for this Logger.

Parameters:
newLevel - the level to apply

outputNothing

@Deprecated
public static void outputNothing()
Deprecated. Use your underlying logger to set levels

Stop all logging output


outputInfoMinimum

@Deprecated
public static void outputInfoMinimum()
Deprecated. Use your underlying logger to set levels

Output a minimum of stuff


outputEverything

@Deprecated
public static void outputEverything()
Deprecated. Use your underlying logger to set levels

Output everything


fatal

@Deprecated
public void fatal(String msg)
Deprecated. Use error(String) instead.

Log a message object with the SEVERE level.

Parameters:
msg - the message to log.

fatal

@Deprecated
public void fatal(String msg,
                             Throwable th)
Deprecated. Use error(String, Throwable) instead.

Log a message object with the SEVERE level.

Parameters:
msg - the message object to log.

isErrorEnabled

public boolean isErrorEnabled()
Deprecated. 
Is the logger instance enabled for the ERROR level?

Returns:
True if this Logger is enabled for the ERROR level, false otherwise.

error

public void error(String msg)
Deprecated. 
Log a message at the ERROR level.

Parameters:
msg - the message string to be logged

error

public void error(String format,
                  Object arg)
Deprecated. 
Log a message at the ERROR level according to the specified format and argument.

This form avoids superfluous object creation when the logger is disabled for the ERROR level.

Parameters:
format - the format string
arg - the argument

error

public void error(String format,
                  Object arg1,
                  Object arg2)
Deprecated. 
Log a message at the ERROR level according to the specified format and arguments.

This form avoids superfluous object creation when the logger is disabled for the ERROR level.

Parameters:
format - the format string
arg1 - the first argument
arg2 - the second argument

error

public void error(String format,
                  Object... arguments)
Deprecated. 
Log a message at the ERROR level according to the specified format and arguments.

This form avoids superfluous string concatenation when the logger is disabled for the ERROR level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for ERROR. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

Parameters:
format - the format string
arguments - a list of 3 or more arguments

error

public void error(String msg,
                  Throwable th)
Deprecated. 
Log an exception (throwable) at the ERROR level with an accompanying message.

Parameters:
msg - the message accompanying the exception
t - the exception (throwable) to log

isInfoEnabled

public boolean isInfoEnabled()
Deprecated. 
Is the logger instance enabled for the INFO level?

Returns:
True if this Logger is enabled for the INFO level, false otherwise.

info

public void info(String msg)
Deprecated. 
Log a message at the INFO level.

Parameters:
msg - the message string to be logged

info

public void info(String format,
                 Object arg)
Deprecated. 
Log a message at the INFO level according to the specified format and argument.

This form avoids superfluous object creation when the logger is disabled for the INFO level.

Parameters:
format - the format string
arg - the argument

info

public void info(String format,
                 Object arg1,
                 Object arg2)
Deprecated. 
Log a message at the INFO level according to the specified format and arguments.

This form avoids superfluous object creation when the logger is disabled for the INFO level.

Parameters:
format - the format string
arg1 - the first argument
arg2 - the second argument

info

public void info(String format,
                 Object... arguments)
Deprecated. 
Log a message at the INFO level according to the specified format and arguments.

This form avoids superfluous string concatenation when the logger is disabled for the INFO level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for INFO. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

Parameters:
format - the format string
arguments - a list of 3 or more arguments

info

public void info(String msg,
                 Throwable th)
Deprecated. 
Log an exception (throwable) at the INFO level with an accompanying message.

Parameters:
msg - the message accompanying the exception
t - the exception (throwable) to log

isWarnEnabled

public boolean isWarnEnabled()
Deprecated. 
Is the logger instance enabled for the WARN level?

Returns:
True if this Logger is enabled for the WARN level, false otherwise.

warn

public void warn(String msg)
Deprecated. 
Log a message at the WARN level.

Parameters:
msg - the message string to be logged

warn

public void warn(String format,
                 Object arg)
Deprecated. 
Log a message at the WARN level according to the specified format and argument.

This form avoids superfluous object creation when the logger is disabled for the WARN level.

Parameters:
format - the format string
arg - the argument

warn

public void warn(String format,
                 Object arg1,
                 Object arg2)
Deprecated. 
Log a message at the WARN level according to the specified format and arguments.

This form avoids superfluous object creation when the logger is disabled for the WARN level.

Parameters:
format - the format string
arg1 - the first argument
arg2 - the second argument

warn

public void warn(String format,
                 Object... arguments)
Deprecated. 
Log a message at the WARN level according to the specified format and arguments.

This form avoids superfluous string concatenation when the logger is disabled for the WARN level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for WARN. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

Parameters:
format - the format string
arguments - a list of 3 or more arguments

warn

public void warn(String msg,
                 Throwable th)
Deprecated. 
Log an exception (throwable) at the WARN level with an accompanying message.

Parameters:
msg - the message accompanying the exception
t - the exception (throwable) to log

isDebugEnabled

public boolean isDebugEnabled()
Deprecated. 
Is the logger instance enabled for the DEBUG level?

Returns:
True if this Logger is enabled for the DEBUG level, false otherwise.

debug

public void debug(String msg)
Deprecated. 
Log a message at the DEBUG level.

Parameters:
msg - the message string to be logged

debug

public void debug(String format,
                  Object arg)
Deprecated. 
Log a message at the DEBUG level according to the specified format and argument.

This form avoids superfluous object creation when the logger is disabled for the DEBUG level.

Parameters:
format - the format string
arg - the argument

debug

public void debug(String format,
                  Object arg1,
                  Object arg2)
Deprecated. 
Log a message at the DEBUG level according to the specified format and arguments.

This form avoids superfluous object creation when the logger is disabled for the DEBUG level.

Parameters:
format - the format string
arg1 - the first argument
arg2 - the second argument

debug

public void debug(String format,
                  Object... arguments)
Deprecated. 
Log a message at the DEBUG level according to the specified format and arguments.

This form avoids superfluous string concatenation when the logger is disabled for the DEBUG level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for DEBUG. The variants taking one and two arguments exist solely in order to avoid this hidden cost.

Parameters:
format - the format string
arguments - a list of 3 or more arguments

debug

public void debug(String msg,
                  Throwable t)
Deprecated. 
Log an exception (throwable) at the DEBUG level with an accompanying message.

Parameters:
msg - the message accompanying the exception
t - the exception (throwable) to log

log

@Deprecated
public void log(Level lev,
                           String msg)
Deprecated. Use error(String), warn(String), info(String), debug(String), or Logger#trace(String)

Log a message with the supplied level.

Parameters:
lev - the level at which to log.
msg - the message to log.

log

@Deprecated
public void log(Level lev,
                           String msg,
                           Throwable th)
Deprecated. Use error(String, Throwable), warn(String, Throwable), info(String, Throwable), debug(String, Throwable), or Logger#trace(String, Throwable)

Log a message with the supplied level, recording the exception when not null.

Parameters:
msg - the message object to log.

shouldLog

@Deprecated
public boolean shouldLog(Level theLevel)
Deprecated. Use isErrorEnabled(), isWarnEnabled(), isInfoEnabled(), isDebugEnabled(), or Logger#isTraceEnabled()

Should log, returns true if theLevel should be logged by this logger. See for more details

Parameters:
theLevel - the the level
Returns:
true, if successful

establishLogging

public static void establishLogging()
Deprecated. 

setShowLocationForInfoDebugTrace

public static void setShowLocationForInfoDebugTrace(boolean enabled)
Deprecated. 
Sets the show location for debug and trace.

Parameters:
enabled - true to display the location on info, debug and trace as well as error and warn

Copyright ? 2003-2011