org.schmant.report
Class AsynchronousReport

java.lang.Object
  extended by org.schmant.report.AbstractReport
      extended by org.schmant.report.AsynchronousReport
All Implemented Interfaces:
Report

public final class AsynchronousReport
extends AbstractReport

Since:
0.8
Author:
Karl Gustafsson

Constructor Summary
AsynchronousReport(Report wrapped, String identifier)
           
 
Method Summary
 void close()
          Close the current report.
 void debug(Object o)
          Log a message to debug level (Level.FINE).
 void error(Object o)
          Log a message to error level (Level.SEVERE).
 void error(Object o, Throwable t)
          Log a message and an exception to error level (Level.SEVERE).
 String getIdentifier()
          Get the identifier for this report.
 PrintWriter getStackTraceWriter(Level l)
          Get a PrintWriter to write a stack trace to if the stack trace for some reason cannot be logged through any of the ordinary logger methods.
 void info(Object o)
          Log a message to info level (Level.INFO).
 void log(Object o, Level l)
          Log a message to the supplied level.
 void log(Object o, Throwable t, Level l)
          Log a message and an exception to the supplied level.
 void setLevel(Level l)
          Set the log level.
 void trace(Object o)
          Log a message to trace level (Level.FINER).
 void warn(Object o)
          Log a message to warn level (Level.WARNING).
 void warn(Object o, Throwable t)
          Log a message and an exception to warn level (Level.WARNING).
 
Methods inherited from class org.schmant.report.AbstractReport
getLevel, isDebugReported, isErrorReported, isInfoReported, isLevelReported, isOpen, isTraceReported, isWarnReported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousReport

public AsynchronousReport(Report wrapped,
                          String identifier)
Method Detail

getIdentifier

public String getIdentifier()
Description copied from interface: Report
Get the identifier for this report. It may be null.

Returns:
This report's identifier. May be null.

setLevel

public void setLevel(Level l)
Description copied from interface: Report
Set the log level.

Specified by:
setLevel in interface Report
Overrides:
setLevel in class AbstractReport
Parameters:
l - The log level.

getStackTraceWriter

public PrintWriter getStackTraceWriter(Level l)
Description copied from interface: Report
Get a PrintWriter to write a stack trace to if the stack trace for some reason cannot be logged through any of the ordinary logger methods.

The caller is responsible for closing the writer.

Parameters:
l - The level to write the stack trace to.
Returns:
A print writer to write a stack trace to.

log

public void log(Object o,
                Level l)
Description copied from interface: Report
Log a message to the supplied level.

Parameters:
o - The message to log.
l - The level to log to.

log

public void log(Object o,
                Throwable t,
                Level l)
Description copied from interface: Report
Log a message and an exception to the supplied level.

Parameters:
o - The message to log. This may be null.
t - The exception to log. This may be null.
l - The level to log to.

trace

public void trace(Object o)
Description copied from interface: Report
Log a message to trace level (Level.FINER).

Parameters:
o - The message to log.

debug

public void debug(Object o)
Description copied from interface: Report
Log a message to debug level (Level.FINE).

Parameters:
o - The message to log.

info

public void info(Object o)
Description copied from interface: Report
Log a message to info level (Level.INFO).

Parameters:
o - The message to log.

warn

public void warn(Object o)
Description copied from interface: Report
Log a message to warn level (Level.WARNING).

Parameters:
o - The message to log.

warn

public void warn(Object o,
                 Throwable t)
Description copied from interface: Report
Log a message and an exception to warn level (Level.WARNING).

Parameters:
o - The message to log.
t - The exception to log.

error

public void error(Object o)
Description copied from interface: Report
Log a message to error level (Level.SEVERE).

Parameters:
o - The message to log.

error

public void error(Object o,
                  Throwable t)
Description copied from interface: Report
Log a message and an exception to error level (Level.SEVERE).

Parameters:
o - The message to log.
t - The exception to log.

close

public void close()
Description copied from interface: Report
Close the current report. After calling this method the report does not accept any new messages. This is called when Schmant exits or when a new report is started.

Specified by:
close in interface Report
Overrides:
close in class AbstractReport