Basic Tracing Service

Visual LANSA Framework

Basic Tracing Service

Applies to Windows and WAM.

The Framework manager provides a basic tracing service to help you locate problems in your filters or command handlers.

The tracing service can be used in conjunction with, or independently of, the normal LANSA application debugging and tracing facilities.

See tutorial VLF014WIN - Debugging/Tracing or VLF014WAM - Debugging/Tracing for step-by-step instructions of how to trace Framework applications.

In Windows and WAM Applications

In Windows applications you can add tracing capabilities to your applications by using one or more of the three available avRecordTrace methods:

avRecordTrace for general tracing:

Invoke #AvFrameworkManager.AvRecordTrace Component(#Com_Owner) 

       Event('The search button was clicked')

 

avRecordTraceAValue for tracing alphanumeric values:

Invoke #AvFrameworkManager.AvRecordTraceAValue Component(#Com_Owner) 

       AValue(#Empno) Event('Employee selected')

 

avRecordTraceNValue for tracing numeric values:

Invoke #AvFrameworkManager.AvRecordTraceNValue Component(#Com_Owner) 

       NValue(#Salary) Event('Salary found') 

 

The avRecordTrace methods will do nothing at all until tracing is turned on. This generally means that tracing operations can be left in your application with only minor performance overheads.

Tracing is turned on and off programmatically by setting the avTrace property:

Set #AvFrameworkManager avTrace(TRUE)

Set #AvFrameworkManager avTrace(FALSE)

 

If you are using the Framework as a designer you can turn tracing on or off by using the (Framework) -> (Tracing) -> Application Level or System Level menu options at any time.  

To trace values when a WAM first starts use a #avFrameworkManager.uInitialize event handler. Similarly to trace values as a WAM closes use a #avFrameworkManager.uTerminate event handler:

Trace values when WAM starts:

Evtroutine Handling(#avFrameworkManager.uInitialize) Options(*noclearmessages *noclearerrors)

 

 Invoke #AVFRAMEWORKMANAGER.avRecordTrace Component(#com_owner) Event('WAM Filter is initialising')

Endroutine

 

Trace values when WAM ends:

Evtroutine Handling(#avFrameworkManager.uTerminate) Options(*noclearmessages *noclearerrors)

 

 Invoke #AVFRAMEWORKMANAGER.avRecordTrace Component(#com_owner) Event('WAM Filter is terminating')

Endroutine