Reply To: Logging related questions

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Logging related questions Reply To: Logging related questions

#57818
Charlie Bursell
Participant

    FWIW there is a library routine already provided that is excellent for debugging.  The procedure name is dputs.

    The naet thing about dputs is that is uses the global _DEBUG_.  If this global is not defined, dputs becomes a NOP thus saving CPU time.  If the global is defined and set to 0, no debug output.  If set to non-zero you get debug output.

    For example, if I have a proc named filterHL7 and I put the following somewhere in my code:

    dputs “THIS IS AN ERROR MESSAGE”

    and if the global _DEBUG_ exists and is set to non-zero, I get:

    debug: (filterHL7) THIS IS AN ERROR

    This proc is located in the library: $HCIROOT/tcl/lib/cloverleaf/GUI.tlib

    I modify mine to give the threadname as well as the procname so the output would be something like:

    debug: (mythread/filterHL7) THIS IS AN ERROR

    Simple to modify the proc, I’ll leave it to you.

    Charlie