smbdav
Class Log

java.lang.Object
  extended bysmbdav.Log

public abstract class Log
extends java.lang.Object

Provides logging utility functionality. A provider can extend this class and is specified by the "smbdav.Log" system property, or via a Jar service provider ("/META-INF/services/smbdav.Log").

Author:
Eric Glass

Field Summary
static int CRITICAL
          Logging threshold indicating critical errors should be logged.
static int DEBUG
          Logging threshold indicating everything should be logged.
static int ERROR
          Logging threshold indicating errors should be logged.
static int INFORMATION
          Logging threshold indicating useful information should be logged.
static int NOTHING
          Logging threshold indicating nothing should be logged.
static int WARNING
          Logging threshold indicating warnings should be logged.
 
Constructor Summary
protected Log()
          Constructed provided for subclasses.
 
Method Summary
protected  int getLogThreshold()
          Returns the current logging threshold.
static int getThreshold()
          Returns the current logging threshold.
static void log(int level, java.lang.Object arg)
          Logs an object for the specified level.
static void log(int level, java.lang.String message, java.lang.Object arg)
          Logs a message with an argument object for the specified level.
protected abstract  void logMessage(int level, java.lang.String message)
          Logs the specified message at the provided level.
static void setThreshold(int threshold)
          Sets the current logging threshold.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final int DEBUG
Logging threshold indicating everything should be logged.

See Also:
Constant Field Values

INFORMATION

public static final int INFORMATION
Logging threshold indicating useful information should be logged.

See Also:
Constant Field Values

WARNING

public static final int WARNING
Logging threshold indicating warnings should be logged.

See Also:
Constant Field Values

ERROR

public static final int ERROR
Logging threshold indicating errors should be logged.

See Also:
Constant Field Values

CRITICAL

public static final int CRITICAL
Logging threshold indicating critical errors should be logged.

See Also:
Constant Field Values

NOTHING

public static final int NOTHING
Logging threshold indicating nothing should be logged.

See Also:
Constant Field Values
Constructor Detail

Log

protected Log()
Constructed provided for subclasses.

Method Detail

getThreshold

public static int getThreshold()
Returns the current logging threshold.

Returns:
an int containing the current threshold value.

setThreshold

public static void setThreshold(int threshold)
Sets the current logging threshold.

Parameters:
threshold - The new logging threshold value.

log

public static void log(int level,
                       java.lang.Object arg)
Logs an object for the specified level.

Parameters:
level - The logging level.
arg - The argument object. Strings will be logged directly; Throwables will log a stack trace.

log

public static void log(int level,
                       java.lang.String message,
                       java.lang.Object arg)
Logs a message with an argument object for the specified level.

Parameters:
level - The logging level.
message - The message. This can contain format arguments, i.e. "{0}".
arg - The argument object. A String will be interpreted as a single format value. A Throwable will use the associated stack trace as the format value. A Object[] will be interpreted as a set of format values (i.e., "{0}", "{1}", etc.).

getLogThreshold

protected int getLogThreshold()
Returns the current logging threshold.

Returns:
an int containing the current threshold value.

logMessage

protected abstract void logMessage(int level,
                                   java.lang.String message)
Logs the specified message at the provided level.

Parameters:
level - The logging level.
message - The message that is to be logged.


Copyright © 2004 Eric Glass