Come analyze HEASARC, IRSA, and MAST data in the cloud! The Fornax Initiative is now welcoming all interested beta users.
Logging
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 truncated to 80 characters. Then any commands executed with in the body of a flow control command are echoed as they are executed.
Consider the following sequence of tcl commands within XSPEC:
XSPEC> log
Logging to file: xspec.log
XSPEC> set i 1 ; set product 1
1
XSPEC> while {$i <= 5} {
XSPEC> set product [expr $product * $i]
XSPEC> incr i
XSPEC> }
XSPEC> set product
120
XSPEC>
This would produce the following output in the file xspec.log:
Logging to file: xspec.log
XSPEC> set i 1
set product 1
1
XSPEC> while {$i <= 5} {;set product [expr $product * $i];incr i;}
expr $product * $i
set product [expr $product * $i]
incr i
expr $product * $i
set product [expr $product * $i]
incr i
expr $product * $i
set product [expr $product * $i]
incr i
expr $product * $i
set product [expr $product * $i]
incr i
expr $product * $i
set product [expr $product * $i]
incr i
XSPEC> set product
120
XSPEC>