Logging your Zephyrgrams

You can log zephyrgrams to a file as well as receive them on your screen, with only a few simple changes to your .zwgc.desc file.

If you want to save the complete zephyrgram (everything you see on your screen), you should add the following things to your .zwgc.desc file. First, near the beginning of the file, before any of the code that actually places and formats zephyrgrams, you need to add the line

appendport "outf" getenv("HOME")+"/.zlog"

which tells .zwgc.desc that ``outf'' refers to a file in your home directory called .zlog.

Then, wherever you want a particular kind of zephyrgram (like personal zephyrgrams, or all zephyrgrams to a particular instance) to be recorded in the file, you would need to find where those zephyrgrams are specified in the .zwgc.desc file and add the command

put "outf"

after the line (that should already be there) that says just put.

Another thing that can easily done using this infrastructure is to log Zephygrams only if a certain variable is set. To do this, instead of just adding the put "outf" line mentioned above, you would add several lines of code. Near the beginning of your .zwgc desc, you would put the line:

set log = zvar("log")

Then, in the locations where the zephyrgrams you want to log are mentioned, instead of just putting put "outf", you would add the lines

if ($log == "true") then
put "outf"
endif

Then, to start logging zephyrgrams, you would need to type

zctl set log "true"

To stop logging them, you would need to type

zctl unset log

Geoffrey G Thomas 2009-02-09