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


next up previous contents index
Next: logger.getformatted - Function Up: logger - Tool Previous: logger.purge - Function


logger.printtofile - Function



Package utility
Module tasking
Tool logger


Write some or all of the log file to a text file


Synopsis
printtofile(num, filename, colwidth, expr, ascommand)


Description
Again, while you will normally invoke printing from the GUI, you can make a text representation of the log file using this function. It is your responsiblity to actually print the file and delete it when done. The printer tool can do this for you.

The filenameargument can be given to specify the name of the file to be created. A blank name means that a file /tmp/aips_NNN will be created, where NNN is a number to make the name unique.

The colwidth argument lets you define if and how wide each column has to be printed. 0 means do not print. -1 means use default width. The order of the columns in this 4-element vector is time, priority, message, origin.

It is possible to filter and/or sort the log messages by giving the WHERE and ORDERBY parts of a TaQL expression in the expr argument. This has to be a vector of 0, 1, or 2 strings. If the first string is present, it has to be the WHERE expression. If the second string is present, it has to be the ORDERBY sort list.

The ascommand argument can be used to tell that only logged glish commands should be written (after removing the special prefix). This is, for example, useful to create a glish script from interactively given commands.



Arguments

num in How many messages to write (from end)
    Allowed: Int
    Default: -1 (all)
filename in Name of the output file
    Allowed: String
    Default: ''
colwidth in Width of each column (0 = do not print; -1 = use default)
    Allowed: Int vector
    Default: [-1,-1,-1,-1]
expr in select and/or sort command
    Allowed: String vector
    Default: ''
ascommand in Only write logged glish commands
    Allowed: Int
    Default: F)


Returns
String - file name




next up previous contents index
Next: logger.getformatted - Function Up: logger - Tool Previous: logger.purge - Function   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