edu.stanford.nlp.util.logging
Class Redwood.RedwoodChannels

java.lang.Object
  extended by edu.stanford.nlp.util.logging.Redwood.RedwoodChannels
Enclosing class:
Redwood

public static class Redwood.RedwoodChannels
extends Object

Represents a collection of channels. This lets you decouple selecting channels from logging messages, similar to traditional logging systems. Redwood.RedwoodChannels have log and logf methods. Unlike Redwood.log and Redwood.logf, these do not take channel names since those are specified inside Redwood.RedwoodChannels. Required if you want to use logf with a channel. This follows the Builder Pattern so Redwood.channels("chanA", "chanB").log("message") is equivalent to Redwood.channels("chanA").channels("chanB").log("message")


Constructor Summary
Redwood.RedwoodChannels(Object... channelNames)
           
 
Method Summary
 Redwood.RedwoodChannels channels(Object... moreChannelNames)
          Creates a new RedwoodChannels object, concatenating the channels from this RedwoodChannels with some additional channels.
 void hide()
          Hides all of these channels.
 void log(Object obj)
          Log a message to the channels specified in this RedwoodChannels object.
 void logf(String format, Object... args)
          Log a printf-style formatted message to the channels specified in this RedwoodChannels object.
 void prettyLog(Object obj)
          PrettyLog an object using these channels.
 void prettyLog(String description, Object obj)
          PrettyLog an object with a description using these channels.
 void show()
          Shows all of these channels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Redwood.RedwoodChannels

public Redwood.RedwoodChannels(Object... channelNames)
Method Detail

channels

public Redwood.RedwoodChannels channels(Object... moreChannelNames)
Creates a new RedwoodChannels object, concatenating the channels from this RedwoodChannels with some additional channels.

Parameters:
moreChannelNames - The channel names to also include
Returns:
A RedwoodChannels representing the current and new channels.

log

public void log(Object obj)
Log a message to the channels specified in this RedwoodChannels object.

Parameters:
obj - The object to log

logf

public void logf(String format,
                 Object... args)
Log a printf-style formatted message to the channels specified in this RedwoodChannels object.

Parameters:
format - The format string for the printf function
args - The arguments to the printf function

prettyLog

public void prettyLog(Object obj)
PrettyLog an object using these channels. A default description will be created based on the type of obj.


prettyLog

public void prettyLog(String description,
                      Object obj)
PrettyLog an object with a description using these channels.


hide

public void hide()
Hides all of these channels.


show

public void show()
Shows all of these channels.



Stanford NLP Group