spec

Software for Diffraction

2.4.2.2. - Log Files (log, dlog, elog, tlog)



Four types of log files can be created for debugging or archiving purposes. The name or extension establishes the type of log file created. A regular log file is a file with a name beginning with the characters log or ending with the characters .log. All output sent to any device is sent to a log file.

A file beginning with dlog or ending with .dlog will collect all output sent to any device as does a regular log file, but debugging messages (generated when a value is assigned to the built-in variable DEBUG) are only written to such a file, not to the screen or any other file or device.

A file beginning with elog or ending with .elog records typed commands, error messages and optional time stamps. The file is intended to be useful to administrators trying to diagnose user problems. Commands entered at the spec prompt are logged prefixed by a #C. Error messages produced by the built-in C code or generated by the eprint or eprintf() built-in keywords, are logged prefixed by a #E. If time stamps are enabled (via the spec_par() "elog_timestamp" option), the UNIX epoch and the corresponding date string are logged (at the time-stamp interval) prefixed by a #T.

Finally, a file beginning with tlog or ending with .tlog collects output sent to the "tty" device (the screen). Unlike regular log files, output sent to other files or devices will not be saved to a tlog file.

For all types of log files, output is not turned off on errors or ^C interrupts, and output generated by functions that "paint" the screen, such as tty_fmt(), tty_move(), plot_move(), show_help(), spec_menu() and data_plot(), isn't written to the files.