edu.rice.cs.plt.debug
Class StandardLog

java.lang.Object
  extended by edu.rice.cs.plt.debug.StandardLog
All Implemented Interfaces:
Log

public class StandardLog
extends Object
implements Log

A log that acts as a front end for a LogSink.


Constructor Summary
StandardLog(LogSink sink)
           
 
Method Summary
 void log()
          Record the current execution point (may include the current time, thread, code location, etc.)
 void log(String message)
          Record the given message
 void log(String message, Throwable t)
          Record the given exception (or other throwable) with a descriptive message; t may be null
 void log(Throwable t)
          Record the given exception (or other throwable); may be null
 void logEnd()
          Record the end of an execution phase.
 void logEnd(String message)
          Record the end of an execution phase with a descriptive message.
 void logEnd(String[] names, Object... values)
          Record the end of an execution phase.
 void logEnd(String name, Object value)
          Record the end of an execution phase.
 void logEnd(String message, String[] names, Object... values)
          Record the end of an execution phase with a descriptive message.
 void logEnd(String message, String name, Object value)
          Record the end of an execution phase with a descriptive message.
 void logStack()
          Record the current thread's stack trace
 void logStack(String message)
          Record the current thread's stack trace with a descriptive message
 void logStart()
          Record the beginning of an execution phase.
 void logStart(String message)
          Record the beginning of an execution phase with a descriptive message.
 void logStart(String[] names, Object... values)
          Record the beginning of an execution phase.
 void logStart(String name, Object value)
          Record the beginning of an execution phase.
 void logStart(String message, String[] names, Object... values)
          Record the beginning of an execution phase with a descriptive message.
 void logStart(String message, String name, Object value)
          Record the beginning of an execution phase with a descriptive message.
 void logValue(String name, Object value)
          Record the name and value of some variable or expression; value may be null
 void logValue(String message, String name, Object value)
          Record the name and value of some variable or expression with a descriptive message; value may be null
 void logValues(String[] names, Object... values)
          Record the names and values of a list of variables or expressions.
 void logValues(String message, String[] names, Object... values)
          Record the names and values of a list of variables or expressions with a descriptive message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardLog

public StandardLog(LogSink sink)
Method Detail

log

public void log()
Description copied from interface: Log
Record the current execution point (may include the current time, thread, code location, etc.)

Specified by:
log in interface Log

log

public void log(String message)
Description copied from interface: Log
Record the given message

Specified by:
log in interface Log

log

public void log(Throwable t)
Description copied from interface: Log
Record the given exception (or other throwable); may be null

Specified by:
log in interface Log

log

public void log(String message,
                Throwable t)
Description copied from interface: Log
Record the given exception (or other throwable) with a descriptive message; t may be null

Specified by:
log in interface Log

logEnd

public void logEnd()
Description copied from interface: Log
Record the end of an execution phase. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

Specified by:
logEnd in interface Log

logEnd

public void logEnd(String message)
Description copied from interface: Log
Record the end of an execution phase with a descriptive message. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

Specified by:
logEnd in interface Log

logEnd

public void logEnd(String name,
                   Object value)
Description copied from interface: Log

Record the end of an execution phase. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

This version also records the name and value of a variable. value may be null.

Specified by:
logEnd in interface Log

logEnd

public void logEnd(String message,
                   String name,
                   Object value)
Description copied from interface: Log

Record the end of an execution phase with a descriptive message. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

This version also records the name and value of a variable. value may be null.

Specified by:
logEnd in interface Log

logEnd

public void logEnd(String[] names,
                   Object... values)
Description copied from interface: Log

Record the end of an execution phase. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

This version also records the name and value of a set of variables. Any of values may be null.

Specified by:
logEnd in interface Log

logEnd

public void logEnd(String message,
                   String[] names,
                   Object... values)
Description copied from interface: Log

Record the end of an execution phase with a descriptive message. This is useful, for example, when a method's execution ends. This call should always be preceded by a corresponding invocation of Log.logStart() or Log.logStart(String).

This version also records the name and value of a set of variables. Any of values may be null.

Specified by:
logEnd in interface Log

logStack

public void logStack()
Description copied from interface: Log
Record the current thread's stack trace

Specified by:
logStack in interface Log

logStack

public void logStack(String message)
Description copied from interface: Log
Record the current thread's stack trace with a descriptive message

Specified by:
logStack in interface Log

logStart

public void logStart()
Description copied from interface: Log
Record the beginning of an execution phase. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

Specified by:
logStart in interface Log

logStart

public void logStart(String message)
Description copied from interface: Log
Record the beginning of an execution phase with a descriptive message. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

Specified by:
logStart in interface Log

logStart

public void logStart(String name,
                     Object value)
Description copied from interface: Log

Record the beginning of an execution phase. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

This version also records the name and value of a variable. value may be null.

Specified by:
logStart in interface Log

logStart

public void logStart(String message,
                     String name,
                     Object value)
Description copied from interface: Log

Record the beginning of an execution phase with a descriptive message. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

This version also records the name and value of a variable. value may be null.

Specified by:
logStart in interface Log

logStart

public void logStart(String[] names,
                     Object... values)
Description copied from interface: Log

Record the beginning of an execution phase. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

This version also records the name and value of a set of variables. Any of values may be null.

Specified by:
logStart in interface Log

logStart

public void logStart(String message,
                     String[] names,
                     Object... values)
Description copied from interface: Log

Record the beginning of an execution phase with a descriptive message. This is useful, for example, when a method's execution begins. This call should always be followed by a corresponding invocation of Log.logEnd() or Log.logEnd(String).

This version also records the name and value of a set of variables. Any of values may be null.

Specified by:
logStart in interface Log

logValue

public void logValue(String name,
                     Object value)
Description copied from interface: Log
Record the name and value of some variable or expression; value may be null

Specified by:
logValue in interface Log

logValue

public void logValue(String message,
                     String name,
                     Object value)
Description copied from interface: Log
Record the name and value of some variable or expression with a descriptive message; value may be null

Specified by:
logValue in interface Log

logValues

public void logValues(String[] names,
                      Object... values)
Description copied from interface: Log
Record the names and values of a list of variables or expressions. The two arrays are assumed to have the same length, although implementations are encouraged to handle violations of this assumption cleanly by, for example, logging an error message. Any member of values may be null.

Specified by:
logValues in interface Log

logValues

public void logValues(String message,
                      String[] names,
                      Object... values)
Description copied from interface: Log
Record the names and values of a list of variables or expressions with a descriptive message. The two arrays are assumed to have the same length, although implementations are encouraged to handle violations of this assumption cleanly by, for example, logging an error message. Any member of values may be null.

Specified by:
logValues in interface Log