5.5.7 Tracing Tips

When using __TRACE and __LOG macros in your code, consider the following:

  • Focus on one area of an application and place __TRACE and __LOG macros so that they form a “flow” in the Trace window. That way, you can follow the execution flow and debug the application based on missing/incorrect trace points or an abrupt end to the trace flow.
  • Use __TRACE and __LOG macros with conditional statements in your code to aid in debugging. Example: When a variable reaches a certain value, start logging it.
     If(var > 5)
     {
     __LOG(ID, var)
     }
  • Leave __TRACE and __LOG macros in your code for future debugging, if this is allowable, i.e., go to Project Properties>ICE4>Trace and select “Disable Trace Macros.”