Main: Whitepaper FAQ Examples JavaDoc Classloader Performance
Protomatter Software v1.1.8

com.protomatter.syslog
Class Channel

java.lang.Object
  |
  +--com.protomatter.syslog.Channel

public final class Channel
extends java.lang.Object

A utility class for writing log messages to channels. Example usage of this class is as follows:

Basically, rather than using the infoToChannel(...) method and others on Syslog, you can simply get a handle to a channel and call methods on it. Some people prefer this interface to the regular Syslog interface.


Field Summary
static Channel ALL
          A static utility field, which is the "all" channel.
static Channel DEFAULT
          A static utility field, which is the "default" channel.
 
Method Summary
 void crumb()
          Log a breadcrumb at the debug level.
 void crumb(java.lang.Object caller)
          Log a breadcrumb at the debug level.
 void debug(java.lang.Object caller, java.lang.Object message)
          Log a debug message.
 void debug(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
          Log a debug message.
 void error(java.lang.Object caller, java.lang.Object message)
          Log an error message.
 void error(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
          Log an error message.
 void fatal(java.lang.Object caller, java.lang.Object message)
          Log a fatal message.
 void fatal(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
          Log a fatal message.
static Channel forPackage(java.lang.Class someClass)
          Get a Channel whose name is the package that the given class is in.
static Channel getAllChannel()
          Get a Channel object for the "all" channel.
static Channel getChannel(java.lang.Class channelClass)
          Get a Channel object with the name of the given class.
static Channel getChannel(java.lang.String channelName)
          Get a Channel object for the given channel name.
static Channel getChannel(java.lang.String[] channels)
          Get a Channel object for the given set of channels.
static Channel getChannel(SyslogChannelAware channelAware)
          Get a Channel object which will delegate to the given channel aware object.
 java.lang.String[] getChannelNames()
          Get the list of channels that this Channel object writes to.
static Channel getDefaultChannel()
          Get a Channel object for the default channel.
 void info(java.lang.Object caller, java.lang.Object message)
          Log an info message.
 void info(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
          Log an info message.
 void log(java.lang.Object caller, java.lang.Object message, java.lang.Object detail, int level)
          Log a message.
 void log(java.lang.Object caller, java.lang.Throwable exception)
          Log a message about the given exception.
 void warning(java.lang.Object caller, java.lang.Object message)
          Log a warning message.
 void warning(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
          Log a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final Channel ALL
A static utility field, which is the "all" channel.

DEFAULT

public static final Channel DEFAULT
A static utility field, which is the "default" channel.
Method Detail

getChannelNames

public java.lang.String[] getChannelNames()
Get the list of channels that this Channel object writes to. This method will either return the channel name(s) passed into the getChannel() method that created this object, or it will ask the SyslogChannelAware object that this Channel is associated with what channels it thinks we should write to.

getChannel

public static Channel getChannel(java.lang.String channelName)
Get a Channel object for the given channel name.

getChannel

public static Channel getChannel(java.lang.Class channelClass)
Get a Channel object with the name of the given class.

forPackage

public static Channel forPackage(java.lang.Class someClass)
Get a Channel whose name is the package that the given class is in. For instace, if you pass in com.yourcompany.foo.SomeClass the channel name will be com.yourcompany.foo.

getChannel

public static Channel getChannel(java.lang.String[] channels)
Get a Channel object for the given set of channels. Each logging call will send messages to each of these channels.

getChannel

public static Channel getChannel(SyslogChannelAware channelAware)
Get a Channel object which will delegate to the given channel aware object. Each logging call will call the getSyslogChannel() method on the given SyslogChannelAware object to get the channel name (or list of channel names) to send messages to.
See Also:
SyslogChannelAware

getAllChannel

public static Channel getAllChannel()
Get a Channel object for the "all" channel.

getDefaultChannel

public static Channel getDefaultChannel()
Get a Channel object for the default channel.

debug

public void debug(java.lang.Object caller,
                  java.lang.Object message)
Log a debug message.

debug

public void debug(java.lang.Object caller,
                  java.lang.Object message,
                  java.lang.Object detail)
Log a debug message.

info

public void info(java.lang.Object caller,
                 java.lang.Object message)
Log an info message.

info

public void info(java.lang.Object caller,
                 java.lang.Object message,
                 java.lang.Object detail)
Log an info message.

warning

public void warning(java.lang.Object caller,
                    java.lang.Object message)
Log a warning message.

warning

public void warning(java.lang.Object caller,
                    java.lang.Object message,
                    java.lang.Object detail)
Log a warning message.

error

public void error(java.lang.Object caller,
                  java.lang.Object message)
Log an error message.

error

public void error(java.lang.Object caller,
                  java.lang.Object message,
                  java.lang.Object detail)
Log an error message.

fatal

public void fatal(java.lang.Object caller,
                  java.lang.Object message)
Log a fatal message.

fatal

public void fatal(java.lang.Object caller,
                  java.lang.Object message,
                  java.lang.Object detail)
Log a fatal message.

log

public void log(java.lang.Object caller,
                java.lang.Throwable exception)
Log a message about the given exception. The toString() method on the exception is used as the log message. A stack trace from the exception is used as the message detail, and the message is logged at the ERROR level.

log

public void log(java.lang.Object caller,
                java.lang.Object message,
                java.lang.Object detail,
                int level)
Log a message.

crumb

public void crumb(java.lang.Object caller)
Log a breadcrumb at the debug level. The breadcrumb includes information from a StackTraceInfo object.

crumb

public void crumb()
Log a breadcrumb at the debug level. The breadcrumb includes information from a StackTraceInfo object.

Protomatter Software v1.1.8
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.8 http://protomatter.sourceforge.net/1.1.8