|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.penlet.Logger
public class Logger
Logger provides methods to log application messages. The
following are the various log levels supported.
An instance of Logger is automatically created for every
Penlet implementation and can be got from Penlet.logger. If
the penlet has specified Penlet.LOG_MASK_PROPERTY in its application
config file, then that is used as the mask for the Penlet.logger or
else the DEFAULT_MASK is used.
| Field Summary | |
|---|---|
static short |
DEFAULT_MASK
Default mask that has all the mask turned on. |
protected short |
mask
|
static short |
MASK_DEBUG
Debug mask. |
static short |
MASK_INFO
Information mask. |
static short |
MASK_TEST
Test mask. |
static short |
MASK_WARN
Warning mask. |
| Constructor Summary | |
|---|---|
protected |
Logger(String name,
PrintStream stream,
short mask)
Construct a Logger instance. |
| Method Summary | |
|---|---|
void |
debug(String msg)
Log the msg on the log stream if debug level is enabled. |
void |
error(String msg)
Log the msg on the log stream always. |
void |
info(String msg)
Log the msg on the log stream if info level is enabled. |
void |
setMask(short mask)
Set the log level mask. |
void |
test(String msg)
Sends the msg to the test agent on the pen if test level is enabled. |
void |
warn(String msg)
Log the msg on the log stream if warning level is enabled. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short MASK_DEBUG
setMask(short),
Constant Field Valuespublic static final short MASK_INFO
setMask(short),
Constant Field Valuespublic static final short MASK_WARN
setMask(short),
Constant Field Valuespublic static final short MASK_TEST
test(String) will send the
message to the test agent.
setMask(short),
Constant Field Valuespublic static final short DEFAULT_MASK
setMask(short),
Constant Field Valuesprotected short mask
| Constructor Detail |
|---|
protected Logger(String name,
PrintStream stream,
short mask)
Logger instance.
name - name for the logger instance. This should be a
non-null value.stream - print stream where the log messages should be output.This
should be a non-null value.mask - to enable/disable log levels.| Method Detail |
|---|
public void setMask(short mask)
mask - log level mask.MASK_DEBUG,
MASK_INFO,
MASK_TEST,
MASK_WARNpublic void debug(String msg)
msg - log messagepublic void info(String msg)
msg - log messagepublic void warn(String msg)
msg - the log messagepublic void error(String msg)
msg - log messagepublic void test(String msg)
msg - log message
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||