Ultra Light Client Guide and Reference

Defining application-specific debugging aspects

Although the application owns the aspects, the values of these aspects are defined by UlcDebugger and can be different in every image. You set these as follows:

  1. Define aspect names in the _PRAGMA_ method of your application.
    _PRAGMA_UlcExampleDebugAspectConstants
     "%%PRAGMA DECLARE
     (name: UlcExampleDebugAspectConstants isPool: true)
     (pool: UlcExampleDebugAspectConstants declarations: (
     (name: UlcCustomDebugAspectOne isConstant: false )
     (name: UlcCustomDebugAspectTwo isConstant: false )
     ))
     "
    

    Always set the isConstant flag to false. If you do not, the pool entry is marked read-only, and the value defined by UlcDebugger cannot be assigned (step 2).

  2. Initialize the aspects defined in step 1.
    SomeApplication class>>#loaded
       UlcExampleDebugAspectConstants::UlcCustomDebugAspectOne :=
          UlcDebugger nextAspectIdentifier.
       UlcExampleDebugAspectConstants::UlcCustomDebugAspectTwo :=
          UlcDebugger nextAspectIdentifier. 
       UlcDebugger
          addAspect: UlcExampleDebugAspectConstants::UlcCustomDebugAspectOne
          text: 'name of the first aspect as shown in the selection prompter'.
       UlcDebugger
          addAspect: UlcExampleDebugAspectConstants::UlcCustomDebugAspectTwo
          text: 'name of the second aspect as shown in the selection prompter'.
    
  3. Use the aspects in application code.
    SomeObject>>#someMethod
        ...
        UlcSystem default
          ulcDebug: UlcCustomDebugAspectTwo
          print: ['some text shown in the trace'].
        ...
    
  4. Remove the aspects previously defined.
    SomeApplication class>>#removing
       UlcDebugger
          removeAspect: UlcExampleDebugAspectConstants::UlcCustomDebugAspectOne
          removeAspect: UlcExampleDebugAspectConstants::UlcCustomDebugAspectTwo
    


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]