|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.jusb.util.UsbTracer
public abstract class UsbTracer
Class to provide abstracted tracing for javax.usb implementation(s).
This allows the javax.usb implementations (common implementation and any platform implementations) to perform tracing in a generic manner, whose output can be controlled by the user and redirected to any desired trace package or function.
To use this tracing, either create a UsbTracer object yourself with the
getUsbTracer(name, level)
method and use that
object for all your tracing, or use the default/global UsbTracer object via
UsbTracer.getUsbTracer()
.
Each UsbTracer object has a default name and level. The name should be used by the UsbTracer implementation, possibly be prefixing the trace message with it. The level should be used by the UsbTracer implementation, usually by printing out only messages with a higher priority that the implementation's current priority setting (which is dependent on the implementation).
Field Summary | |
---|---|
static java.lang.String |
GLOBAL_TRACER_LEVEL_PROPERTY
|
static java.lang.String |
GLOBAL_TRACER_NAME_PROPERTY
|
static int |
TRACE_CRITICAL
|
static java.lang.String |
TRACE_CRITICAL_PROPERTY
|
static int |
TRACE_DEBUG
|
static java.lang.String |
TRACE_DEBUG_PROPERTY
|
static int |
TRACE_ERROR
|
static java.lang.String |
TRACE_ERROR_PROPERTY
|
static java.lang.String |
TRACE_IMPLEMENTATION_PROPERTY
|
static int |
TRACE_INFO
|
static java.lang.String |
TRACE_INFO_PROPERTY
|
static int |
TRACE_NOTICE
|
static java.lang.String |
TRACE_NOTICE_PROPERTY
|
static int |
TRACE_WARN
|
static java.lang.String |
TRACE_WARN_PROPERTY
|
Method Summary | |
---|---|
int |
getDefaultLevel()
Get the default level for this UsbTracer object. |
java.lang.String |
getDefaultName()
Get the default name for this UsbTracer object. |
static UsbTracer |
getUsbTracer()
Get the default/global UsbTracer. |
static UsbTracer |
getUsbTracer(java.lang.String name,
int level)
Get a new UsbTracer object with the specified name and level. |
void |
print(int level,
java.lang.String msg)
Trace message with this UsbTracer object's default name at the specified level. |
void |
print(java.lang.String msg)
Trace message with this UsbTracer object's default name and default level. |
abstract void |
print(java.lang.String name,
int level,
java.lang.String msg)
Trace message with the specified name at the specified level. |
void |
print(java.lang.String name,
java.lang.String msg)
Trace message with the specified name at this UsbTracer object's default level. |
void |
println(int level,
java.lang.String msg)
Trace message with this UsbTracer object's default name at the specified level. |
void |
println(java.lang.String msg)
Trace message with this UsbTracer object's default name and default level. |
void |
println(java.lang.String name,
int level,
java.lang.String msg)
Trace message with the specified name at the specified level. |
void |
println(java.lang.String name,
java.lang.String msg)
Trace message with the specified name at this UsbTracer object's default level. |
void |
setDefaultLevel(int level)
Set the default level for this UsbTracer object. |
void |
setDefaultName(java.lang.String name)
Set the default name for this UsbTracer object. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TRACE_IMPLEMENTATION_PROPERTY
public static final java.lang.String GLOBAL_TRACER_NAME_PROPERTY
public static final java.lang.String GLOBAL_TRACER_LEVEL_PROPERTY
public static final java.lang.String TRACE_CRITICAL_PROPERTY
public static final java.lang.String TRACE_ERROR_PROPERTY
public static final java.lang.String TRACE_WARN_PROPERTY
public static final java.lang.String TRACE_NOTICE_PROPERTY
public static final java.lang.String TRACE_INFO_PROPERTY
public static final java.lang.String TRACE_DEBUG_PROPERTY
public static final int TRACE_CRITICAL
public static final int TRACE_ERROR
public static final int TRACE_WARN
public static final int TRACE_NOTICE
public static final int TRACE_INFO
public static final int TRACE_DEBUG
Method Detail |
---|
public abstract void print(java.lang.String name, int level, java.lang.String msg)
name
- The name of the trace source.level
- The trace level of the message.msg
- The trace message.public void println(java.lang.String name, int level, java.lang.String msg)
This appends a newline to the message.
name
- The name of the trace source.level
- The trace level of the message.msg
- The trace message.public void print(java.lang.String name, java.lang.String msg)
name
- The name of the trace source.msg
- The trace message.public void println(java.lang.String name, java.lang.String msg)
This appends a newline to the message.
name
- The name of the trace source.msg
- The trace message.public void print(int level, java.lang.String msg)
level
- The trace level of the message.msg
- The trace message.public void println(int level, java.lang.String msg)
This appends a newline to the message.
level
- The trace level of the message.msg
- The trace message.public void print(java.lang.String msg)
msg
- The trace message.public void println(java.lang.String msg)
This appends a newline to the message.
msg
- The trace message.public void setDefaultName(java.lang.String name)
name
- The default name.public java.lang.String getDefaultName()
public void setDefaultLevel(int level)
level
- The default level.public int getDefaultLevel()
public static UsbTracer getUsbTracer(java.lang.String name, int level)
name
- The default trace name for the new UsbTracer.level
- The default trace level for the new UsbTracer.
public static UsbTracer getUsbTracer()
This should be used for easy tracing access. The default/global UsbTracer object is returned. Its name defaults to "Main UsbTracer" and level to TRACE_DEBUG. Both are settable from the javax.usb.properties file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |