|
|
|||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.syslog.Channel
A utility class for writing log messages to channels. Example usage of this class is as follows:
// get the channel object Channel myChannel = Channel.getChannel("MY CHANNEL"); myChannel.info(this, "Hello there"); // get the default chanel object Channel default = Channel.getDefaultChannel(); default.info(this, "Hello there"); // You can also write to multiple channels String channels[] = new String[] { "first-channel", "second-channel" }; Channel lotsaChannels = Channel.getChannel(channels); lotsChannels.info(this, "Hello there"); // And finally, you can delegate the list of channels to // an object that implements the SyslogChannelAware interface SyslogChannelAware channelAware = new MyChannelAwareObject(); Channel delegatedChannel = Channel.getChannel(channelAware); delegatedChannel.info(this, "Hello there"); |
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 |
public static final Channel ALL
public static final Channel DEFAULT
Method Detail |
public java.lang.String[] getChannelNames()
public static Channel getChannel(java.lang.String channelName)
public static Channel getChannel(java.lang.Class channelClass)
public static Channel forPackage(java.lang.Class someClass)
public static Channel getChannel(java.lang.String[] channels)
public static Channel getChannel(SyslogChannelAware channelAware)
SyslogChannelAware
public static Channel getAllChannel()
public static Channel getDefaultChannel()
public void debug(java.lang.Object caller, java.lang.Object message)
public void debug(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
public void info(java.lang.Object caller, java.lang.Object message)
public void info(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
public void warning(java.lang.Object caller, java.lang.Object message)
public void warning(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
public void error(java.lang.Object caller, java.lang.Object message)
public void error(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
public void fatal(java.lang.Object caller, java.lang.Object message)
public void fatal(java.lang.Object caller, java.lang.Object message, java.lang.Object detail)
public void log(java.lang.Object caller, java.lang.Throwable exception)
public void log(java.lang.Object caller, java.lang.Object message, java.lang.Object detail, int level)
public void crumb(java.lang.Object caller)
public void crumb()
|
Protomatter Software v1.1.8 Copyright 1998-2002 Nate Sammons |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Software v1.1.8 | http://protomatter.sourceforge.net/1.1.8 |