com.ryanm.logging
Class StringSink

java.lang.Object
  extended by com.ryanm.logging.AbstractSink
      extended by com.ryanm.logging.StringSink
All Implemented Interfaces:
Configurable, LogSink
Direct Known Subclasses:
FileSink, LogTerminal, StreamSink

public abstract class StringSink
extends AbstractSink

Eases implementation of simple LogSinks by handling the conversion of a logMessage to a human-readable String.

Author:
ryanm

Nested Class Summary
protected  class StringSink.StringSinkConfigurator
          Configurator for variables common to all LogSinks that produce String-based output
 
Constructor Summary
StringSink(java.lang.String title)
           
 
Method Summary
 Configurator getConfigurator()
          Gets a Configurator object that describes and can manipulate the variables of this Configurable.
 void log(com.ryanm.logging.LogMessage message)
          Logs the specified message to this sink
protected abstract  void writeString(java.lang.String s)
          This should be overridden to write the supplied string to wherever, stdOut, a file, something like that.
 
Methods inherited from class com.ryanm.logging.AbstractSink
addSinkListener, getTitle, notifyListeners, removeSinkListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringSink

public StringSink(java.lang.String title)
Parameters:
title -
Method Detail

log

public void log(com.ryanm.logging.LogMessage message)
Description copied from interface: LogSink
Logs the specified message to this sink

Parameters:
message - The message to log

writeString

protected abstract void writeString(java.lang.String s)
This should be overridden to write the supplied string to wherever, stdOut, a file, something like that.

Parameters:
s - The String to write

getConfigurator

public Configurator getConfigurator()
Description copied from interface: Configurable
Gets a Configurator object that describes and can manipulate the variables of this Configurable. This method must only return null if the Configurable object is Annotated such that an AnnotatedConfigurator can be built from it.

Returns:
A configurator object, or null if annotated