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 - Constructor Up: tasking - Module Previous: scripter.reset - Function


logger - Tool



Package utility
Module tasking


Postscript file available

Tool for logging

include "logger.g"



Description

The logger is the tool managing messages from scripts, clients, etc.. In general it writes the messages into a log file and shows them on the screen in a text window or a GUI.

Log messages are produced by binary executable programs and Glish scripts. You may also create log messages yourself through the ``note'' member function of logger. You will almost always be interacting with defaultlogger, which is also known as dl to save you some typing.

Note: Users should use the global note function to create log messages. This has sufficient flexibility to do everything that the ``log'' and ``note'' member function of logger can do. note checks for the existance of the defaultlogger and sends messages to the screen if the defaultlogger is not present.

The log messages are sent both to your screen (normally to a GUI, but you can have them come out in your terminal window instead if you prefer) and to a file (an AIPS++table). This file will continue to accumulate messages until you purge them.

By default the log file is $ \sim$/aips++/aips++.log, however you may override this default location by setting some variables in your $ \sim$/.aipsrc file as described below.

The first column is the time that the message was produced. The default is to display the GMT times. If you want to see local times instead, you can set the time zone offset with another .aipsrc variable.
The second panel gives the priority of the message. Messages may presently be of DEBUGGING, NORMAL, WARN, and SEVERE priority. When a SEVERE level message is shown a pop-up window with a dismiss button also comes up to make sure you don't miss it. In the log window WARN and SEVERE level messages are highlighted and shown in red instead of green to make them stand out.
The third panel contains the (hopefully!) informative messages. Note that messages may be multiple lines, the other column values are only shown at the start of the message, not for every line in it.
The final panel contains the location where the message came from. This may be of little interest to you.
You can control the panels (size, order, and which to see) by .aipsrc variables and by the Options menu. They can also be used to control whether a few buttons will be displayed at the bottom. It makes it possible to make the log window as big or small as you like.

It is possible to execute a query on the log window; i.e. to select or sort messages. They will be displayed in a separate log window which is similar to the main window, but also shows the select and sort command used in the query. One can execute another query on that new window, etc..


The File menu contains various entries to deal with log messages.

Note that the commands above are always executed on the log file and not on the messages in the window. For example, a print is done in a window resulting from a query. This may print more messages than there are in the window, because in the mean time new messages may have been added to the log file.

A dismiss of a window also dismisses its child windows resulting from queries. If you dismiss the main log window, log messages will come out on your terminal instead of the GUI. When you get tired of this, you can type dl.gui() at the Glish command prompt to restart the GUI.

The only logger functions you might perhaps call are loginput() and logoutput() to control what is logged from Glish.



Aipsrc Variables

user.aipsdir   AIPS++info directory
    Allowed: Any writable directory. If it doesn't exist it will be created
    Default: $ \sim$/aips++
tzoffset   Timezone offset in hours
    Allowed: e.g., Socorro is -7
    Default: 0
logger.file   Log file name (no path!)
    Allowed: any (none means temporary log file is used)
    Default: aips++.log
logger.default   Where to write log messages
    Allowed: gui or screen
    Default: gui
logger.showbuttons   Show buttons at bottom of the GUI?
    Allowed: Bool
    Default: T
logger.glish   What to log from Glish
    Allowed: input, output, both, or none
    Default: input
logger.guishow   Which panels to show in GUI and in which order
    Allowed: any of time,priority,message,origin
    Default: time,priority,message
logger.height   Height of GUI panels
    Allowed: Integer
    Default: 8
logger.timewidth   Width of time panel (if shown)
    Allowed: Integer
    Default: 20
logger.prioritywidth   Width of priority panel (if shown)
    Allowed: Integer
    Default: 6
logger.messagewidth   Width of message panel (if shown)
    Allowed: Integer
    Default: 75
logger.originwidth   Width of origin panel (if shown)
    Allowed: Integer
    Default: 25
logger.autoscroll   Scroll GUI to the end after appending a message
    Allowed: Bool
    Default: T
logger.background   Normal background color of the GUI
    Allowed: String
    Default: xing

Constructors
logger Construct logger tool
Functions
attach Attach to another log table
brief Write fewer fields in log messages
getformatted Get a formatted representation of the log file
gui Use the GUI
log Add a message to the logging system
loginput Log input to Glish?
logoutput Log output from Glish?
nmessages How many log messages are in the file
note Add a note to the logging messages
printtofile Write some or all of the log file to a text file
purge Delete some or all messages from the log file.
screen Use the screen for logging messages
verbose Write more fields in log messages




next up previous contents index
Next: logger - Constructor Up: tasking - Module Previous: scripter.reset - 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