com.antelmann.util.logging
Class LoggerWriter
java.lang.Object
com.antelmann.util.logging.LoggerWriter
- All Implemented Interfaces:
- Filter<LogEntry>, LogWriter, Wrapped<Logger>
public class LoggerWriter
- extends Object
- implements LogWriter, Wrapped<Logger>
provides a writer that propagates the LogEntries to another logger
- Since:
- 27.02.2012, 21:49:45
- Author:
- Holger Antelmann
|
Method Summary |
boolean |
accept(LogEntry entry)
returns true only if the given entry is accepted by this filter |
Logger |
unwrap()
returns the embedded instance that this wrapper encloses |
void |
write(LogEntry entry)
writes the given LogEntry to the log of this LogWriter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggerWriter
public LoggerWriter(Logger logger)
accept
public boolean accept(LogEntry entry)
- Description copied from interface:
Filter
- returns true only if the given entry is accepted by this filter
- Specified by:
accept in interface Filter<LogEntry>
unwrap
public Logger unwrap()
- Description copied from interface:
Wrapped
- returns the embedded instance that this wrapper encloses
- Specified by:
unwrap in interface Wrapped<Logger>
write
public void write(LogEntry entry)
throws LogException
- Description copied from interface:
LogWriter
- writes the given LogEntry to the log of this LogWriter.
This method must not check whether entries are accepted, as
the Logger class will only call this method once checked
that this LogWriter accepts the given entry.
- Specified by:
write in interface LogWriter
- Throws:
LogException - if an error occurred while writing the log
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads