JeeWiz Home  
The Model-Driven System Builder

JeeWiz Architect's Guide
 
Contents  >   8.  Templates and Velocity Features
 


8.6 #trace

The #trace() directive is a simple debugging aid. It switches on tracing, which gives a reasonably complete account of the operation of the interpreter such as:

     [java] Trace   11 #if          fails:  $node.description 
     [java] Trace   14 #set         $extras remains null
     [java] Trace   22 #if          succeeds:  $attrsAsSetMap.xmi_id 
     [java] Trace   24 #set            $attrsAsSetMap.uid = "TC_B1E8A6A6"
     [java] Trace   30 #set         $knownNamesList = [name, type, xsType], class=java.util.ArrayList
     [java] Trace   32 #set         $firstLine = true
     [java] Trace   33 #foreach     iteration 1: key=name
     [java] Trace   34 #if             succeeds:  $attrsAsSetMap.get( $key ) 

 8.6.1  The #trace directive
 8.6.2  The 'traceExecution' flag

8.6.1  The #trace directive
Trace can be switched on and off for interesting sections of code. #trace() and #trace(true) have the same effect - to turn tracing on. #trace(false) turns tracing off.

When tracing is turned on in this way, the setting propagates into called methods and macros, or #parse'd files.
8.6.2  The 'traceExecution' flag
Tracing can also be turned on by default for the whole build by setting the 'traceExecution' flag for the build.

You turn this on by setting the traceExecution=true at start of day. You can do this when starting JeeWiz
ant "-Dpass3=-DtraceExecution=true"
or in a build properties file, with the line
traceExecution=true
When this is set, you can still use #trace(false) to turn it off - but will have to do this in every template where you want to stop tracing. Therefore, 'traceExecution' is useful in the very early stages of developing a new meta-model rendering. As the rendering gets more complicated, setting traceExecution off will become necessary.  


Copyright (c) 2001-2008 New Technology/enterprise Ltd.