message
Themessage
filter has the same syntax as the comment
filter except that the word comment
is 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: " #▲) message ("The checking pieces are: " △→♚) message ("The initial position is: " position 0)
The 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.
The 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.
Because 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 message
If the keywordquiet
immediately follows the keyword message
, then only the argument to message
is printed:
message quiet ("Fen: " fen)