I use the smtpd library and created a very simple mailserver.
Recently I added GUI, which works very well.
Now I want it to be easy to turn on and off debug information.
I have created a button to turn it on and off. But I cannot get the
debug information to appear in a text widget.
Before, I just uncommented/commented the following lines :
#::log::lvSuppress debug
#::log::lvSuppress notice
Now I want that same info appear in a text widget.
How can I do that
Best Regards
Roar :)
>Hi...
>
>I use the smtpd library and created a very simple mailserver.
>Recently I added GUI, which works very well.
>
>Now I want it to be easy to turn on and off debug information.
>I have created a button to turn it on and off. But I cannot get the
>debug information to appear in a text widget.
There is a log::Puts command which is called to write all output. I
suggest you create something like
proc ::log::Puts {level text} {
.text insert end $text TAG-$level
return
}
--
Pat Thoyts http://www.zsplat.freeserve.co.uk/resume.html
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
> There is a log::Puts command which is called to write all output. I
> suggest you create something like
>
> proc ::log::Puts {level text} {
> .text insert end $text TAG-$level
> return
> }
I advise against this. Doing this overwrites a procedure internal to
the log package with external code. That I consider a bad idea.
Create a procedure like above, with a different name, and then use the
API command "log::lvCmd" and "log::lvCmdForall" to tell the log
package to use this command for the output.
See also http://tcllib.sourceforge.net/doc/log.html, section
DESCRIPTION for basic examples, or the manpage for log.
--
So long,
Andreas Kupries <akup...@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
}
> the log package with external code. That I consider a bad idea.
>
> Create a procedure like above, with a different name, and then use the
> API command "log::lvCmd" and "log::lvCmdForall" to tell the log
> package to use this command for the output.
>
> See also http://tcllib.sourceforge.net/doc/log.html, section
> DESCRIPTION for basic examples, or the manpage for log.
</snip>
Thanks alot guys.. It worked like a charm.. :)
Best Regards
Roar :)