org.schmant.report
Interface ReportLineFormatter

All Known Implementing Classes:
SimpleReportLineFormatter

public interface ReportLineFormatter

This interface defines a class that formats Report messages.

Implementations should be thread safe since they are reused between several Report instances.

Implementations are required to have a zero-argument constructor. If they need configuration parameters, they may use system properties.

Since:
0.6
Author:
Karl Gustafsson

Method Summary
 String formatLine(String reportIdentifier, String severity, String msg)
          Format one log line.
 String formatStackTrace(String reportIdentifier, String severity, Throwable t)
          Format a log message containing a stack trace.
 

Method Detail

formatLine

String formatLine(String reportIdentifier,
                  String severity,
                  String msg)
Format one log line.

Parameters:
reportIdentifier - The identifier for the Report instance that wants the log line formatted. This may be null if the Report does not have an identifier set.
severity - A text representing the log message's severity, e.g. "INFO" or "TRACE".
msg - The log message.
Returns:
The formatted line.

formatStackTrace

String formatStackTrace(String reportIdentifier,
                        String severity,
                        Throwable t)
Format a log message containing a stack trace. The message may span several lines.

Parameters:
reportIdentifier - The identifier for the Report instance that wants the log line formatted. This may be null if the Report does not have an identifier set.
severity - A text representing the log message's severity, e.g. "INFO" or "TRACE".
t - The Throwable containing the stack trace.
Returns:
The formatted message.