Skip to Content

How to write custom information inside isCOBOL log file

Estimated Reading Time: 1 Minutes

isCOBOL supports a library routine named "C$WRITELOG".
This routine will add custom information to an isCOBOL log file.
When running with the configuration iscobol.tracelevel set to a value greater than 0, the parameter that is sent to C$WRITELOG will be written in the log file.

Code example:

   string "before apply-discount, w-price=" w-price into logline
   perform CALL-WRITELOG
CALL-WRITELOG.
   call "C$WRITELOG" using logline
   initialize logline

These are some lines of isCOBOL logfile created with iscobol.tracelevel=15:

 Info: ENTER PARAGRAPH 'CALL-WRITELOG' [MYPROG]
 Info: before apply-discount, w-price= 0000061.31
 Info: EXIT PARAGRAPH 'CALL-WRITELOG' [MYPROG]
 Info: ENTER PARAGRAPH 'APPLY-DISCOUNT' [MYPROG]
 Info: EXIT PARAGRAPH 'APPLY-DISCOUNT' [MYPROG]
 Info: ENTER PARAGRAPH 'CALL-WRITELOG' [MYPROG]
 Info: after apply-discount, w-price= 0000055.17
 Info: EXIT PARAGRAPH 'CALL-WRITELOG' [MYPROG]
 Info: EXIT PROGRAM 'MYPROG' }

How to write custom information inside isCOBOL log file

Powered by PHPKB (Knowledge Base Software)