## A debugging tool

The PrintfActor lets you add your own debugging messages to what VSS (the server) can print out with the `SetPrintCommands` message.
(If you want to print debugging messages on the client side, just use your own printf's.)
SGI only: if you like, you can specify different colors to distinguish particular debugging messages.

To use the PrintfActor, load debug.so and create an actor of type PrintfActor.

### PrintfActor messages

In addition to the messages understood by all actors, the PrintfActor understands the following message:

SetColor `hActor color`
  Set the color of text to be printed.
  `color` should be one of the following:
  `nil black red green yellow blue magenta cyan white`
  where `nil` means the default color for your terminal window.
SetFile `hActor "filename"`
  Redirect output to a file, instead of to standard error. The file is erased if it already exists (fopen(filename, "w")). Output is flushed after every `printf` command (see below).
printf `hActor [format string] [z1] [z2] [z3] [z4]`
  Print a line on VSS's standard error (or to a file). At least one argument must be supplied.

  If the format string is omitted, then the `zi` arguments must be numeric (integer or floating point) and will be printed out with a space separating them and a trailing newline.

  If the format string is supplied, then it is used printf-style to format any subsequent floating-point arguments.

  Because of present parsing limitations, the format string must be surrounded by double quotes, and spaces in the string must be rendered as underscore characters. If you put literal whitespace in the format string, a syntax error will occur. (Sorry.) Also, \n meaning newline is recognized only at the end of the format string.

### Examples

`LoadDSO debug.so;
pr = Create PrintfActor;
`

Plain output of numbers, convenient for quick debugging:

  `LoadDSO msgGroup.so;
  m = Create MessageGroup;
  AddMessage m ... ;
  AddMessage m printf pr *0 *1 *5;`

Fancy formatting:

  `printf pr "foo:_%.2f_bar:%g\n" 19.42 5;`
  will print:
  `foo: 19.42 bar:5
  `