| www.delorie.com/gnu/docs/gnugo/gnugo_54.html | search |
![]() Buy GNU books! | |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A function gprintf() is provided. It is a cut-down
printf, supporting only %c, %d,
%s, and without field widths, etc. It does, however,
add some useful facilities:
%m
Takes two parameters, and displays a formatted board co-ordinate.
Trace messages are automatically indented to reflect the current stack depth, so it is clear during read-ahead when it puts a move down or takes one back.
format string suppresses the indentation.
A variant mprintf sends output to stderr. Normally
gprintf() is wrapped in one of the following:
TRACE(fmt, ...):
Print the message if the 'verbose' variable > 0.
(verbose is set by -t on the command line)
DEBUG(flags, fmt, ...):
WhileTRACEis intended to afford an overview of what GNU Go is considering,DEBUGallows occasional in depth study of a module, usually needed when something goes wrong.flagsis one of theDEBUG_*symbols in `engine/gnugo.h'. TheDEBUGmacro tests to see if that bit is set in thedebugvariable, and prints the message if it is. The debug variable is set using the-dcommand-line option.
The variable verbose controls the tracing. It
can equal 0 (no trace), 1, 2, 3 or 4 for increasing
levels of tracing. You can set the trace level at
the command line by `-t' for verbose=1,
`-t -t' for verbose=2, etc. But in
practice if you want more verbose tracing than level
1 it is better to use gdb to reach the point where
you want the tracing; you will often find that the
variable verbose has been temporarily set to zero
and you can use the gdb command set var verbose=1
to turn the tracing back on.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| webmaster donations bookstore | delorie software privacy |
| Copyright © 2003 by The Free Software Foundation | Updated Jun 2003 |