Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: Trace Up: Debugging, Logging, and Error Handling Previous: fail Statement


Input/Output Logging

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 a
result 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 := F
The 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.


next up previous contents index
Next: Trace Up: Debugging, Logging, and Error Handling Previous: fail Statement   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15