Home > Archive > Tcl > February 2005 > smtpd and ::log
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Roar Johnsen 2005-02-17, 9:03 am |
| 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.
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 :)
| |
| Pat Thoyts 2005-02-18, 3:59 am |
| Roar Johnsen <roarjo@newmedia.no> writes:
>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
| |
| Andreas Kupries 2005-02-18, 3:59 am |
|
Pat Thoyts <cng@mfcyng.serrfreir.pb.hx> writes:
> 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 <akupries@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
}
| |
| Roar Johnsen 2005-02-21, 8:58 am |
| <snip>
> 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 :)
|
|
|
|
|