The log command can be used to open a log file to which all input and and output to Tcl will be written. Reading these log files can potentially be confusing when logging Tcl flow control commands such as while or for. This is because Tcl treats the body of these commands as an argument of the command. Thus when the command is echoed to the log file, the entire body of the command is echoed with it.
In order to make this situation less confusing, before commands are echoed to the command file, all newline characters are replaced by semicolons, and the resulting command line is trucated to 80 characters. Then any commands executed within the body of a flow control command are echoed as they are executed.