logahawk.formatters
Class StandardExceptionSigFormatter

java.lang.Object
  extended by logahawk.formatters.StandardExceptionSigFormatter
All Implemented Interfaces:
SignatureFormatter

@Immutable
public class StandardExceptionSigFormatter
extends Object
implements SignatureFormatter

This will reformat the signature of an message where a String message is followed by an Exception. This is the most common logging case, and it shouldn't be treated as a collection of two elements.


Field Summary
protected  ArgumentFormatter messageFormatter
           
protected  ThrowableArgFormatter throwableFormatter
           
 
Constructor Summary
StandardExceptionSigFormatter(ArgumentFormatter messageFormatter, ThrowableArgFormatter throwableFormatter)
           
 
Method Summary
 boolean canFormat(List<Object> arguments)
          This should return true only if this "Formatter" can provide a useful formatting for this signature.
 void format(List<Object> arguments)
          This will re-arrange and alter the signature provided into a new signature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messageFormatter

protected final ArgumentFormatter messageFormatter

throwableFormatter

protected final ThrowableArgFormatter throwableFormatter
Constructor Detail

StandardExceptionSigFormatter

public StandardExceptionSigFormatter(ArgumentFormatter messageFormatter,
                                     ThrowableArgFormatter throwableFormatter)
Parameters:
messageFormatter - The ArgumentFormatter that will be used to format the message (the first argument). This can and most likely should be the same instance used in constructing the ArgumentFormatterContainer.
throwableFormatter - The ThrowableArgFormatter implementation that will be used to format the message (the second argument). This can and most likely should be the same instance used in constructing the ArgumentFormatterContainer and ThrowableArgFormatter.
Method Detail

canFormat

public boolean canFormat(List<Object> arguments)
Description copied from interface: SignatureFormatter
This should return true only if this "Formatter" can provide a useful formatting for this signature.

Specified by:
canFormat in interface SignatureFormatter

format

public void format(List<Object> arguments)
Description copied from interface: SignatureFormatter
This will re-arrange and alter the signature provided into a new signature. This will modify the provided list.

Specified by:
format in interface SignatureFormatter