Next
Prev
Up
Creating and Using Debug Flags
The debug
module lets you embed debugging code in your Tcl scripts. The
functions supplied by this module make it possible to generate selective
debugging output depending on so-called debug flags. Furthermore you
may choose multiple output channels, e.g. debugging output can be directed to
stdout
and to a log file. The debug flags created by the modules of
this library are covered in a separate section.
juf_dbg_add_flags
[ARG ...]
- Creates the debug flags given by the arguments. Any list arguments are
processed as a debug flag (first element) and an arbitrary number of
subflags.
juf_dbg_set_flags
[ARG ...]
- Enables all debug flags and their subflags given by the arguments.
juf_dbg_out
FLAG [ARG ...]
- If the debug flag FLAG is set, the arguments are printed on all
output channels. Default channel is
stdout
.
juf_dbg_out_eval
FLAG SCRIPT
- If the debug flag FLAG is set, SCRIPT is evaluated in the
context of the caller and the result is printed on all output channels. Default
channel is
stdout
.
juf_dbg_isflag
FLAG
- Returns 1 if flag corresponds to a debug flag, 0 otherwise.
juf_dbg_set_channels
[ARG ...]
- Directs the output generated by
juf_dbg_out
to the channels
indicated by the file identfiers given by the arguments. Calling this function
without any argument disables output by juf_dbg_out
. Default
channel is stdout
.
Written by Stefan Hornburg <racke@gundel.han.de>
Last modified 10 April 1997