How to get current noice level (EO config) from Tcl proc?

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to get current noice level (EO config) from Tcl proc?

  • Creator
    Topic
  • #50287
    Sergey Sevastyanov
    Participant

    Does anyone know how to get current noise level (EO config) from a tcl procedure?

    Usually if I need a “debug” output in Tcl proc I insert a lot of echo commands, but then I have to remove them (or comment out) when move the code to production.

    Then if later I have a problem I have to turn them on again.

    If I knew how to get the current level I could program level of debug output depending on the current EO level.

    I guess I could use a file or parameter but it seems more logical to use existing mechanism.

    Thanks for you time

Viewing 4 reply threads
  • Author
    Replies
    • #65478
      Jim Kosloskey
      Participant

      Sergey,

      AI never got an answer to this question I asked a long time ago.

      So what I do in my procs is require a debug switch as an argument. Then wherever I desire to echo out debug information, I check to see if the switch is thrown. If it is I echo, otherwiseI don’t. Then I control the debug on and off by the switch argument which is set externally to the proc.

      email: jim.kosloskey@jim-kosloskey.com

    • #65479
      Charlie Bursell
      Participant

      I agree that Jim’s method is best for turning debug on/off.  It is what I do.  However, if you really need configured EO level:

      set fn [file join $::HciSiteDir NetConfig]

      nfLoad $fn processData hostData xlateData NetFilePrologue

      If you want process level

      set klst $processData(processName)

      set EO “”; keylget klst EODEFAULT

      If you want thread level

      set klst $hostData([string to lower threadName])

      set EO “”; keylget klst EODEFAULT

    • #65480
      Sergey Sevastyanov
      Participant

      Jim and Charlie,

      Thank you for your replies. I also was thinking about accessing NetConfig. What is wrong with that approach? Why do you both suggest to use the parameters rather than NetConfig?

      While I understand that accessing parameters is more efficient than reading a file and processing all these keylists to get the data I need, it shouldn’t be an issue because it can be done at Start mode, right?

      Is it because nfLoad is not “documented” command? I used it for couple of my other utilities I wrote and I wonder if that wasn’t a good choice?

      Thanks again

    • #65481
      Charlie Bursell
      Participant

      What happens if someone changes EO via hcicmd?  

      Also, I normally use my own debug statements in lieu of all of the EO  messages that are generated via EO Config.  I prefer to see my debug messages without wading through all of the other stuff.  It is the reason I always put a couple of line feeds before and after my debug messages, so they stand out in the log.

      If it is something you just need to add to the engine EO, I can understand what you are doing.  I don’t think Jim or I can tell you how to implement your site.  Only you have the required insight to do that.  We can only tell you what we do in normal situations.

      But for every rule there are exceptions.  There are only two people that do it right, you and me and sometimes I wonder about you  😀

    • #65482
      Sergey Sevastyanov
      Participant

      Charlie,

      I wasn’t arguing but rather wanted to understand the reasons.

      Your reply makes send even though you “sometimes wonder about me”

      😀

      Thanks for your reply

Viewing 4 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
4,964
Forums
28
Topics
9,104
Replies
33,616
Topic Tags
248