Tracing

You can trace your exit while it is running under File Manager. To do this, the exit writes to a log file. To write to a log file, define a DD with the name CRALOG. It should be a sequential file with RECFM FB and LRECL 132.

FMNCRAEX uses a logging callback function so that different logging functions can be provided depending on the caller of FMNCRAEX. In the sample TEST program, the log output is simply DISPLAYed. When File Manager calls FMNCRAEX, as described above, it writes the log information to the predefined DD.

The callback mechanism means that logging calls should be written in the following style:

IF TRACELVL >= TRACEBAS THEN
   MOVE SPACES TO LOG-TEXT
   MOVE TRACELVL TO INT-TO-CHAR
   STRING "Initializing RAM, TRACELVL = " DELIMITED BY SIZE
          INT-TO-CHAR                     DELIMITED BY SIZE
     INTO LOG-TEXT
  CALL LOGFUNC USING LOG-HOST, LOG-MODULE, LOG-TEXT
END-IF.

The levels provided for tracing are:

TRACEOFF
No tracing
TRACEERR
Trace only error messages
TRACEBAS
Trace basic exit function
TRACEFUL
Trace everything