logging to a text widget

  • Thread starter Alexandre Guimond
  • Start date
A

Alexandre Guimond

Hi. I'm using the logging package. I would like to send my log messages
to a Text widget creating using Tkinter. I was wondering if there was a
logging handler class that would do this. It seems that the standard
handlers do not support this. Has anyone tried to do this?

Thx for any help,

alex
 
M

Martin Franklin

Alexandre said:
Hi. I'm using the logging package. I would like to send my log messages
to a Text widget creating using Tkinter. I was wondering if there was a
logging handler class that would do this. It seems that the standard
handlers do not support this. Has anyone tried to do this?

Alex,

To be honest I haven't used the logging package (it's on my todo list ;)
but I normally sub class the Text widget, give it a write method then
send stdout / stderr to it normally (sys.stdout = mytextWidget)

At the same time I also add scrollbars and in the write method I scroll
to the latest message.

Cheers
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top