|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LoggerI
Message logger (logging output stream).
Classes that implement this interface are encouraged (but not required) to have the following constructors:
class MyLoggerClass implements tribble.io.LoggerI { public MyLoggerClass() {...} public MyLoggerClass(java.io.PrintWriter out) {...} }
It is also recommended that implementations synchronize their write operations to their underlying output streams. (See java.io.Writer.lock for further details.)
Logger
Field Summary | |
---|---|
static int |
PFX__DFL
Prefixing flag: Default setting. |
static int |
PFX_DATE
Prefixing flag: Show the current date. |
static int |
PFX_LOC
Prefixing flag: Show the location name/title. |
static int |
PFX_NONE
Prefixing flag: None. |
static int |
PFX_TIME
Prefixing flag: Show the current time. |
static java.lang.String |
REV
Revision information. |
static short |
SEV_DEBUG
Severity level: Debug. |
static short |
SEV_ERROR
Severity level: Error. |
static short |
SEV_FATAL
Severity level: Fatal (unrecoverable) error. |
static short |
SEV_INFO
Severity level: Informational. |
static short |
SEV_INTERNAL
Severity level: Internal (unrecoverable) fatal error. |
static short |
SEV_WARNING
Severity level: Warning. |
Method Summary | |
---|---|
void |
close()
Close this message logger. |
void |
debug(int verb,
java.lang.String loc,
java.lang.String msg)
Write a formatted debugging message to this message logger. |
void |
error(java.lang.String loc,
java.lang.String msg)
Write a formatted error message to this message logger. |
void |
fatal(java.lang.String loc,
java.lang.String msg)
Write a formatted fatal error message to this message logger. |
java.io.PrintWriter |
getOutput()
Retrieve the underlying output stream for this message logger. |
void |
info(int verb,
java.lang.String loc,
java.lang.String msg)
Write a formatted informational message to this message logger. |
void |
log(int sev,
int verb,
java.lang.String loc,
java.lang.String msg)
Write a formatted message to this message logger. |
void |
setOutput(java.io.Writer out)
Establish the underlying output stream for this message logger. |
int |
setPrefix(int pfx)
Establish the prefixes to be prepended to messages written to this message logger. |
int |
setVerbosity(int sev,
int max)
Establish the verbosity filtering level for this message logger. |
void |
warning(int verb,
java.lang.String loc,
java.lang.String msg)
Write a formatted warning message to this message logger. |
Field Detail |
---|
static final java.lang.String REV
static final short SEV_DEBUG
static final short SEV_INFO
static final short SEV_WARNING
static final short SEV_ERROR
static final short SEV_FATAL
static final short SEV_INTERNAL
static final int PFX_NONE
static final int PFX_DATE
static final int PFX_TIME
static final int PFX_LOC
static final int PFX__DFL
Method Detail |
---|
void setOutput(java.io.Writer out)
out
- A logging output stream.java.io.PrintWriter getOutput()
void close()
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
int setPrefix(int pfx)
pfx
- Zero or more of the PFX_XXX
prefixing bitflag constants or-ed together.
int setVerbosity(int sev, int max)
sev
- The severity of the messages to be filtered.
This should be one of the SEV_XXX
constants, or zero to specify all message severities.max
- The maximum verbosity filtering level for messages written to
this message logger.
Log messages with a verbosity level not greater than this value will be
written to the logging output stream; those with a verbosity level greater
than this value will be ignored.
void log(int sev, int verb, java.lang.String loc, java.lang.String msg)
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
sev
- The severity of the message, which should be one of the
SEV_XXX constants.verb
- The verbosity level of the message.
The higher the level, the more verbose the message (i.e., the more
frequently the message is logged) and thus the more likely it will be
filtered and not written to the output stream; messages with a level of
zero will always be written to the output stream.loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.void debug(int verb, java.lang.String loc, java.lang.String msg)
SEV_DEBUG
.
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
verb
- The verbosity level of the message.
The higher the level, the more verbose the message (i.e., the more
frequently the message is logged) and thus the more likely it will be
filtered and not written to the output stream; messages with a level of
zero will always be written to the output stream.loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.void info(int verb, java.lang.String loc, java.lang.String msg)
SEV_INFO
.
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
verb
- The verbosity level of the message.
The higher the level, the more verbose the message (i.e., the more
frequently the message is logged) and thus the more likely it will be
filtered and not written to the output stream; messages with a level of
zero will always be written to the output stream.loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.void warning(int verb, java.lang.String loc, java.lang.String msg)
SEV_WARNING
.
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
verb
- The verbosity level of the message.
The higher the level, the more verbose the message (i.e., the more
frequently the message is logged) and thus the more likely it will be
filtered and not written to the output stream; messages with a level of
zero will always be written to the output stream.loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.void error(java.lang.String loc, java.lang.String msg)
SEV_ERROR
.
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.void fatal(java.lang.String loc, java.lang.String msg)
SEV_FATAL
.
Note that this method does not throw any checked exceptions, specifically java.io.IOException.
loc
- The name of the location (typically a thread or class name) from where the
log message originates. This serves as a label to prefix the message with
in the logging output stream. This can be empty ("") or null, in
which case no location is written.msg
- A text message to log.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |