Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

smtpd and ::log

0 views
Skip to first unread message

Roar Johnsen

unread,
Feb 17, 2005, 6:56:48 AM2/17/05
to
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

unread,
Feb 17, 2005, 8:09:34 PM2/17/05
to
Roar Johnsen <roa...@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

unread,
Feb 18, 2005, 2:05:08 AM2/18/05
to

Pat Thoyts <c...@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 <akup...@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
}

Roar Johnsen

unread,
Feb 21, 2005, 3:20:13 AM2/21/05
to
<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 :)

0 new messages