|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Logger
The Logger interface defines methods and constants used for logging messages and events. Logger implementations must be properly synchronized so that logfile messages do not become garbled in the event of multiple simultaneous calls to a log method. It is worth noting that several nodes running off the same root node may share a single Logger instance.
Logging is a critical system function, so any exception thrown by
a Logger will likely result in a node shutdown, or a systemwide
shutdown.
The Logger interface can be mapped directly to a variety of standard
logging implementations including java.util.logging.Logger, log4j etc.
This interface solely reflects the requirements of the generated SAND
code w/r/t logging. It is highly recommended that logging be a
lightweight, fast, local operation, with any information distribution
taking place at the application level.
| Field Summary | |
|---|---|
static int |
LOGLEVEL_DEBUG
|
static int |
LOGLEVEL_ERROR
|
static int |
LOGLEVEL_FATAL
|
static int |
LOGLEVEL_INFO
|
static java.lang.String |
LOGLEVEL_STR_DEBUG
|
static java.lang.String |
LOGLEVEL_STR_ERROR
|
static java.lang.String |
LOGLEVEL_STR_FATAL
|
static java.lang.String |
LOGLEVEL_STR_INFO
|
static java.lang.String |
LOGLEVEL_STR_WARN
|
static java.lang.String[] |
LOGLEVEL_STRINGS
The order of elements in this array is important; it's set up so that you can use one of the LOGLEVEL_* constants to look up a LOGLEVEL_STR_* constant. |
static int |
LOGLEVEL_WARN
|
| Method Summary | |
|---|---|
int |
getLogLevel()
Return the log level. |
void |
init(java.lang.String instanceName)
Initialize this logger with a unique identifying name used to determine the source of a message during logfile analysis. |
void |
log(int severity,
java.lang.String msg)
Log a message. |
void |
setLogLevel(int severity)
Set the level for this logger. |
| Field Detail |
|---|
static final int LOGLEVEL_DEBUG
static final int LOGLEVEL_INFO
static final int LOGLEVEL_WARN
static final int LOGLEVEL_ERROR
static final int LOGLEVEL_FATAL
static final java.lang.String LOGLEVEL_STR_DEBUG
static final java.lang.String LOGLEVEL_STR_INFO
static final java.lang.String LOGLEVEL_STR_WARN
static final java.lang.String LOGLEVEL_STR_ERROR
static final java.lang.String LOGLEVEL_STR_FATAL
static final java.lang.String[] LOGLEVEL_STRINGS
String stopped = LOGLEVEL_STRINGS[LOGLEVEL_DEBUG];
| Method Detail |
|---|
void init(java.lang.String instanceName)
throws LoggerException
LoggerException
void log(int severity,
java.lang.String msg)
throws LoggerException
LoggerExceptionvoid setLogLevel(int severity)
int getLogLevel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||