|
Peer locator v1.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.unet.warmachine.peerlocator.Logger
This class is a simple logger and is used for debugging purposes. Messages logged by this class are displayed on standard output or can be diverted to file. Messages are associated with a severity and category. Each category can be configured to suppress messages of a specific severity or lower. All variables and functions are static, so no instance needs to be referenced but multiple Loggers can't exist.
| Field Summary | |
static int |
CATEGORY_CONNECTION
Acknowledgement/rejection of connections between agents. |
static int |
CATEGORY_DEBUG
Various debugging information. |
static int |
CATEGORY_MEMBER_EXCH
Events concerning new members, exchange of membership lists and location. |
static int |
CATEGORY_MESSAGE_RCVD
Details of incoming messages. |
static int |
CATEGORY_MESSAGE_SENT
Details of outgoing messages. |
static int |
CATEGORY_SEARCH
Search algorithm for other agents. |
static int |
CATEGORY_SERVICE_REQ
Service requests and results of public interfaces. |
static int |
CATEGORY_SOCKET
Creation and deletion of sockets. |
static int |
CATEGORY_STARTSTOP
Startup/shutdown information. |
static int |
CATEGORY_TESTCLIENT
Reserved for agent clients. |
static boolean |
logOn
Whether logging is enabled. |
static int |
SEVERITY_DETAIL1
Provides medium level information such as algorithm results, service configuration or events. |
static int |
SEVERITY_DETAIL2
Provides low level information. |
static int |
SEVERITY_ERROR
The highest severity level and indicates a function has failed or exception that can't be handled. |
static int |
SEVERITY_INFO
Provides high level information such as start or end of major service. |
static int |
SEVERITY_NONE
This severity level is used by setCategoryMask() to suppress all messages of a category; it is not a message severity itself. |
static int |
SEVERITY_TRACE
Records trace of function entry and exits with parameters and results. |
static int |
SEVERITY_WARNING
Indicates an unexpected or erroneous condition that does not make function fail and can be ignored or an exception that can be handled. |
| Method Summary | |
static int |
getCategoryMask(int category)
Returns lowest severity level that can be displayed for category. |
static long |
getLogMask()
Returns complete category suppression list encoded as 32-bit integer. |
static void |
logMessage(int category,
int severity,
java.lang.String message)
Displays message to standard output, file or output stream as configured. |
static void |
logMessage(int category,
int severity,
java.lang.String message,
java.lang.Exception e)
Displays message, exception class, message and stack trace to standard output, file or output stream as configured. |
static void |
setCategoryMask(int category,
int severity)
Sets lowest severity level that can be displayed for category. |
static void |
setLogFile(java.lang.String filename)
Sets output log file. |
static void |
setLogMask(int logMask)
Sets category suppression list encoded as 32-bit integer. |
static void |
setLogStream(java.io.OutputStream outStream)
Sets output stream for logging messages. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final boolean logOn
public static final int SEVERITY_NONE
public static final int SEVERITY_ERROR
public static final int SEVERITY_WARNING
public static final int SEVERITY_INFO
public static final int SEVERITY_DETAIL1
public static final int SEVERITY_DETAIL2
public static final int SEVERITY_TRACE
public static final int CATEGORY_DEBUG
public static final int CATEGORY_TESTCLIENT
public static final int CATEGORY_SERVICE_REQ
public static final int CATEGORY_STARTSTOP
public static final int CATEGORY_SOCKET
public static final int CATEGORY_MESSAGE_RCVD
public static final int CATEGORY_MESSAGE_SENT
public static final int CATEGORY_CONNECTION
public static final int CATEGORY_SEARCH
public static final int CATEGORY_MEMBER_EXCH
| Method Detail |
public static long getLogMask()
public static void setLogMask(int logMask)
logMask - Encoded category suppression list.public static int getCategoryMask(int category)
category - See CATEGORY_ constants.
public static void setCategoryMask(int category,
int severity)
category - See CATEGORY_ constants.severity - Lowest, displayed severity level for category.
public static void setLogFile(java.lang.String filename)
throws java.io.FileNotFoundException
filename - Filename of log file.java.io.FileNotFoundException - Error creating or opening file.public static void setLogStream(java.io.OutputStream outStream)
outStream - Output stream.
public static void logMessage(int category,
int severity,
java.lang.String message)
category - Category of message. See CATEGORY_ constants.severity - Severity level of message. See SEVERITY_ constants.message - Message to output.
public static void logMessage(int category,
int severity,
java.lang.String message,
java.lang.Exception e)
category - Category of message. See CATEGORY_ constants.severity - Severity level of message. See SEVERITY_ constants.message - Message to output.e - Exception to display, with stack trace.
|
Peer locator v1.0 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||