trx proc echo statements

Clovertech Forums Cloverleaf trx proc echo statements

  • Creator
    Topic
  • #118126
    Paul Stein
    Participant

      I am curious if other cloverleaf users keep the trxID proc echo statements for trxID and module or if you comment those out in PROD?

      Probably a matter of preference I suppose, as I see a benefit to keeping the echo but that fills up the log files quickly.

      I tend to rely on the errodb for unsupported trxIDs, however wanted some advise from the community. Any help appreciated.

    Viewing 5 reply threads
    • Author
      Replies
      • #118127
        Jim Kosloskey
        Participant

          If on your release you can pass arguments at that UPoC position, why not pass a switch then interrogate that switch and echo only if it is on?

          Leave the switch on in Test, turn it off for Prod.

          If arguments cannot be passed then you can use a Lookup table for the switch using a unique table name base on the IB thread name with something like ‘trxid’ appended. Your proc will need to look for that Table using the thread name and get the switch from the table.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #118128
          Paul Stein
          Participant

            Jim – great  idea. Make sure I understand.

            Pass the whole switch statement as an argument or include the switch statement in the proc and send uargs from the UPoC GUI to turn on/off via interrogating the uarg in the switch?

          • #118129
            Jim Kosloskey
            Participant

              If the TrxID UPoC Configuration allows for expressing arguments (I do not know that it does), then you can either use a positional argument or a keyed list (I prefer keyed lists).

              So if GUI indicates args:

              • Positional just place a y or n (or 0 1 your preference)
              • Keyed List – {DEBUG y}.

              I like to code that the value can be any case and I check to make sure a proper value is presented.

               

              Then when your proc is invoked the uargs has whatever you presented.

              If you would like an example (not Trxid but another UPoC) of how I do this email me.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #118137
              Paul Stein
              Participant

                Jim – thank you! I’ll give this a shot and if I get stuck send you an email.

              • #118138
                Charlie Bursell
                Participant

                  Why create a table?  It is superfluous.

                  If the proc has no startup, simply do this.

                  In the body of the proc add the following:
                  if {![info exist DEBUG]} {set DEBUG 0}

                  The above says you do not want echo statements.  If you do change above to
                  set DEBUG 1

                  Then for debug statements:
                  if {$DEBUG} {echo something}

                  There are methods I have used for turning debug on or off while the engine is running, but I won’t get into that here.

                • #118147
                  Paul Stein
                  Participant

                    Charlie – thank you for this, that makes sense.

                    Great suggestions everyone. I am going to work through these and report back with any questions

                Viewing 5 reply threads
                • You must be logged in to reply to this topic.