edu.rice.cs.plt.debug
Class SplitLogSink
java.lang.Object
edu.rice.cs.plt.debug.SplitLogSink
- All Implemented Interfaces:
- LogSink, Composite, Closeable
public class SplitLogSink
- extends Object
- implements LogSink, Composite
A log sink that sends messages to all the sinks it contains. This allows, for example, logging to be
viewed at runtime while, at the same time, being recorded to a file. The set of sinks can be
modified at any time. (Concurrent logging is supported, but concurrent add
or remove
invocations are not: only one thread should manage the set of sinks at a time.)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SplitLogSink
public SplitLogSink(LogSink... sinks)
- Create a log that will send its messages to each of
logs
SplitLogSink
public SplitLogSink(Iterable<? extends LogSink> sinks)
add
public void add(LogSink... toAdd)
add
public void add(Iterable<? extends LogSink> toAdd)
remove
public void remove(LogSink... toRemove)
remove
public void remove(Iterable<? extends LogSink> toRemove)
compositeHeight
public int compositeHeight()
- Description copied from interface:
Composite
- Get the maximum path length from this node to a leaf.
- Specified by:
compositeHeight
in interface Composite
compositeSize
public int compositeSize()
- Description copied from interface:
Composite
- Get the number of nodes in the tree rooted at this node. Always 1 or greater.
- Specified by:
compositeSize
in interface Composite
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Throws:
IOException
log
public void log(LogSink.StandardMessage m)
- Specified by:
log
in interface LogSink
logStart
public void logStart(LogSink.StartMessage m)
- Specified by:
logStart
in interface LogSink
logEnd
public void logEnd(LogSink.EndMessage m)
- Specified by:
logEnd
in interface LogSink
logError
public void logError(LogSink.ErrorMessage m)
- Specified by:
logError
in interface LogSink
logStack
public void logStack(LogSink.StackMessage m)
- Specified by:
logStack
in interface LogSink