org.eclipse.actf.util.logging
Interface IReporter

All Known Implementing Classes:
AbstractReporter, PrintWriterReporter, ValidationReporter

public interface IReporter

interface to be implemented in order to generate reports for tracing or validation during the execution of the ACTF application. Typically, reports are configured with a stream or socket but see the RecordReporter, which can be used to store generated reports for later organization.

Author:
Barry Feigenbaum

Field Summary
static int CONFIG
           
static String CONFIGURATION
           
static int DEFAULT_LEVEL
           
static int DETAIL
           
static int ERROR
           
static int INFO
           
static String[] KEYS
           
static int MAX_LEVEL
           
static int MIN_LEVEL
           
static int SEVERE
           
static String SYSTEM_FATAL
           
static String SYSTEM_NONFATAL
           
static String TRACE
           
static int UNKNOWN
           
static String USER
           
static String VALIDATION
           
static int WARNING
           
 
Method Summary
 void close()
          close processing
 void endCategory()
          end the current reporting category
 void endCategory(String id)
          end the category with the given id
 void endReport()
          ends a report started with startReport.
 void flush()
          Flush any pending output
 String getCategory()
          get the category id string of current reporting
 int getDefaultOutputLevel()
          get the default output level.
 String getLastReport()
          get the last reported message
 String getSourceID()
          gets the id or name of this reporter
 boolean isOpen()
          returns whether or not this reporter is open
 void open()
          Open for processing
 void registerErrorLogger(IErrorLogger logger)
          add an error logger to the list of loggers to receive requests to report errors from this reporter.
 void report(int level, String message)
          report the message at the given level.
 void report(int level, String message, Object[] values)
          report the message at the given level with the given substitution values
 void report(int level, String msg, Throwable t)
          reports an exception or error.
 void report(int level, Throwable t)
          reports an exception or error.
 void report(String message)
          report the message
 void report(String message, Object[] values)
          report an information message using the substitution values
 void report(Throwable t)
          reports an exception or error.
 void reset()
          reset the reporter.
 void setDefaultOutputLevel(int level)
          set the default output level.
 void setLastReport(String reportText)
          set the last report on this reporter.
 void setSourceID(String name)
          set the source id for future reports.
 void startCategory(String id)
          start a new category with the given id.
 void startReport(Object comp)
          start a new report.
 void unregisterErrorLogger(IErrorLogger logger)
          remove an error logger from the list of loggers to receive errors
 

Field Detail

SEVERE

static final int SEVERE
See Also:
Constant Field Values

ERROR

static final int ERROR
See Also:
Constant Field Values

WARNING

static final int WARNING
See Also:
Constant Field Values

INFO

static final int INFO
See Also:
Constant Field Values

DETAIL

static final int DETAIL
See Also:
Constant Field Values

CONFIG

static final int CONFIG
See Also:
Constant Field Values

UNKNOWN

static final int UNKNOWN
See Also:
Constant Field Values

DEFAULT_LEVEL

static final int DEFAULT_LEVEL
See Also:
Constant Field Values

MAX_LEVEL

static final int MAX_LEVEL
See Also:
Constant Field Values

MIN_LEVEL

static final int MIN_LEVEL
See Also:
Constant Field Values

KEYS

static final String[] KEYS

VALIDATION

static final String VALIDATION
See Also:
Constant Field Values

SYSTEM_FATAL

static final String SYSTEM_FATAL
See Also:
Constant Field Values

SYSTEM_NONFATAL

static final String SYSTEM_NONFATAL
See Also:
Constant Field Values

USER

static final String USER
See Also:
Constant Field Values

TRACE

static final String TRACE
See Also:
Constant Field Values

CONFIGURATION

static final String CONFIGURATION
See Also:
Constant Field Values
Method Detail

setDefaultOutputLevel

void setDefaultOutputLevel(int level)
set the default output level. This level determines the messages that are to be printed or logged. Messages reported at levels equal to or greater than this level are printed or logged whereas messages reported at levels lower than this default level are ignored by this reporter.

Parameters:
level - - default output level

getDefaultOutputLevel

int getDefaultOutputLevel()
get the default output level.

Returns:
default output level
See Also:
setDefaultOutputLevel(int)

open

void open()
Open for processing


isOpen

boolean isOpen()
returns whether or not this reporter is open

Returns:
true if has been opened, false otherwise
See Also:
open()

close

void close()
close processing


flush

void flush()
Flush any pending output


report

void report(String message)
report the message

Parameters:
message - -- message to be written

report

void report(String message,
            Object[] values)
report an information message using the substitution values

Parameters:
message - -- message to be reported
values - -- substitution values

report

void report(int level,
            String message)
report the message at the given level. Messages are reported if the given level is greater than or equal to the set or default level.

Parameters:
level - -- level of message
message - -- message to be reported

report

void report(int level,
            String message,
            Object[] values)
report the message at the given level with the given substitution values

Parameters:
level -
message -
values -
See Also:
report(int, String)

getLastReport

String getLastReport()
get the last reported message

Returns:
last reported message

getCategory

String getCategory()
get the category id string of current reporting

Returns:
current category id

startCategory

void startCategory(String id)
start a new category with the given id.

Parameters:
id - -- new category id

endCategory

void endCategory()
end the current reporting category


endCategory

void endCategory(String id)
end the category with the given id

Parameters:
id - -- id of category to end

registerErrorLogger

void registerErrorLogger(IErrorLogger logger)
add an error logger to the list of loggers to receive requests to report errors from this reporter.

Parameters:
logger - - error logger for reporting errors

unregisterErrorLogger

void unregisterErrorLogger(IErrorLogger logger)
remove an error logger from the list of loggers to receive errors

Parameters:
logger - - error logger to be removed

setSourceID

void setSourceID(String name)
set the source id for future reports. If no id is set, the word 'level' precedes the level of the violation.

The id can be one of the following:

Parameters:
name - - name or id of this reporter

getSourceID

String getSourceID()
gets the id or name of this reporter

Returns:
name or id of this reporter
See Also:
setSourceID(String)

report

void report(Throwable t)
reports an exception or error. This method can be used to direct the stack trace of the given throwable to the appropriate output for this reporter (e.g. a GUI text area or stream).

The default level of this report message is Reporter.SEVERE.

Parameters:
t - - Throwable being reported

report

void report(int level,
            Throwable t)
reports an exception or error. This method can be used to direct the stack trace of the given throwable to the appropriate output for this reporter (e.g. a GUI text area or stream). The level of the throwable is determined by the specified level parameter.

Parameters:
level - - level of exception or error
t - - Throwable being reported

report

void report(int level,
            String msg,
            Throwable t)
reports an exception or error. This method can be used to direct the stack trace of the given throwable to the appropriate output for this reporter (e.g. a GUI text area or stream). The level of the throwable is determined by the specified level parameter.

Parameters:
level - - level of exception or error
msg - - optional message
t - - Throwable being reported

startReport

void startReport(Object comp)
start a new report. Every call of this method must be matched with a corresponding endReport call.

Parameters:
comp - - root component for which report is being generated

endReport

void endReport()
ends a report started with startReport. Once this method is called, the getLastReport method can be called in order to supply the report generated betwen the startReport call and this call.


setLastReport

void setLastReport(String reportText)
set the last report on this reporter. This method is only used in ValidationLauncher.DISTINCT_JVM after the launcher gets an indication that a report has completed.

Parameters:
reportText - - last report generated

reset

void reset()
reset the reporter. This method should clear all categories and all remaining buffers and report records.