Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


take record of all kind of application errors from GUI

take record of all kind of application errors from GUI

take record of all kind of application errors from GUI

I need to catch all kind of application errors, and put a record of it, But, code is that much huge, i cannot put catch on every procedure. So there must be one gateway for all the application errors. Hence if any procedure got any application errors, i will record the data and keep for further analysis

thanks in advance

RE: take record of all kind of application errors from GUI

please if anyone can tell any way of keeping record of all the application errors flagged during usage. I tried using tk/bgerror.tcl
But this way will help on my machine only. If i install my application on other system, then i need to change tk binary accordingly. which is currently no possible.

thanks in advance.

RE: take record of all kind of application errors from GUI

Try setting stderr to a file channel.


  ActiveTcl User Guide   

Tcl/Tk Documentation > TclLib > GetStdChan
Tcl/Tk Applications | Tcl Commands | Tk Commands | Tcl Library | Tk Library
Tcl_GetStdChannel, Tcl_SetStdChannel - procedures for retrieving and replacing the standard channels
#include <tcl.h>
Tcl_SetStdChannel(channel, type)

int type (in) The identifier for the standard channel to retrieve or modify. Must be one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR.
Tcl_Channel channel (in) The channel to use as the new value for the specified standard channel.
Tcl defines three special channels that are used by various I/O related commands if no other channels are specified. The standard input channel has a channel name of stdin and is used by read and gets. The standard output channel is named stdout and is used by puts. The standard error channel is named stderr and is used for reporting errors. In addition, the standard channels are inherited by any child processes created using exec or open in the absence of any other redirections.
The standard channels are actually aliases for other normal channels. The current channel associated with a standard channel can be retrieved by calling Tcl_GetStdChannel with one of TCL_STDIN, TCL_STDOUT, or TCL_STDERR as the type. The return value will be a valid channel, or NULL.

A new channel can be set for the standard channel specified by type by calling Tcl_SetStdChannel with a new channel or NULL in the channel argument. If the specified channel is closed by a later call to Tcl_Close, then the corresponding standard channel will automatically be set to NULL.

If a non-NULL value for channel is passed to Tcl_SetStdChannel, then that same value should be passed to Tcl_RegisterChannel, like so:

Tcl_RegisterChannel(NULL, channel);

This is a workaround for a misfeature in Tcl_SetStdChannel that it fails to do some reference counting housekeeping. This misfeature cannot be corrected without contradicting the assumptions of some existing code that calls Tcl_SetStdChannel.
If Tcl_GetStdChannel is called before Tcl_SetStdChannel, Tcl will construct a new channel to wrap the appropriate platform-specific standard file handle. If Tcl_SetStdChannel is called before Tcl_GetStdChannel, then the default channel will not be created.

If one of the standard channels is set to NULL, either by calling Tcl_SetStdChannel with a NULL channel argument, or by calling Tcl_Close on the channel, then the next call to Tcl_CreateChannel will automatically set the standard channel with the newly created channel. If more than one standard channel is NULL, then the standard channels will be assigned starting with standard input, followed by standard output, with standard error being last.

See Tcl_StandardChannels for a general treatise about standard channels and the behaviour of the Tcl library with regard to them.

Bob Rashkin

RE: take record of all kind of application errors from GUI

thanks for your support. :)
I did it in another way.
If anyone need it. Please try sourcing bgerror.tcl file again with all your editions.
It will override the previous bgerror.tcl and easiely you can catch these errors.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close