Holger's
Java API

com.antelmann.util.logging
Class AppendableLogWriter

java.lang.Object
  extended by com.antelmann.util.logging.AbstractLogWriter<String>
      extended by com.antelmann.util.logging.AppendableLogWriter
All Implemented Interfaces:
Filter<LogEntry>, LogWriter, Wrapped<Appendable>
Direct Known Subclasses:
ConsoleLog

public class AppendableLogWriter
extends AbstractLogWriter<String>
implements Wrapped<Appendable>

writes to a given Appendable (PrintStream, StringBuffer, etc) using a String

Since:
03.02.2014, 01:19:48
Author:
holger
See Also:
Appendable, PrintStream, StringBuilder, StringLineFormatter

Field Summary
 
Fields inherited from class com.antelmann.util.logging.AbstractLogWriter
filter
 
Fields inherited from interface com.antelmann.util.Filter
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER
 
Constructor Summary
AppendableLogWriter(Appendable appendable)
           
AppendableLogWriter(Appendable appendable, LogEntryFormatter<String> formatter)
           
 
Method Summary
 Appendable getAppendable()
           
 Appendable unwrap()
          returns the embedded instance that this wrapper encloses
protected  void writeLogPattern(String pattern)
          writes the pattern to the log entity.
 
Methods inherited from class com.antelmann.util.logging.AbstractLogWriter
accept, getLogFilter, getLogFormatter, setLogFilter, setLogFormatter, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppendableLogWriter

public AppendableLogWriter(Appendable appendable)

AppendableLogWriter

public AppendableLogWriter(Appendable appendable,
                           LogEntryFormatter<String> formatter)
Method Detail

getAppendable

public Appendable getAppendable()

unwrap

public Appendable unwrap()
Description copied from interface: Wrapped
returns the embedded instance that this wrapper encloses

Specified by:
unwrap in interface Wrapped<Appendable>

writeLogPattern

protected void writeLogPattern(String pattern)
                        throws LogException
Description copied from class: AbstractLogWriter
writes the pattern to the log entity. If the LogEntryFormatter is null, the pattern is the LogEntry object itself; otherwise, the pattern is the result of formatting the LogEntry with the given LogEntryFormatter.

Specified by:
writeLogPattern in class AbstractLogWriter<String>
Throws:
LogException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads