Tk Library Source Code

View Ticket
Login
Ticket UUID: 2418580
Title: log debug level is suppressed by default
Type: Bug Version: None
Submitter: jxmercog Created on: 2008-12-11 22:29:04
Subsystem: log Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2008-12-23 03:34:42
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2008-12-12 02:57:53
Description:
If you do a "package require log" then "log::lvIsSuppressed debug" the command returns a 1.  All the other levels return 0.  I placed a puts statement in the eval portion of log.tcl after the suppressed array is created and debug is set to 0 but once the package finished initializing it is a one. 
I was able to duplicate this in tcl version 8.3 on HP-UX and with activestates windows install of 8.5.2.

I found this while trying to turn on the verbose switch in the ftp package.  I ended up having to execute "::log::lvSuppress debug 0" before executing any ftp command to get the ftp package to print anything out.

Thanks,

John Mercogliano
User Comments: andreas_kupries added on 2008-12-23 03:34:41:
No need too. I have now updated the docs in the CVS, and also made a comment in the code to cross-reference the two relevant places. Changing state to 'fixed'.

jxmercog added on 2008-12-23 03:20:00:
Ah, I see it now.  Should add the default settings to the man pages.  It was not obvious in the code as the initialization of the array had everything set to '0'.  Plus, should not have to look in the code to figure out the default settings. Probably in the Levels section where you list all the log levels.  
Let me know if you want me to open up a new tracker item for the doc change.

Thanks,

andreas_kupries added on 2008-12-12 09:57:49:
Yes, that is intentional. The code doing this is in the last 6 lines of the file "log.tcl".
This was done because (we believe that) in most situations debugging output is not wanted.
Most wish to have such output only when actually debugging an application.