public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Console Window Logging.
@ 2002-03-07 15:04 Duane Ellis
  2002-03-07 15:48 ` Keith Seitz
  2002-03-07 16:15 ` Martin M. Hunt
  0 siblings, 2 replies; 3+ messages in thread
From: Duane Ellis @ 2002-03-07 15:04 UTC (permalink / raw)
  To: insight


Several people I support have asked me for a means by which to 'log
the console window output' to a file. What I want is anything written
to the TK Console window to go to *BOTH* the TK console window, and a
file, ie: "foobar.log"

How can I do this? {I cannot use the "-nw" option, I have
to have tk/tcl operating in this situation}

Isn't there some place in the tk/tcl code that deals with
the console window where I can 'hack' this in?

I need the ablity to turn this log ON and OFF
from a typed command, something like:

     tk Console::LogToFile start foobar.log
     tk Console::LogToFile stop

It seems that "Console::insert {line}" is the right place I know
normal tcl/tk - this "itb/ith" stuff is funky and I'm abit confused,
and I don't know how fiddle with this part.

Any suggestions?

-Duane.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Console Window Logging.
  2002-03-07 15:04 Console Window Logging Duane Ellis
@ 2002-03-07 15:48 ` Keith Seitz
  2002-03-07 16:15 ` Martin M. Hunt
  1 sibling, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2002-03-07 15:48 UTC (permalink / raw)
  To: Duane Ellis; +Cc: insight

On Thu, 7 Mar 2002, Duane Ellis wrote:

> Several people I support have asked me for a means by which to 'log
> the console window output' to a file. What I want is anything written
> to the TK Console window to go to *BOTH* the TK console window, and a
> file, ie: "foobar.log"
>
> How can I do this? {I cannot use the "-nw" option, I have
> to have tk/tcl operating in this situation}

It's really simple... Do you have a support contract? (O:-)

Take a look at gdbtk_tcl_fputs in interface.tcl. That should give you a
big head start. (Also look at gdbtk_fputs in generic/gdbtk-hooks.c and
the calls to gdbtk_fileopen in gdbtk.c's gdbtk_init.)

Keith


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Console Window Logging.
  2002-03-07 15:04 Console Window Logging Duane Ellis
  2002-03-07 15:48 ` Keith Seitz
@ 2002-03-07 16:15 ` Martin M. Hunt
  1 sibling, 0 replies; 3+ messages in thread
From: Martin M. Hunt @ 2002-03-07 16:15 UTC (permalink / raw)
  To: duane_ellis, insight

On Thursday 07 March 2002 03:03 pm, Duane Ellis wrote:
> Several people I support have asked me for a means by which to 'log
> the console window output' to a file. What I want is anything written
> to the TK Console window to go to *BOTH* the TK console window, and a
> file, ie: "foobar.log"
>
> How can I do this? {I cannot use the "-nw" option, I have
> to have tk/tcl operating in this situation}
>
> Isn't there some place in the tk/tcl code that deals with
> the console window where I can 'hack' this in?
>
> I need the ablity to turn this log ON and OFF
> from a typed command, something like:
>
>      tk Console::LogToFile start foobar.log
>      tk Console::LogToFile stop
>
> It seems that "Console::insert {line}" is the right place I know
> normal tcl/tk - this "itb/ith" stuff is funky and I'm abit confused,
> and I don't know how fiddle with this part.

We should really update the README.  Insight is written in [incr tcl], which 
is an OO version of tcl/tk.  ith is an incr tcl header and itb is the body.  
All classes are declared in ith files and the methods and procs are 
implemented in itb files. You can actually edit console.itb while Insight is 
running, then source the new console.itb file and open a new console window 
to test it without ever exiting Insight.  There is a convenient interface to 
do this in the debug window menu. When you change the header, you must exit 
and restart Insight. You should really use the debug window when developing.

What you describe should be very simple.  Declare LogToFile as a public proc 
in console.ith.  Also pick a private variable to hold the filename.  
Implement Console::LogToFile in console.itb.  Modify insert to write to the 
log file if one is defined.

-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-08  0:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-07 15:04 Console Window Logging Duane Ellis
2002-03-07 15:48 ` Keith Seitz
2002-03-07 16:15 ` Martin M. Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).