Rice Pastry API

rice.environment.logging
Class Logger

java.lang.Object
  extended by rice.environment.logging.Logger
Direct Known Subclasses:
HeirarchyLogger

public abstract class Logger
extends java.lang.Object

The Logger is a simplified interface of the java.util.logging.Logger. It is envisioned that one could implement this interface using java.util.logging, but that many times this interface is overkill.

Author:
Jeff Hoye

Field Summary
static int ALL
          ALL indicates that all messages should be logged.
static int CONFIG
          CONFIG is a message level for static configuration messages.
static int FINE
          FINE is a message level providing tracing information.
static int FINER
          FINER indicates a fairly detailed tracing message.
static int FINEST
          FINEST indicates a highly detailed tracing message.
static int INFO
          INFO is a message level for informational messages.
 int level
          This is public for performance reasons.
static int OFF
          OFF is a special level that can be used to turn off logging.
static int SEVERE
          SEVERE is a message level indicating a serious failure.
static int WARNING
          WARNING is a message level indicating a potential problem.
 
Constructor Summary
Logger()
           
 
Method Summary
 void log(int priority, java.lang.String message)
          Deprecated. use if (logger.level <= priority) log(String);
abstract  void log(java.lang.String message)
          Prints the message if the priority is equal to or higher than the minimum priority.
 void logException(int priority, java.lang.String message, java.lang.Throwable exception)
          Deprecated. use if (logger.level <= priority) logException(String, Throwable);
abstract  void logException(java.lang.String message, java.lang.Throwable exception)
          Prints the stack trace of the exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEVERE

public static final int SEVERE
SEVERE is a message level indicating a serious failure.

See Also:
Constant Field Values

WARNING

public static final int WARNING
WARNING is a message level indicating a potential problem.

See Also:
Constant Field Values

INFO

public static final int INFO
INFO is a message level for informational messages. Things that only happen once per node creation.

See Also:
Constant Field Values

CONFIG

public static final int CONFIG
CONFIG is a message level for static configuration messages.

See Also:
Constant Field Values

FINE

public static final int FINE
FINE is a message level providing tracing information. Things that get logged once per specific message.

See Also:
Constant Field Values

FINER

public static final int FINER
FINER indicates a fairly detailed tracing message. Things that get logged once per general message.

See Also:
Constant Field Values

FINEST

public static final int FINEST
FINEST indicates a highly detailed tracing message. Things that happen more than once per general message.

See Also:
Constant Field Values

ALL

public static final int ALL
ALL indicates that all messages should be logged.

See Also:
Constant Field Values

OFF

public static final int OFF
OFF is a special level that can be used to turn off logging.

See Also:
Constant Field Values

level

public int level
This is public for performance reasons.

Constructor Detail

Logger

public Logger()
Method Detail

log

public abstract void log(java.lang.String message)
Prints the message if the priority is equal to or higher than the minimum priority.

Parameters:
priority - the priority of this log message
message - the message to print

logException

public abstract void logException(java.lang.String message,
                                  java.lang.Throwable exception)
Prints the stack trace of the exception. If you only want to print the exception's string, use the log() method. This is necessary because Exception doesn't have a convienient way of printing the stack trace as a string.

Parameters:
priority - the priority of this log message
exception - the exception to print

log

public void log(int priority,
                java.lang.String message)
Deprecated. use if (logger.level <= priority) log(String);

Prints the message if the priority is equal to or higher than the minimum priority. Deprecated because string construction performance was the bottleneck

Parameters:
priority - the priority of this log message
message - the message to print

logException

public void logException(int priority,
                         java.lang.String message,
                         java.lang.Throwable exception)
Deprecated. use if (logger.level <= priority) logException(String, Throwable);

Prints the stack trace of the exception. If you only want to print the exception's string, use the log() method. This is necessary because Exception doesn't have a convienient way of printing the stack trace as a string. Deprecated because string construction performance was the bottleneck

Parameters:
priority - the priority of this log message
exception - the exception to print

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection