|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openorb.util.Trace
This class provides methods to display trace messages. The trace levels are defined by the Avalon LogKit Priority class. In order to control the verbostity of the DEBUG priority there are three levels available:
OpenORB Debug Verbostity Description --------------------------------------------------------------------- - level 0 / LOW : low verbosity - level 1 / MEDIUM: medium verbosity - level 2 / HIGH : high verbosity
Inner Class Summary | |
static class |
Trace.IllegalConditionError
A specialization of Error for signalling the occurrence of an illegal condition. |
static class |
Trace.StackSnapshot
This class is intended to expose a stack trace for debug logging. |
Field Summary | |
static int |
HIGH
Debug verbosity HIGH (Only applies when priority DEBUG). |
static int |
LOW
Debug verbosity LOW (Only applies when priority DEBUG). |
static int |
MEDIUM
Debug verbosity MEDIUM (Only applies when priority DEBUG). |
static int |
OFF
Debug verbosity OFF (Only applies when priority DEBUG). |
Constructor Summary | |
Trace()
|
Method Summary | |
static java.lang.String |
bufferToString(java.lang.String msg,
byte[] buffer)
Convert a byte buffer into its hexadecimal string representation. |
static java.lang.String |
bufferToString(java.lang.String msg,
StorageBuffer buf)
Convert a byte buffer into its hexadecimal string representation. |
static int |
getDebugLevel()
Get the debug verbosity level. |
static int |
getDebugLevelFromName(java.lang.String level)
Convert the stringified representation into the debug level. |
static org.apache.avalon.framework.logger.Logger |
getLogger()
Returns the default logger. |
static org.apache.avalon.framework.logger.Logger |
getLogger(java.util.Properties props)
Returns the default logger. |
static java.lang.String |
getNameOfDebugLevel(int level)
Get the stringified representation of the debug verbosity level. |
static org.apache.avalon.framework.logger.Logger |
getNewLogger(org.apache.log.Priority priority)
Creates a new instance of the logger. |
static org.apache.log.Priority |
getPriorityFromName(java.lang.String priority)
Convert the stringified representation into the trace priority. |
static boolean |
isEnabled(int value)
Returns true if the trace level is at equal to or greater than the supplied value. |
static boolean |
isHigh()
Returns true is the debugging verbosity level is set below or equal to HIGH. |
static boolean |
isLow()
Returns true if the debugging verbosity level is set below or equal to LOW. |
static boolean |
isMedium()
Returns true if the debugging verbosity level is set below or equal to MEDIUM. |
static void |
setDebugLevel(int newLevel)
Set the debug verbosity level. |
static void |
setLogger(org.apache.avalon.framework.logger.Logger logger)
Sets the default logger. |
static java.lang.Error |
signalIllegalCondition(org.apache.avalon.framework.logger.Logger optionalLogger,
java.lang.String message)
This method is invoked to indicate that an illegal condition has occurred, typically an assertion error. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int OFF
public static final int LOW
public static final int MEDIUM
public static final int HIGH
Constructor Detail |
public Trace()
Method Detail |
public static org.apache.avalon.framework.logger.Logger getLogger()
public static org.apache.avalon.framework.logger.Logger getLogger(java.util.Properties props)
props
- Properties that may contain a
"openorb.debug.trace=FATAL|ERROR|WARN|INFO|DEBUG or 0|1|2|3|4"
property which uses the value to create a priority.public static org.apache.avalon.framework.logger.Logger getNewLogger(org.apache.log.Priority priority)
priority
- the priority of the logger to createpublic static void setLogger(org.apache.avalon.framework.logger.Logger logger)
logger
- A logger instance or null.public static org.apache.log.Priority getPriorityFromName(java.lang.String priority)
priority
- The priority name.public static int getDebugLevelFromName(java.lang.String level)
level
- The name of the debug level.public static void setDebugLevel(int newLevel)
newLevel
- The new debug verbosity level for this process.public static int getDebugLevel()
public static java.lang.String getNameOfDebugLevel(int level)
level
- The debug verbosity's integer value.public static boolean isEnabled(int value)
value
- the debug verbosity level to test.public static boolean isLow()
public static boolean isMedium()
public static boolean isHigh()
public static java.lang.String bufferToString(java.lang.String msg, byte[] buffer)
msg
- A text describing the buffer to be shown.buffer
- The buffer to show the hex dump of.public static java.lang.String bufferToString(java.lang.String msg, StorageBuffer buf)
msg
- A text describing the buffer to be shown.buf
- The StorageBuffer to show the hex dump of. ATTENTION: This
is an expensive operation, because internally buf.linearize() is called
which creates a copy of the buffer. For large buffers this can be a
problem concerning memory consumption.public static java.lang.Error signalIllegalCondition(org.apache.avalon.framework.logger.Logger optionalLogger, java.lang.String message)
IllegalConditionError
with the passed message.
The client can optionally
pass their preferred logger to be used instead the default.
The client also passes a message to log and throw.
The method will handle a null
message gracefully so that
an IllegalConditionError
will always be thrown.
optionalLogger
- a logger to use instead of the default,
permitted to be null
message
- the message to log and throw,
permitted to be null
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |