public final class Trace
extends java.lang.Object
OpenORB Debug Verbostity Description --------------------------------------------------------------------- - level 0 / LOW : low verbosity - level 1 / MEDIUM: medium verbosity - level 2 / HIGH : high verbosity
| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
HIGH
Debug verbosity HIGH (Only applies when priority DEBUG).
|
static ControllableLogger.Control |
LOGGER_CONTROL
A logger control that uses the debug level setting of this class.
|
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).
|
| Modifier and Type | Method and Description |
|---|---|
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 Logger |
getLogger()
Returns the default logger.
|
static 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 Logger |
getNewLogger(Priority priority)
Creates a new instance of the logger.
|
static 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 |
isGIOPHeaderOK(byte[] buf,
int off)
This method performs a sanity check of a GIOP header at the
specified offset.
|
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(Logger logger)
Sets the default logger.
|
static void |
setLoggerOutputStream(java.io.OutputStream os)
Set another output stream for the logger.
|
static java.lang.Error |
signalIllegalCondition(Logger optionalLogger,
java.lang.String message)
This method is invoked to indicate that an illegal condition
has occurred, typically an assertion error.
|
public static final ControllableLogger.Control LOGGER_CONTROL
public static final int OFF
public static final int LOW
public static final int MEDIUM
public static final int HIGH
public static Logger getLogger()
public static 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 void setLoggerOutputStream(java.io.OutputStream os)
os - The OutputStream to send log output to.public static Logger getNewLogger(Priority priority)
priority - the priority of the logger to createpublic static void setLogger(Logger logger)
logger - A logger instance or null.public static 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(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 nullmessage - the message to log and throw,
permitted to be nullpublic static boolean isGIOPHeaderOK(byte[] buf,
int off)
buf - The message buffer.off - The offset at which to check for the GIOP header.