public final class Trace extends Object
example:
Trace oDataTrace = new Trace("data", ResId.DataTraceHelp);
Trace oStringTrace new Trace("string" ResId.StringTraceHelp);
main(...)
{
TraceHandler oTraceHandler = new TraceHandler();
TraceHandler.registerTraceHandler(oTraceHandler);
// two ways to activate
oTraceHandler.activate("data", 2);
oStringTrace.activate(3);
...
oTraceHandler.trace(oDataTrace, 2, 27, "data msg"); // issue message
...
oDataTrace.trace(2, 33, "string msg"); // issue message
...
}
| Constructor and Description |
|---|
Trace(String sName,
int nHelpId)
Constructor
Registers the trace with a global storage area.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate(int nLevel)
Activates this trace section for the current thread
|
void |
deactivate()
Deactivates this trace section for the current thread
|
int |
getHelpId() |
String |
getName()
Returns the name of this trace section
|
boolean |
isEnabled(int nLevel)
Check if this trace section is enabled on the current thread.
|
static boolean |
isEnabled(String sName,
int nLevel)
Check if this trace section is enabled on the current thread
|
void |
trace(int nLevel,
int nId,
String sMsg)
Issues a trace message.
|
void |
trace(int nLevel,
MsgFormatPos oMsg)
Issues a trace message.
|
static void |
trace(String sName,
int nLevel,
int nId,
String sMsg)
Issues a trace message on the current thread.
|
static void |
trace(String sName,
int nLevel,
MsgFormatPos oMsg)
Issues a trace message.
|
public Trace(String sName, int nHelpId)
sName - the name of the trace section for which the message will be issuednHelpId - the message Id associated with a one-line help message for this trace section.public static boolean isEnabled(String sName, int nLevel)
sName - - the name of the trace section for which the message will be issuednLevel - - the detail level of the messages allowed,public static void trace(String sName, int nLevel, int nId, String sMsg)
sName - the name of the trace section for which the message will be issuednLevel - the detail level of the message, 1 for high level information,
3 for detailed information.nId - the message Id.sMsg - the message text.public static void trace(String sName, int nLevel, MsgFormatPos oMsg)
sName - the name of the trace section for which the message will be issuednLevel - the detail level of the message, 1 for high level information, 3 for detailed information.oMsg - the message for the trace.public void activate(int nLevel)
nLevel - the detail level of the messages allowed, 1 for high level information, 3 for detailed information.public void deactivate()
public int getHelpId()
public String getName()
public boolean isEnabled(int nLevel)
nLevel - the detail level of the messages allowed,public void trace(int nLevel,
int nId,
String sMsg)
nLevel - the detail level of the message, 1 for high level information, 3 for detailed information.nId - the message Id.sMsg - the message text.public void trace(int nLevel,
MsgFormatPos oMsg)
nLevel - the detail level of the message, 1 for high level information, 3 for detailed information.oMsg - the message for the trace.Copyright © 2010 - 2020 Adobe. All Rights Reserved