TraceDisableActivity PowerScript function
Description
Disables logging of the specified trace activity.
Syntax
|
1 |
<span>TraceDisableActivity</span> ( <span>activity</span> ) |
|
Argument |
Description |
|---|---|
|
activity |
A value of the enumerated datatype TraceActivity
|
Return Values
ErrorReturn. Returns one of the following values:
-
Success! – The function
succeeded -
FileNotOpenError! – TraceOpen has not been
called yet -
TraceStartedError! – You have called TraceDisableActivity
after TraceBegin and before TraceEnd
Usage
Use this function to disable the logging of the specified
trace activities. You typically use this function if you are tracing
only portions of an application run (and thus you are calling TraceBegin multiple
times) and you want to log different activities during each portion
of the application.
Unless specifically disabled with TraceDisableActivity,
activities that were previously enabled with a call to the TraceEnableActivity function
remain enabled throughout the entire application run.
You must always call the TraceEnd function
before calling TraceDisableActivity.
Examples
This example logs the enabled activities for the
first block of code to be traced. Then it stops logging and disables
two activity types for a second trace block. When logging is resumed
for another portion of the application run, the activities that
are not specifically disabled remain enabled until TraceClose is called:
|
1 |
TraceEnableActivity(ActESQL!) |
|
1 |
TraceEnableActivity(ActGarbageCollect) |
|
1 |
TraceEnableActivity(ActObjectCreate!) |
|
1 |
TraceEnableActivity(ActObjectDestroy!) |
|
1 |
|
1 |
TraceBegin("Trace_block_1") |
|
1 |
|
1 |
TraceEnd() |
|
1 |
|
1 |
<span>TraceDisableActivity</span>(ActESQL!) |
|
1 |
<span>TraceDisableActivity</span>(ActGarbageCollect!) |
|
1 |
|
1 |
TraceBegin("Trace_block_2") |