TraceEnableActivity

Description

Enables logging of the specified trace activity.

Syntax

TraceEnableActivity ( activity )

Argument

Description

activity

A value of the enumerated datatype TraceActivity that identifies the activity to be logged. Values are:

  • ActError! -- Occurrences of system errors and warnings

  • ActESQL! -- Embedded SQL statement entry and exit

  • ActGarbageCollect! -- Start and finish of garbage collection

  • ActLine! -- Routine line hits (if this value is enabled, ActRoutine! is automatically enabled)

  • ActObjectCreate! -- Object creation entry and exit

  • ActObjectDestroy! -- Object destruction entry and exit

  • ActProfile! -- Abbreviation for the ActRoutine!, ActESQL!, ActObjectCreate!, ActObjectDestroy, and ActGarbageCollect! values

  • ActRoutine! -- Routine entry and exit

  • ActTrace! -- Abbreviation for all activities except ActLine!


Return value

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:

TimerKind  ltk_kind
 
CHOOSE CASE ddlb_timestamp.text
CASE "None"
      ltk_kind = TimerNone!
CASE "Clock"
      ltk_kind = Clock!
CASE "Process"
      ltk_kind = Process!
CASE "Thread"
      ltk_kind = Thread!
END CHOOSE
 
TraceOpen(sle_filename.text,ltk_kind)
 
TraceEnableActivity(ActRoutine!)
TraceEnableActivity(ActESQL!)
TraceEnableActivity(ActGarbageCollect!)
TraceEnableActivity(ActError!)
TraceEnableActivity(ActCreateObject!)
TraceEnableActivity(ActDestroyObject!)
 
TraceBegin("Trace_block_1")

See also

TraceOpen

TraceBegin

TraceDisableActivity