uk.org.lidalia.sysoutslf4j.context.exceptionhandlers
Interface ExceptionHandlingStrategy


public interface ExceptionHandlingStrategy

This interface defines the methods used by sysout-over-slf4j to convert the results of Throwable.printStacktrace into logging events.
Since the exception itself cannot be reclaimed, all that is available is the individual lines of the stack trace as they are printed to System.out/err. Something more like normal logging might be achievable by buffering these lines and constructing a new Exception from them.


Method Summary
 void handleExceptionLine(String line, Logger log)
          Called for each line of the stack trace as sent to the System.out/err PrintStream.
 void notifyNotStackTrace()
          Called whenever any other calls are intercepted by sysout-over-slf4j - may be a useful trigger for flushing a buffer.
 

Method Detail

handleExceptionLine

void handleExceptionLine(String line,
                         Logger log)
Called for each line of the stack trace as sent to the System.out/err PrintStream.

Parameters:
line - The stacktrace line
log - The Logger with a name matching the fully qualified name of the class where printStacktrace was called

notifyNotStackTrace

void notifyNotStackTrace()
Called whenever any other calls are intercepted by sysout-over-slf4j - may be a useful trigger for flushing a buffer.



Copyright © 2010. All Rights Reserved.