TraceEnableActivity PowerScript function
Description
Enables logging of the specified trace activity.
Syntax
|
1 |
<span>TraceEnableActivity</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 TraceEnableActivity after TraceBegin and
before TraceEnd
Usage
Call the TraceEnableActivity function following
the TraceOpen function. TraceEnableActivity allows
you to specify the types of activities you want logged in the trace
file. The default activity type logged is a user-defined activity
type identified by the value ActUser!. This activity is enabled
by the TraceOpen call. You must call TraceEnableActivity to
specify the activities to be logged before you call TraceBegin.
Each call to TraceOpen resets the activity
types to be logged to the default (that is, only ActUser! activities
are logged).
Since the ActError! and ActUser! values require the passing
of strings to the trace file, you must call the TraceError and TraceUser functions
to log this information.
Unless specifically disabled with a call to the TraceDisableActivity function, activities
that are enabled with TraceEnableActivity remain
enabled throughout the entire application run.
Examples
This example opens a trace file with the name you
entered in a single line edit box and a timer kind selected from
a drop-down list. Then it begins logging the enabled activities
for the first block of code to be traced:
|
1 |
TimerKindltk_kind |
|
1 |
|
1 |
CHOOSE CASE ddlb_timestamp.text |
|
1 |
CASE "None" |
|
1 |
ltk_kind = TimerNone! |
|
1 |
CASE "Clock" |
|
1 |
ltk_kind = Clock! |
|
1 |
CASE "Process" |
|
1 |
ltk_kind = Process! |
|
1 |
CASE "Thread" |
|
1 |
ltk_kind = Thread! |
|
1 |
END CHOOSE |
|
1 |
|
1 |
TraceOpen(sle_filename.text,ltk_kind) |
|
1 |
|
1 |
<span>TraceEnableActivity</span>(ActRoutine!) |
|
1 |
<span>TraceEnableActivity</span>(ActESQL!) |
|
1 |
<span>TraceEnableActivity</span>(ActGarbageCollect!) |
|
1 |
<span>TraceEnableActivity</span>(ActError!) |
|
1 |
<span>TraceEnableActivity</span>(ActCreateObject!) |
|
1 |
<span>TraceEnableActivity</span>(ActDestroyObject!) |
|
1 |
|
1 |
TraceBegin("Trace_block_1") |