Resource: message
Resource | message |
Command Line | -me=level |
Environment Variable | wxpmess |
Default Value | for most programs out2 |
Each WXP program will produce various types of textual output. The bulk of this is informative in terms of menus, prompts and messages describing the processing of data and what is going on behind the scenes. The output is then prioritized by message level. The major levels are as follows:
- none - this turns off ALL printing and in not recommended unless you are running the program in a batch mode or from within a shell script. This will turn off printing of prompts and errors messages.
- print - this is REQUIRED output in the program and is relagated to prompts and menus that must be printed for the proper working of programs.
- error - these are program ending error messages. If an error occurs that forces the program to terminate, it will print out an error message.
- warn - these are messages that often indicate a problem in the program but do not force the program to terminate.
- mess - these are general messages which are often descriptive. These include a printout of the program name and version level and descriptions of what the program is doing as in reading databases, fitting data to a grid.
- out1 - out4 - various types of general output from the program. If the program performs calculations, these will be printed out at these levels. Levels out1 and out2 are printed by default and these represent output that is most commonly displayed. Levels out3 and out4 contain extraneous data that you may still want to look at but would overclutter the display if were printed by default.
- debug - these are debug messages that are often left in WXP programs to trace down any possible bugs in the program. Setting this level will produce large amounts of output which require either a pager like pg or more or piping the output to a file.
There are sublevels which allow the user to be even more selective. They are as follows in the order list:
- printa, printb, printc, printd
- errora, errorb
- warnc, warnd
- messa, messb, messc, messd
- out1a, out1b, out1c, out1d
- out2a, out2b, out2c, out2d
- out3a, out3b, out3c, out3d
- out4a, out4b, out4c, out4d
- debuga, debugb, debugc, debugd
Each program will list what is printed under each level in the Program Reference.
Setting the message resource
By using the message resource, you can selectively turn on and off various types of output. The first form just specifies a message level:
-me=out1
This will enable the level out1 (and all of its sublevels) plus all levels of higher priority (including print, error, warn, mess).
WXP also allows you to selectively turn levels on and off:
-me=+out3a,+out4
This will still default to out2 so all higher priority levels will be included but you will also print out all messages with either out3a or out4 priorities. To print just those levels, you need to turn off all printing first:
-me=none,+out3a,+out4
This way you can be highly selective.
Paging options
In some WXP programs, the amount of text output requires an automatic pause. This is set so that one page of text (22 lines) is shown at any one time. You will see the following:
Press return to continue
You must hit the return key to see the next screenfull of output.
In some cases like printing the output, you may want to turn this feature off:
-me=nopage
In some cases, you may want to pause program output (especially in debug model) on programs that don't have automatic pauses. To do this, you specify:
-me=page
If the 22 line limit is a bit too small (since Xterms can have 50 or more lines in them), you can change the number of lines:
-me=page,line=50
File output options
Since all output from WXP goes through the message facility, it is easy to turn messages on and off by setting the message level. The other capability would be to output the text to a file. WXP offers several possibilities. The first is to output the text directly to a file with no output to the screen.
-me=fi:filename
This will direct all output to filename
. If you want to echo the
output to the screen as well, add a plus "+":
-me=+fi:filename
The final option is to prepend a date/time string to the beginning of each line in the data file:
-me=@fi:filename
The output will look like:
96 DEC 7 22:13:15 UTC -- Searching for ILX...
There is one more possibility and that is to pipe the output to another program. For example, we want to print the sounding data directly from WXP without saving the output to a file first:
uacalplt -cu -id=ILX -me="+fi=|print"
All the output that goes to the screen will also be piped to the printer (the print command in this case). You will notice the quotes around the specification. This is to make sure the "|print" is not interpreted by the shell. If you leave the quotes off, the output will only go to the printer and nothing will show up on the screen. This setup insures the user will see the output on the screen and also get a hardcopy of the output.
Last updated July 30, 1998