How to enable 'Application Level Tracing' in a Windows RAMP applications in End User mode?

Date:1st of February 2008
Product/Release:Visual LANSA Framework EPC826
Abstract:To enable application tracing for deployed Windows RAMP applications
Submitted By:LANSA Technical Support

It is possible to programmatically trace a Windows RAMP application as an End User (e.g. when executing UF_EXEC) either during development or after deployment.

Create a Visual LANSA reusable part as a Filter with the following code:

FUNCTION OPTIONS(*DIRECT)
BEGIN_COM ROLE(*EXTENDS #VF_AC007) HEIGHT(138) LAYOUTMANAGER(#ATLM_1) WIDTH(303)
* =============================================================================
* Component definitions
* =============================================================================

DEFINE_COM CLASS(#PRIM_PHBN) NAME(#PHBN_TRACE) CAPTION('Start Tracing') DISPLAYPOSITION(1) LEFT(8) PARENT(#PANL_BRIGHT) TABPOSITION(1) TOP(5)

* Layout Management

DEFINE_COM CLASS(#PRIM_PANL) NAME(#DATA_PANEL) DISPLAYPOSITION(1) HEIGHT(102) LAYOUTMANAGER(#FWLM_1) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(303)
DEFINE_COM CLASS(#PRIM_PANL) NAME(#BUTTON_PANEL) DISPLAYPOSITION(2) HEIGHT(36) LAYOUTMANAGER(#SPLM_1) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(102) WIDTH(303)
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) MARGINLEFT(4) MARGINTOP(4) SPACING(4) SPACINGITEMS(4)
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1)
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#DATA_PANEL) PARENT(#ATLM_1)
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Bottom) MANAGE(#BUTTON_PANEL) PARENT(#ATLM_1)
DEFINE_COM CLASS(#PRIM_SPLM) NAME(#SPLM_1) DIVIDERSTYLE(Gap) ORIENTATION(Vertical)
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_BLEFT) DISPLAYPOSITION(1) HEIGHT(36) HINT(*MTXTDF_FILT1) LEFT(0) PARENT(#BUTTON_PANEL) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(211)
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_BRIGHT) DISPLAYPOSITION(2) HEIGHT(36) HINT(*MTXTDF_FILT1) LEFT(211) PARENT(#BUTTON_PANEL) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(92)
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_BLEFT) MANAGE(#PANL_BLEFT) PARENT(#SPLM_1) SIZABLE(False) WEIGHT(1)
DEFINE_COM CLASS(#PRIM_SPLI) NAME(#SPLI_BRIGHT) MANAGE(#PANL_BRIGHT) PARENT(#SPLM_1) SIZABLE(False)
* =============================================================================
* Event Handlers
* =============================================================================

* Trace button pressed

Evtroutine Handling(#phbn_trace.Click) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
set #avSystem avTrace(True)
Endroutine
End_Com

This will produce a tracing window when the 'Start Tracing' button is pressed:

Example Application Level Trace Details screen.

With this tracing facility you can save tracing information into a text file or display trace information interactively to help troubleshooting Windows RAMP applications.