|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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 |
public static final int LOGLEVEL_DEBUG
public static final int LOGLEVEL_INFO
public static final int LOGLEVEL_WARN
public static final int LOGLEVEL_ERROR
public static final int LOGLEVEL_FATAL
public static final java.lang.String LOGLEVEL_STR_DEBUG
public static final java.lang.String LOGLEVEL_STR_INFO
public static final java.lang.String LOGLEVEL_STR_WARN
public static final java.lang.String LOGLEVEL_STR_ERROR
public static final java.lang.String LOGLEVEL_STR_FATAL
public static final java.lang.String[] LOGLEVEL_STRINGS
String stopped = LOGLEVEL_STRINGS[LOGLEVEL_DEBUG];
| Method Detail |
public void init(java.lang.String instanceName)
throws LoggerException
LoggerException
public void log(int severity,
java.lang.String msg)
throws LoggerException
LoggerExceptionpublic void setLogLevel(int severity)
public int getLogLevel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||