/log

Usage:

/LOG [-ligw[world]] [OFF|ON|file]


Enables or disables logging, or lists currently open log files. An [-ligw] option specifies which history is used (only one can be used). The [OFF|ON|file] argument specifies what action is taken on that history.

Options:

-wworld
Output from world only.
-w
Output from the current world.
-l
Local output (i.e., output generated by TF).
-i
Keyboard input.
-g
Global output (all worlds and local TF output).

Arguments:

OFF
Disable specified log, or all logs if unspecified.
ON
Log to ${LOGFILE}; -g is assumed if -ligw not given.
file
Log to file; -g is assumed if -ligw not given.
(none)
With no option, lists all open logs.
(none)
With an -ligw option, same as "ON".

When logging is enabled for a history, lines that are normally recorded in that history are also appended to the log file (unless the line has the "L" nolog attribute). The previously existing contents of the file, if any, are not affected.

It is possible to have multiple log files open simultaneously. It is also possible to have several types of output go to the same log file, by using several /log commands. For example,

  /log -i tt.log
  /log -wTT tt.log
  /log -g on
will send input from the keyboard and output from the world TT to the file "tt.log", and also send all (global) output to the file named by the LOGFILE macro.

This example logs the current world's output to a file whose name contains the world's name and today's date:

  /eval /log -w ${world_name}.$[ftime("%F")]
  

The functions of the /logme command in older versions of TF can be performed with /log -i.

Wrapping will be done in the log file only if the %{wraplog} variable is "on".

Logging is disabled by default. The default value of ${LOGFILE} is "tiny.log".

Note: the natural logarithm function was renamed from log() to ln() in version 5.0, to avoid confusion with /log.

See: %wraplog, history, nlog() fwrite()


Back to index
Back to tf home page
Copyright © 1995, 1996, 1997, 1998, 1999, 2002, 2003, 2004, 2005, 2006-2007 Ken Keys