next up previous
Next: Debugging and Tracing Up: Built-In Predicates Previous: User Toplevel Manipulation

Creating a Protocol of the User Interaction

SWI-Prolog offers the possibility to log the interaction with the user on a file. gif All Prolog interaction, including warnings and tracer output, are written on the protocol file.

protocol( +File)

  Start protocolling on file File. If there is already a protocol file open then close it first. If File exists it is truncated.
protocola( +File)

  Equivalent to protocol/1, but does not truncate the File if it exists.
noprotocol

  Stop making a protocol of the user interaction. Pending output is flushed on the file.
protocolling( -File)

  Succeeds if a protocol was started with protocol/1 or protocola/1 and unifies File with the current protocol output file.



Passani Luca
Tue Nov 14 08:58:33 MET 1995