messagefilter has the same syntax as the
commentfilter except that the word
commentis replaced by the word
message. It consists of the word
message, optionally followed by the keyword
quiet, and followed by a list of arguments in parentheses. Each argument is any filter. If there is only one argument, the enclosing parentheses can be omitted.
message ("The value of x is: " x) message ("The number of black pieces is: " #a) message ("The checking pieces are: " A attacks k) message ("The initial position is: " position 0)
message filter converts its arguments to a string just like
comment does. However, instead of including this string as an annotation in the
PGN file, the
message filter writes the string to the standard output. The string is prefaced by an indication of the current move number, the side to move, the game number. If the currentposition is in a variation, the positionid of the current position is also output.
message filter is primarily intended for use in debugging: it outputs its message as soon as the filter is invoked. This can be especially helpful when a game is unexpectedly not being matched at all by CQL: the
comment filter is hard to use in this situation since the comments won't even be printed.
message can often output a lot of data, when debugging it is often helpful to first narrow down the problematic game either to its own file or to a specific game number. Then run
cql just on that game number using the
--gamenumber command line option.
Use of quiet with messageIf the keyword
quietimmediately follows the keyword
message, then only the argument to
message quiet ("Fen: " fen)