Hey all,
I really want to redirect the messages sent from tclspace/pd-gui to the Pd window so I don't have to start Pd from the command line to get all the debug messages.
Anyone have some insight on redirecting stderr in Tcl? I looked a bit and having found the answer yet.
.hc
------------------------------------------------------------------------ ----
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
On Mon, 12 Nov 2007, Hans-Christoph Steiner wrote:
I really want to redirect the messages sent from tclspace/pd-gui to the Pd window so I don't have to start Pd from the command line to get all the debug messages. Anyone have some insight on redirecting stderr in Tcl? I looked a bit and having found the answer yet.
Afaik, pd.tk does not write to stderr, so, there is no point in doing this. What do you want to redirect instead?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801, Montréal QC Canada
On Nov 12, 2007, at 3:03 PM, Mathieu Bouchard wrote:
On Mon, 12 Nov 2007, Hans-Christoph Steiner wrote:
I really want to redirect the messages sent from tclspace/pd-gui to the Pd window so I don't have to start Pd from the command line to get all the debug messages. Anyone have some insight on redirecting stderr in Tcl? I looked a bit and having found the answer yet.
Afaik, pd.tk does not write to stderr, so, there is no point in doing this. What do you want to redirect instead?
It does write somethings to stderr
hans@palatschinken.local:~/Desktop > grep stderr ~/code/pure-data/pd- MAIN/src/u_main.tk puts stderr {setting pd_guidir to '.'} # puts stderr [bind all] puts stderr [format "open %s" $filename] puts stderr "menu_doc_browser non-directory $dir\n" puts stderr "doc_make_listbox: error listing $dir\n" puts stderr "Could not open $pd_guidir/ $subdir/$file\n" [snip]
Basically, the idea is to have every debug message go to the Pd window.
.hc
------------------------------------------------------------------------ ----
"[W]e have invented the technology to eliminate scarcity, but we are deliberately throwing it away to benefit those who profit from scarcity." -John Gilmore
Afaik, pd.tk does not write to stderr, so, there is no point in doing this. What do you want to redirect instead?
It does write somethings to stderr
hans@palatschinken.local:~/Desktop > grep stderr ~/code/pure-data/pd- MAIN/src/u_main.tk puts stderr {setting pd_guidir to '.'} # puts stderr [bind all] puts stderr [format "open %s" $filename] puts stderr "menu_doc_browser non-directory $dir\n" puts stderr "doc_make_listbox: error listing $dir\n" puts stderr "Could not open $pd_guidir/ $subdir/$file\n" [snip]
Basically, the idea is to have every debug message go to the Pd window.
then you should use the post() function (in C), wrapped by poststring2 in tcl, wrapped again by pd::post in pdlib.tcl.
if the user wants stuff printed to stderr, pd has a -stderr commandline switch, and all it's handled by post.
bye
On Nov 13, 2007, at 9:11 AM, federico wrote:
Afaik, pd.tk does not write to stderr, so, there is no point in doing this. What do you want to redirect instead?
It does write somethings to stderr
hans@palatschinken.local:~/Desktop > grep stderr ~/code/pure-data/pd- MAIN/src/u_main.tk puts stderr {setting pd_guidir to '.'} # puts stderr [bind all] puts stderr [format "open %s" $filename] puts stderr "menu_doc_browser non-directory $dir\n" puts stderr "doc_make_listbox: error listing $dir\n" puts stderr "Could not open $pd_guidir/ $subdir/$file\n" [snip]
Basically, the idea is to have every debug message go to the Pd window.
then you should use the post() function (in C), wrapped by poststring2 in tcl, wrapped again by pd::post in pdlib.tcl.
if the user wants stuff printed to stderr, pd has a -stderr commandline switch, and all it's handled by post.
What I want is to redirect error messages from Tk widgets to the Pd window. They are already posting to stderr, I don't think I can change that.
.hc
------------------------------------------------------------------------ ----
I have the audacity to believe that peoples everywhere can have three meals a day for their bodies, education and culture for their minds, and dignity, equality and freedom for their spirits. - Martin Luther King, Jr.
On Nov 14, 2007 5:23 PM, Hans-Christoph Steiner hans@eds.org wrote:
On Nov 13, 2007, at 9:11 AM, federico wrote:
Afaik, pd.tk does not write to stderr, so, there is no point in doing this. What do you want to redirect instead?
It does write somethings to stderr
hans@palatschinken.local:~/Desktop > grep stderr ~/code/pure-data/pd- MAIN/src/u_main.tk puts stderr {setting pd_guidir to '.'} # puts stderr [bind all] puts stderr [format "open %s" $filename] puts stderr "menu_doc_browser non-directory $dir\n" puts stderr "doc_make_listbox: error listing $dir\n" puts stderr "Could not open $pd_guidir/ $subdir/$file\n" [snip]
Basically, the idea is to have every debug message go to the Pd window.
then you should use the post() function (in C), wrapped by poststring2 in tcl, wrapped again by pd::post in pdlib.tcl.
if the user wants stuff printed to stderr, pd has a -stderr commandline switch, and all it's handled by post.
What I want is to redirect error messages from Tk widgets to the Pd window. They are already posting to stderr, I don't think I can change that.
try looking here if you find something useful: http://wiki.tcl.tk/15945
afaik overriding puts it's not a good idea, since puts does a lot more than you can imagine.... so it has to be done in a clever way... good luck ;)