maslab.util
Class LoggerPublisher

java.lang.Object
  extended by maslab.util.LoggerPublisher
Direct Known Subclasses:
ConsoleLoggerPublisher, JugLoggerPublisher

public class LoggerPublisher
extends java.lang.Object

The base class of all LoggerPublishers.


Constructor Summary
LoggerPublisher()
           
 
Method Summary
 void publish(java.lang.String name, int level, java.lang.String message)
          Called when new data is published by any channel.
 void publishUnconditional(java.lang.String name, int level, java.lang.String message)
           
 void setGlobalLevel(int threshold)
          Set a new default threshold for publishing.
 void setLevel(java.lang.String channel, int threshold)
          Set a per-channel threshold for publishing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerPublisher

public LoggerPublisher()
Method Detail

publish

public void publish(java.lang.String name,
                    int level,
                    java.lang.String message)
Called when new data is published by any channel.

Parameters:
name - The channel name
level - The level
message - The message to be displayed.

publishUnconditional

public void publishUnconditional(java.lang.String name,
                                 int level,
                                 java.lang.String message)

setGlobalLevel

public void setGlobalLevel(int threshold)
Set a new default threshold for publishing. This level will be applied to any channel which hasn't been given a level specifically.

Parameters:
threshold - One of the static levels provided by the Logger class.

setLevel

public void setLevel(java.lang.String channel,
                     int threshold)
Set a per-channel threshold for publishing. This overrides the global threshold.

Parameters:
channel - The channel name
threshold - One of the static levels provided by the Logger class.