Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
It is useful to have a log of input to Glish and the output Glish
generates. There are several ways which this logging information can
be processed. Probably the simplest way is to have logging information
go to a file. Setting system.output.log
to a text string, which
represents a valid directory path to a file. If the path is valid, all
input and all output will be logged to that file. The following
commands:
system.output.log := "one.log" a := array(1:16,4,4) print a system.output.log := F print aresult in a file called
one.log
in the current directory with
the contents:
a := array(1:16,4,4) print a #[[1:4,] # 1 5 9 13 # 2 6 10 14 # 3 7 11 15 # 4 8 12 16] system.output.log := FThe output generated by Glish is preceeded by a ``#''. If you want to log only the commands, setting
system.output.ilog
will
log only the commands, i.e. leaving out the lines commented by ``#''
above. Similarly, setting system.output.olog
logs only the output
and not the input.
For more complicated applications, each of these record fields, i.e. log, ilog, and olog, can be set to a function which takes a single parameter. The function will then be called repeatedly with the line to be logged; the function then logs the line. Likewise, these fields can be assigned to an agent. In this case, each line to be logged is sent as an event where the event name is append and the event value is the line to be logged.